Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How would I alter physical calculations to account for frame of reference of a physical body?

Currently I have a world that is a collection of rigid body objects that act on each other. There is no frame of reference for collision detection or resolution with respect to each body (i.e. body A has a velocity of zero when resolving a collision with body B and vice versa). The world is the reference frame, therefore everything is moving that has a non-zero velocity.

share|improve this question
2  
There is always a frame of reference, you have to be consciously aware of what frame you're working in and it appears that you're working in world space but have forgotten that. There is no need to go into local object space here, IIRC. –  Patrick Hughes Apr 21 '13 at 3:15
add comment

1 Answer

up vote 1 down vote accepted

If you need a calculation in object space for any reason, just multiply by the object's inverse transformation to find positions and orientations relative to that object. This makes the position and orientation of that reference object zero and identity. All object's positions and orientations will be relative to this reference object.

To calculate the relative velocities, just subtract the velocity of the reference object from the velocities of the other objects, to get their relative velocities, which again makes the velocity of your reference object zero, regardless of its world velocity.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.