Sign in to follow this  
Googol PL3X

Need help with Intergrating physics

Recommended Posts

Googol PL3X    100
I've been programming with DirectX, more specifiaclly Direct3D, and I want to start physics programming so I can make my apps more realistic. Problem is I don't know how to intergrate physics into it. Can someone help? Thanks Sean

Share this post


Link to post
Share on other sites
staticVoid2    381
A physics system would be totally separate from Direct3D, most probaly calculations would be done on the CPU while rendering would be done on the GPU. you could start off by reading articles on physics then creating a library of functions dedicated to it. I've not implemented any serious physics system into a game but have created a few functions that you just plug vectors into and get the result.

Share this post


Link to post
Share on other sites
Wan    1366
There's nothing special about integrating a physics engine. In fact, like staticVoid the second already said, the trick is not to integrate it too deeply but keeping it separate from other modules. Take a look at some tutorials and example code of commonly used physics libraries, it'll show you how the results of a physics simulation are visualized using a render system (OpenGL, Direct3D). Although they're often just examples and by no means a course on good software design, you'll realize that graphics reside in a totally different 'world' than the physics.

Share this post


Link to post
Share on other sites
jpventoso    178
I setup the nexus between the two engines (3D and physics) through interfaces.

All the renderable entities also implement an interface of an abstract entity of the physics engine, which has its own hierachy of objects. Thus, a mesh (suppose, a soccer ball), will implement the interfaces that define it as an object located in a world X (Earth in this case) and will be affected by it's gravity and atmosphere. It will also be movable, will have some friction, a certain elasticity, and so on.

Share this post


Link to post
Share on other sites
Googol PL3X    100
thanks everyone!! Does anyone know how I could implement Ageia PhysX into my Direct3D game engine? And are there tutorials for it. I still don't fully understand how its really done to be honest.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this