internal static HandleRef getCPtr(btDbvtBroadphase obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
 internal static HandleRef getCPtr(btDbvtBroadphase obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Пример #3
0
    void CreateDiscreteDynamicsWorld()
    {
        btVector3 gravityVec = new btVector3(Gravity.x, Gravity.y, Gravity.z);
        ///collision configuration contains default setup for memory, collision setup. Advanced users can create their own configuration.
        collisionConfiguration = new btDefaultCollisionConfiguration();

        ///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
        dispatcher = new btCollisionDispatcher(collisionConfiguration.GetSwigPtr());

        ///btDbvtBroadphase is a good general purpose broadphase. You can also try out btAxis3Sweep.
        overlappingPairCache = new btDbvtBroadphase();

        ///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
        solver = new btSequentialImpulseConstraintSolver();

        dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher.GetSwigPtr(), overlappingPairCache.GetSwigPtr(), solver.GetSwigPtr(), collisionConfiguration.GetSwigPtr());

        SWIGTYPE_p_btCollisionWorld collisionWorldPtr = dynamicsWorld.getCollisionWorld();
        collisionWorld = btCollisionWorld.GetObjectFromSwigPtr(collisionWorldPtr);

        dynamicsWorld.setGravity(gravityVec.GetSwigPtr());

        AddBulletObjects();
    }