why ?

thanks~~
Code: Select all
new btBoxShape( btVector3( 2.5, 2.5, 2.5 ) )
Code: Select all
int ModuleBullet::init(void)
{
btCollisionDispatcher* dispatcher= new btCollisionDispatcher();
btVector3 worldAabbMin( _worldSize[0][0], _worldSize[0][1], _worldSize[0][2] );
btVector3 worldAabbMax( _worldSize[1][0], _worldSize[1][1], _worldSize[1][2] );
btOverlappingPairCache* broadphase= new btAxisSweep3( worldAabbMin, worldAabbMax, _maxProxies );
btSequentialImpulseConstraintSolver* solver= new btSequentialImpulseConstraintSolver();
_world= new btDiscreteDynamicsWorld( dispatcher, broadphase, solver );
_world->setGravity( btVector3( 0, -9.8, 0 ) );
_timer.getTimeNow( _last_step );
return 0;
}
Code: Select all
SceneObject::SceneObject( btScalar __mass, btCollisionShape* __shape, const btTransform& __startTrans, const btTransform& __centerOfMassOffset, btScalar __friction, btScalar __restitution, btScalar __linearDamping, btScalar __angularDamping, bool __addToWorld )
: btDefaultMotionState( __startTrans, __centerOfMassOffset )
{
_body= NULL;
_inWorld= false;
btVector3 localInertia( 0, 0, 0 );
if( __mass != 0.0 ){
__shape->calculateLocalInertia( __mass, localInertia );
}
_body= new btRigidBody( __mass, this, __shape, localInertia, __linearDamping, __angularDamping, __friction, __restitution );
if( __addToWorld ){
_bullet->getWorld().addRigidBody( _body );
}
}
Code: Select all
void RenderableSceneObject::setWorldTransform( const btTransform& __centerOfMassWorldTrans )
{
btDefaultMotionState::setWorldTransform( __centerOfMassWorldTrans );
const btVector3& p= m_graphicsWorldTrans.getOrigin();
_node->setPosition( p.x(), p.y(), p.z() );
btQuaternion& q= m_graphicsWorldTrans.getRotation();
//q.normalize();
_node->rotate( Ogre::Quaternion( q.w(), q.x(), q.y(), q.z() ), Node::TS_WORLD );
}