Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Looking for a Physics / Collision library for openGL for C/C++

Author
Message
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 15th Feb 2012 21:20
Hey, I've used Sparky's with DBP and GDK and for a collision library and it's very fast. I've not yet tried any of the physics libraries for DBP or GDK but I'll deffo be needing something soon for my new found calling (working with openGL and glut). I've heard of Tokamak and Bullet, but I really do not know which one would be the best to start using.

Has anyone had any experience using C/C++ physics wrappers that may be able to give advice on what the best route to go down would be?

Thanks in advance...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
budokaiman
FPSC Tool Maker
15
Years of Service
User Offline
Joined: 24th Jun 2009
Playing: Hard to get
Posted: 15th Feb 2012 21:46
Bullet, without a doubt. It's very fast, has plenty of features and it's cross-platform. Newton is another good one, but I'd still say to stick with Bullet.


There's no kill switch on awesome.
heyufool1
16
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 15th Feb 2012 22:05
You can also try Havok. It's free to use in commercial games if you don't sell the game for more than $10.

"So hold your head up high and know. It's not the end of the road"

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Feb 2012 01:17
Cool... I've had a good nosey at info about the Bullet library. So much difference in setting them things up compared to what you have to do in DBP and GDK.

Havok looks great but I'm not too sure about the licensing for it at the moment. I'll read up a lot more on it.

EDIT: Does look like anything over $10... Hmmm...

