Sign in to follow this  
voguemaster

In terms of design

Recommended Posts

voguemaster    183
It's interesting to me to learn and understand various approaches to system design when it comes to the physics engine. I'm contemplating a dilemma about physical properties of an object (stuff like position, orientation, linear and angular velocity, etc.) In the most simple case, you'll have a rigid body class (like Dave Eberly's) that contains all these parameters. However, in a typical engine environment, other modules in the engine might need many of the parameters. The position and velocities, to name a few. Now, if these variables are contained within your rigid body class you have to provide means for other modules to get their values from within the physics system. An alternative approach is, since the velocities and position are used by many possible components, they will be contained in the general scene graph, readily available to all. That causes a split between the physical parameters: you have position, orientation and velocities in the scene graph (your central point) and other internal properties of the rigid body in the rigid body class (like inertia and momentum). It's possible to go either way and to make them both abstract enough as not to hurt the design of the system. My question is, is it more logical to separate the members or to put them all in the rigid body class ? In this case, objects like waypoints etc. that does not participate in physical calculations need a different representation. What are more viable options ?

Share this post


Link to post
Share on other sites
mrbig    100
I know nothing about C++, but in my engine, I use a handful of structures to represent my objects.
The those structures can be accessed by any part of the engine.

Share this post


Link to post
Share on other sites
ToohrVyk    1595
I have a basic trajectory class that can be used by all other modules, including the physics module.

In practice, every object which has a physical existence owns a Hull which manages its trajectory. The Hull then belongs to the integrator, which changes the trajectory based on duration forces, and to the collision resolver, which changes the trajectory based on collisions with other objects. The trajectory in itself is still owned by the object, and can be used for other things (such as rendering a model or triggering non-physical game events).

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