Esempio n. 1
0
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
PhysicsZone::pCollisionShape_type
PhysicsZone::createNullShape()
{
    CollisionShape* pRawPointer = new CollisionShape();
    pCollisionShape_type pShape(pRawPointer, boost::bind(&PhysicsZone::destroyCollisionShape, this, _1));

    //bit of a hacktastic workaround, but see http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=4461&hilit=btRigidBody+vs+btCollisionObject for intent
    pRawPointer->setShapePtr(new btSphereShape(btScalar(1.)));
    pRawPointer->setIsNUllShape(true);
    // TODO - set offsetMatrix (currently passing NULL, which centers the body at its origin)
    return pShape;
}