private void FixedUpdate()
    {
        float posX = 0.0f;
        float posY = 0.0f;
        float posZ = 0.0f;

        float xx = 0.0f;
        float xy = 0.0f;
        float xz = 0.0f;
        float yx = 0.0f;
        float yy = 0.0f;
        float yz = 0.0f;
        float zx = 0.0f;
        float zy = 0.0f;
        float zz = 0.0f;

        BulletPhysicsDLLAccessors.bulletGetPositionAndBasis(m_RigidBodyIntPtr,
                                                            out posX, out posY, out posZ,
                                                            out xx, out xy, out xz,
                                                            out yx, out yy, out yz,
                                                            out zx, out zy, out zz);

        CreateMatrix(posX, posY, posZ,
                     xx, xy, xz,
                     yx, yy, yz,
                     zx, zy, zz);
    }
    private void Start()
    {
        if (GetComponent <BulletObjectShape>())
        {
            m_ObjectShapeIntPtr = GetComponent <BulletObjectShape>().CreateShape();

            m_RigidBodyIntPtr = BulletPhysicsDLLAccessors.bulletCreateRigidBody(
                transform.position.x, transform.position.y, transform.position.z,
                transform.right.x, transform.up.x, transform.forward.x,
                transform.right.y, transform.up.y, transform.forward.y,
                transform.right.z, transform.up.z, transform.forward.z,
                m_Mass, m_ObjectShapeIntPtr);
        }
        else
        {
            Debug.LogError("No BulletObjectShape found! Disabling BulletPhysicsRigidBody!");
            enabled = false;
            return;
        }
    }
 public override IntPtr CreateShape()
 {
     m_ObjectShapeIntPtr = BulletPhysicsDLLAccessors.bulletCreateBoxShape(m_BoxDimensions.x, m_BoxDimensions.y, m_BoxDimensions.z);
     return(m_ObjectShapeIntPtr);
 }
 private void FixedUpdate()
 {
     BulletPhysicsDLLAccessors.bulletStepSimulate(Time.deltaTime);
 }
 void OnApplicationQuit()
 {
     BulletPhysicsDLLAccessors.bulletClean();
 }
 private void Start()
 {
     BulletPhysicsDLLAccessors.bulletInitDefault();
 }
 public override IntPtr CreateShape()
 {
     m_ObjectShapeIntPtr = BulletPhysicsDLLAccessors.bulletCreateSphereShape(m_SphereRadius);
     return(m_ObjectShapeIntPtr);
 }