Help for interaction

ricardo_arango

05-02-2006 16:50:44

I need to have items that can be picked up, an then thrown, so my guess for doing that is:

- Create the ogrenewt object with infinite mass.
- When the item is picked up, manually move it using an animation.
- When it is thrown, change it's mass to something different.
- When it stops, change it's mass again to infinite.

So:

1. Is this the correct way of doing it?
2. How is the mass set to inifite?
3. How to tell if an object has stopped?
4. If I define a radius, in which the object is pickable, can I use OgreNewt to see if my character is within that radius, or should I just do it by hand measuring the distance?

walaber

05-02-2006 18:30:41

i'm not sure why you would want to use such a convoluted solution... why not make all moveable objects dynamic from the start, instead of switching the mass around, etc?

as for picking up and throwing, the easiest thing to do is use forces and torques to hold the object where you want it (likely in front of the camera). using proper forces and torques means that the held object won't pass through other objects (because you are moving it arbitrarily).