Everything has been put on hold temporarily anyway until I figure out a way to get round not being able to use glGenBuffers() and glGenBuffersARB() as I'm only running on openGL version 1.4. I'm just about to look into VAO's as an alternative to VBO's (if they're available on my crappy laptop) but I'm not holding my breath. If not, it has to be display lists...

Thanks for the info...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 16th Feb 2012 01:46
Quote: " as I'm only running on openGL version 1.4."


Do you need a graphics card upgrade or just GLEW?

Dar13
17
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 16th Feb 2012 03:43
I'd recommend Bullet, but integrating it with DarkGDK is a pain in the rear. If you're using a right-handed coordinate system, it's a piece of cake and if your graphics engine can take quaternions for rotations it's even easier to integrate.

Here's a tip though, use motionstates as much as you can. They're easy to setup, easy to maintain, and easy to clean-up after. Worry free, and you can customize their behavior(for freezing an object in mid-air, add a flag in the class that when activated, prevents position updates).

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Feb 2012 03:54
Yeah, after I posted that I did some research on alternatives to the VBO's from GL 1.5 onwards. I'm unsure as to a move onto other GL libraries, I'm using opengl and freeglut at the moment. Although what I might do is check the speed differences between the GLEW version and the VAO's from the GL 1.1 (those that reference physical RAM instead of GPU loaded buffers).

Unfortunately I can't upgrade the graphics on this laptop. It's a Radeon Xpress 200M. (One day I will win the lottery and have an Alienware)

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 16th Feb 2012 14:07
Quote: "integrating it with DarkGDK is a pain in the rear."


Not really, you just set a flag in the sObject structure to override the object's matrix and then copy the matrix bullet gives you into the one in sObject each frame.

[b]
Oster200
14
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 18th Feb 2012 05:34
For thoughs that do use Bullet how do i install i followed the directions on their web-page but i got this error


I did this over about 5 times with cmake and i still get the same error. i even tried a older version any one know why this is happening. i also tried switching the runtime thing so that is not a problem.

where is the OpenGLSupport_Debug.lib becasue cmake dint do it right or there is a trick im not doing.

Here is the forum on Bullet it might be in more depth but if you know why just leave a reply on this forum or the bullet i will be watching both.

California is a fine place to live - if you happen to be an orange. - Fred Allen
If you die in an elevator, be sure to push the Up button.
Dar13
17
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 18th Feb 2012 06:13
Quote: "Not really, you just set a flag in the sObject structure to override the object's matrix and then copy the matrix bullet gives you into the one in sObject each frame."

You don't have to flip the matrix? Bullet uses a right-handed coordinate system, while DarkGDK uses a left-handed one. If it's that simple, I feel quite stupid now.

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 18th Feb 2012 15:23
I'm almost at the stage now where I'm testing my code out with objects and a camera and collision. I'm hoping that bullet is mega fast for what I'm after and it can be integrated with my own objects I'm creating for openGL. I'm just going through some optimisations to speed up the generation algorithms (converting STL to ansi C is making at least a 600% improvement).

It is only the collision part of the library that I'll be using as the physics I can add in myself for the end results for gameplay.

I remember playing around not so long ago with the *sObject structure with GDK and failed miserably at the time. Now that I'm using openGL everything is my own structures so it should be fairly easy.

Unlike GDK, the only files I can load up at the moment (because I want a minimal file size build) is raw and .obj with .mtl files as well as textures in .png or .jpg, although I'm looking at the license restrictions on PNG and JPG file formats and may have to change the formats.

What I might do later today is download the Bullet library and see if I get the errors too. Fingers crossed.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Oster200
14
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 18th Feb 2012 17:02
Please do tell me if you get the error or not.
i followed the instructions but it dint work for me.
you can use bullet with c++ right? it sounds like only opengl for the errors im getting i jsut want to get a clarification on that hope you dont get the errors.

What does Star Trek and toilet paper have in common?

Dar13
17
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 18th Feb 2012 17:10
Quote: "you can use bullet with c++ right? it sounds like only opengl for the errors im getting i jsut want to get a clarification on that hope you dont get the errors."

You can only use Bullet with C++, doesn't work otherwise. You're getting an error on the examples, right? What happens when you try using OpenGL and Bullet in a standalone program?

Oster200
14
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 18th Feb 2012 20:26
Well i might have found it out...i have to research more on all the commands and everything but i dont get that error for demos anymore. i just clicked on BULLET-PHYSICS.sln and let it compile it got some errors but it wasn that one that i was talking about anymore so i can play the demos now. you just have to make sure if it dosent work just debug or release the BULLET-PHYSICS.sln and it should work.

i jusat dont know if it works completly yet because i ahvent tested it with somthing.

What does Star Trek and toilet paper have in common?

Dar13
17
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 18th Feb 2012 20:34
Quote: "BULLET-PHYSICS.sln and let it compile it"

You tried to use Bullet without compiling it? No wonder you were getting linker errors.

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 19th Feb 2012 16:28
I've got all the Bullet demos working apart from the ones that require glew32.dll and heavy expensive multi-threading processors.

@Oster200 - After downloading and extracting, I used the "CMake" utility to build the source for Visual Studio 2008. After that I opened the solution and waited ages for it to compile all the demos.

I've got a slow laptop but the demos work reasonably well on this thing so if it's only the collision system I need then that should be enough. Just working on that last 3rd part of my mesh generation then I'll be adding a test run with collision.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 20th Feb 2012 23:42 Edited at: 20th Feb 2012 23:43
[reads thread title in RSS {cannot see username} and thinks to self... thats WLGfx]

funny that

I may have a solution for you buddy where you might be able to take advantage of a 9800GT I believe it has 896MB memory and 112 cores...

just need to sort out the internet at my shop... its been acting up and I suspect a faulty router... [Im paying over £800 a year for my internet so im covered no matter what ^^]

and would like to take advantage of it to the maximum

EDIT

will also depend on your connection of course

... I heard Bullet physics is better than Havok but then Havok took the ball

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 21st Feb 2012 16:00
Integrating Bullet into my code is going to take another learning curve and I really hope that I can cut down on some of the heavy masses of calculations by just using the collision side of Bullet. Sparky's is perfect for this job with DBP and GDK.

I'm still at the point of struggling getting my wall mesh working properly before I can start to use the library. At this point I am hoping that speed doesn't cause an issue for me with my slow computer.

One day in the future I will have a nice fast computer to write games on.

Thanks MrValentine - 896Mb is all I have left after 128Mb is stolen for the graphics on this thing... lol

I am impressed with the speed of using raw openGL over DX9. It was a tough choice at the time whether to try DX or openGL and I don't regret it now.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Feb 2012 18:10
Ahh my bad... the gpu has just 512 but the system just 1.75GB...

Still trying to get BT by the marbles

will try to keep you posted...

Login to post a reply

Server time is: 2025-05-19 18:06:26
Your offset time is: 2025-05-19 18:06:26