Page 1 of 1

A couple of questions

Posted: Sat Jul 08, 2006 9:02 am
by mirv
Just a few questions (as always!). I'm having trouble finding out how to have an object ignore gravity in a general gravity environment (e.g I wanted some balloons floating around, but boxes banging around on the ground) - can anyone point me to where that can be done? CcdConstructionInfo's m_gravity doesn't seem to do much.

Also having some troubles looking into having one object be affected by a collision, but not the other (e.g a spectator camera in the scene - I don't want it to go through stuff, but objects about the place shouldn't be affected by the camera). Again, can anyone give me pointers for this?

Thanks in advance (I'll keep looking into this myself - but it'd be quicker if someone could give me a pointer).

Posted: Sun Jul 09, 2006 1:30 pm
by Proctoid
you can set individual gravities for rigid body collision objects and so create any shape of game world - i have objects within a huge sphere that works great... the following code would give a balloon like gravity effect to a physics body in a normal flat 3d world where +y is up. (you will have to fiddle with the value depending on mass of objects etc to get the effects you are after)

SimdVector3 grav = SimdVector3( 0, 0.0001, 0 );
pCcdPhysicsController->GetRigidBody()->setGravity( grav );

Posted: Sun Jul 09, 2006 3:31 pm
by mirv
Ah, thanks Proctoid!
I'd actually been trying that and it wasn't working, but in a sudden flash of insight (which for whatever reason came after reading your post), I tried to set the body's gravity after I added it to the ccd environment and that worked.