A simple question but can't find any info about it.
What does SetLinearVelocity represent in speed and time? Meters per second? Meters per simulation tick?
I'm developing a kinematic controller which is a fast moving tank that fires projectiles. Here's the code that fires the projectile.
Code: Select all
Vector Bspeed;
// Get direction normal of turrent for shooting cannon ball
Bspeed.x=(ViewAhead.x-CamPosition.x);
Bspeed.y=(ViewAhead.y-CamPosition.y);
Bspeed.z=(ViewAhead.z-CamPosition.z);
// Offset starting point of cannon ball so it doesn't start inside of tank
btRigidBody* sphere=addSphere(5.0,CamPosition.x+Bspeed.x*21,CamPosition.y+Bspeed.y*21,
CamPosition.z+Bspeed.z*21,5.0);
sphere->setLinearVelocity(btVector3(Bspeed.x*100+Velocity.x,Bspeed.y*100+Velocity.y,Bspeed.z*100+Velocity.z));
sphere->setCollisionFlags(sphere->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
The tank is moving faster than the projectiles!