Inheritance: IDisposable
コード例 #1
0
 public btHingeConstraint(btRigidBody rbA, SWIGTYPE_p_btTransform rbAFrame, bool useReferenceFrameA) : this(BulletDynamicsPINVOKE.new_btHingeConstraint__SWIG_6(btRigidBody.getCPtr(rbA), SWIGTYPE_p_btTransform.getCPtr(rbAFrame), useReferenceFrameA), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #2
0
        public static btRigidBody upcast(SWIGTYPE_p_btCollisionObject colObj)
        {
            IntPtr      cPtr = BulletDynamicsPINVOKE.btRigidBody_upcast__SWIG_0(SWIGTYPE_p_btCollisionObject.getCPtr(colObj));
            btRigidBody ret  = (cPtr == IntPtr.Zero) ? null : new btRigidBody(cPtr, false);

            return(ret);
        }
コード例 #3
0
 public btPoint2PointConstraint(btRigidBody rbA, SWIGTYPE_p_btVector3 pivotInA) : this(BulletDynamicsPINVOKE.new_btPoint2PointConstraint__SWIG_1(btRigidBody.getCPtr(rbA), SWIGTYPE_p_btVector3.getCPtr(pivotInA)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public btGeneric6DofSpringConstraint(btRigidBody rbB, SWIGTYPE_p_btTransform frameInB, bool useLinearReferenceFrameB) : this(BulletDynamicsPINVOKE.new_btGeneric6DofSpringConstraint__SWIG_1(btRigidBody.getCPtr(rbB), SWIGTYPE_p_btTransform.getCPtr(frameInB), useLinearReferenceFrameB), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #5
0
 public btConeTwistConstraint(btRigidBody rbA, SWIGTYPE_p_btTransform rbAFrame) : this(BulletDynamicsPINVOKE.new_btConeTwistConstraint__SWIG_1(btRigidBody.getCPtr(rbA), SWIGTYPE_p_btTransform.getCPtr(rbAFrame)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #6
0
 public btGearConstraint(btRigidBody rbA, btRigidBody rbB, SWIGTYPE_p_btVector3 axisInA, SWIGTYPE_p_btVector3 axisInB) : this(BulletDynamicsPINVOKE.new_btGearConstraint__SWIG_1(btRigidBody.getCPtr(rbA), btRigidBody.getCPtr(rbB), SWIGTYPE_p_btVector3.getCPtr(axisInA), SWIGTYPE_p_btVector3.getCPtr(axisInB)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #7
0
 public btRaycastVehicle(SWIGTYPE_p_btRaycastVehicle__btVehicleTuning tuning, btRigidBody chassis, SWIGTYPE_p_btVehicleRaycaster raycaster) : this(BulletDynamicsPINVOKE.new_btRaycastVehicle(SWIGTYPE_p_btRaycastVehicle__btVehicleTuning.getCPtr(tuning), btRigidBody.getCPtr(chassis), SWIGTYPE_p_btVehicleRaycaster.getCPtr(raycaster)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #8
0
 public btUniversalConstraint(btRigidBody rbA, btRigidBody rbB, SWIGTYPE_p_btVector3 anchor, SWIGTYPE_p_btVector3 axis1, SWIGTYPE_p_btVector3 axis2) : this(BulletDynamicsPINVOKE.new_btUniversalConstraint(btRigidBody.getCPtr(rbA), btRigidBody.getCPtr(rbB), SWIGTYPE_p_btVector3.getCPtr(anchor), SWIGTYPE_p_btVector3.getCPtr(axis1), SWIGTYPE_p_btVector3.getCPtr(axis2)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #9
0
 public btHingeConstraint(btRigidBody rbA, SWIGTYPE_p_btVector3 pivotInA, SWIGTYPE_p_btVector3 axisInA, bool useReferenceFrameA) : this(BulletDynamicsPINVOKE.new_btHingeConstraint__SWIG_2(btRigidBody.getCPtr(rbA), SWIGTYPE_p_btVector3.getCPtr(pivotInA), SWIGTYPE_p_btVector3.getCPtr(axisInA), useReferenceFrameA), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #10
0
        public btRigidBody getRigidBody()
        {
            IntPtr      cPtr = BulletDynamicsPINVOKE.btRaycastVehicle_getRigidBody__SWIG_0(swigCPtr);
            btRigidBody ret  = (cPtr == IntPtr.Zero) ? null : new btRigidBody(cPtr, false);

            return(ret);
        }
コード例 #11
0
        public float solveLinearAxis(float timeStep, float jacDiagABInv, btRigidBody body1, SWIGTYPE_p_btVector3 pointInA, btRigidBody body2, SWIGTYPE_p_btVector3 pointInB, int limit_index, SWIGTYPE_p_btVector3 axis_normal_on_a, SWIGTYPE_p_btVector3 anchorPos)
        {
            float ret = BulletDynamicsPINVOKE.btTranslationalLimitMotor_solveLinearAxis(swigCPtr, timeStep, jacDiagABInv, btRigidBody.getCPtr(body1), SWIGTYPE_p_btVector3.getCPtr(pointInA), btRigidBody.getCPtr(body2), SWIGTYPE_p_btVector3.getCPtr(pointInB), limit_index, SWIGTYPE_p_btVector3.getCPtr(axis_normal_on_a), SWIGTYPE_p_btVector3.getCPtr(anchorPos));

            if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
            {
                throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
コード例 #12
0
    public bool OnBulletCreate()
    {
        if( rigidBodyObj != null ) // have created!
        {
            return true;
        }

        if( CollisionShapeObject == null )   // if user not give a collision, search it on itself first!
            CollisionShapeObject = GetComponent<BCollisionShape>();

        if( CollisionShapeObject == null )
        {
            Debug.LogError("Bullet RigidBody need a collision shape!");
            return false;
        }

        bool cResult = CollisionShapeObject.OnBulletCreate();

        if( cResult == false )
        {
            Debug.LogError("Collision Shape Create Error!");
            return false;
        }

        btTransform trans = new btTransform();
        trans.setIdentity();
        btVector3 pos = new btVector3(transform.position.x,transform.position.y,transform.position.z);
        trans.setOrigin(pos);
        trans.setRotation(new btQuaternion(transform.rotation.x,transform.rotation.y,transform.rotation.z,transform.rotation.w));

        //rigidbody is dynamic if and only if mass is non zero, otherwise static
        bool isDynamic = (Mass != 0.0f);

        btVector3 localInertia = new btVector3(0,0,0);
        if (isDynamic)
        {
             CollisionShapeObject.CalculateLocalInertia(Mass,localInertia);
        }

        //using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
        myMotionState = new btDefaultMotionState(trans);
        rbInfo = new btRigidBodyConstructionInfo(Mass,myMotionState.GetSwigPtr(),CollisionShapeObject.GetCollisionShapePtr(),localInertia.GetSwigPtr());
        rigidBodyObj = new btRigidBody(rbInfo);
        collisionObject = btCollisionObject.GetObjectFromSwigPtr(rigidBodyObj.GetCollisionObject());
        collisionObject.setFriction(Friction);
        return true;
    }
コード例 #13
0
 public btConeTwistConstraint(btRigidBody rbA, SWIGTYPE_p_btTransform rbAFrame)
     : this(BulletDynamicsPINVOKE.new_btConeTwistConstraint__SWIG_1(btRigidBody.getCPtr(rbA), SWIGTYPE_p_btTransform.getCPtr(rbAFrame)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #14
0
 public btRigidBody getRigidBodyA()
 {
     btRigidBody ret = new btRigidBody(BulletDynamicsPINVOKE.btConeTwistConstraint_getRigidBodyA(swigCPtr), false);
     return ret;
 }
コード例 #15
0
 public float solveLinearAxis(float timeStep, float jacDiagABInv, btRigidBody body1, SWIGTYPE_p_btVector3 pointInA, btRigidBody body2, SWIGTYPE_p_btVector3 pointInB, int limit_index, SWIGTYPE_p_btVector3 axis_normal_on_a, SWIGTYPE_p_btVector3 anchorPos)
 {
     float ret = BulletDynamicsPINVOKE.btTranslationalLimitMotor_solveLinearAxis(swigCPtr, timeStep, jacDiagABInv, btRigidBody.getCPtr(body1), SWIGTYPE_p_btVector3.getCPtr(pointInA), btRigidBody.getCPtr(body2), SWIGTYPE_p_btVector3.getCPtr(pointInB), limit_index, SWIGTYPE_p_btVector3.getCPtr(axis_normal_on_a), SWIGTYPE_p_btVector3.getCPtr(anchorPos));
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
コード例 #16
0
 public void synchronizeSingleMotionState(btRigidBody body) {
   BulletDynamicsPINVOKE.btDiscreteDynamicsWorld_synchronizeSingleMotionState(swigCPtr, btRigidBody.getCPtr(body));
 }
コード例 #17
0
 public virtual void removeRigidBody(btRigidBody body) {
   BulletDynamicsPINVOKE.btDiscreteDynamicsWorld_removeRigidBody(swigCPtr, btRigidBody.getCPtr(body));
 }
コード例 #18
0
 public btHingeConstraint(btRigidBody rbA, SWIGTYPE_p_btTransform rbAFrame, bool useReferenceFrameA)
     : this(BulletDynamicsPINVOKE.new_btHingeConstraint__SWIG_6(btRigidBody.getCPtr(rbA), SWIGTYPE_p_btTransform.getCPtr(rbAFrame), useReferenceFrameA), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #19
0
 public virtual void addRigidBody(btRigidBody body, short group, short mask)
 {
     BulletDynamicsPINVOKE.btSimpleDynamicsWorld_addRigidBody__SWIG_1(swigCPtr, btRigidBody.getCPtr(body), group, mask);
 }
コード例 #20
0
 public btRigidBody getRigidBodyB()
 {
     btRigidBody ret = new btRigidBody(BulletDynamicsPINVOKE.btSliderConstraint_getRigidBodyB(swigCPtr), false);
     return ret;
 }
コード例 #21
0
        public btRigidBody getRigidBodyB()
        {
            btRigidBody ret = new btRigidBody(BulletDynamicsPINVOKE.btConeTwistConstraint_getRigidBodyB(swigCPtr), false);

            return(ret);
        }
コード例 #22
0
 internal static HandleRef getCPtr(btRigidBody obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
コード例 #23
0
 public btRaycastVehicle(SWIGTYPE_p_btRaycastVehicle__btVehicleTuning tuning, btRigidBody chassis, SWIGTYPE_p_btVehicleRaycaster raycaster)
     : this(BulletDynamicsPINVOKE.new_btRaycastVehicle(SWIGTYPE_p_btRaycastVehicle__btVehicleTuning.getCPtr(tuning), btRigidBody.getCPtr(chassis), SWIGTYPE_p_btVehicleRaycaster.getCPtr(raycaster)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #24
0
 public btPoint2PointConstraint(btRigidBody rbA, SWIGTYPE_p_btVector3 pivotInA)
     : this(BulletDynamicsPINVOKE.new_btPoint2PointConstraint__SWIG_1(btRigidBody.getCPtr(rbA), SWIGTYPE_p_btVector3.getCPtr(pivotInA)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #25
0
        public float solveAngularLimits(float timeStep, SWIGTYPE_p_btVector3 axis, float jacDiagABInv, btRigidBody body0, btRigidBody body1)
        {
            float ret = BulletDynamicsPINVOKE.btRotationalLimitMotor_solveAngularLimits(swigCPtr, timeStep, SWIGTYPE_p_btVector3.getCPtr(axis), jacDiagABInv, btRigidBody.getCPtr(body0), btRigidBody.getCPtr(body1));

            if (BulletDynamicsPINVOKE.SWIGPendingException.Pending)
            {
                throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
コード例 #26
0
 public virtual void addRigidBody(btRigidBody body)
 {
     BulletDynamicsPINVOKE.btSimpleDynamicsWorld_addRigidBody__SWIG_0(swigCPtr, btRigidBody.getCPtr(body));
 }
コード例 #27
0
 public btRigidBody getRigidBodyB()
 {
     btRigidBody ret = new btRigidBody(BulletDynamicsPINVOKE.btHingeConstraint_getRigidBodyB__SWIG_0(swigCPtr), false);
     return ret;
 }
コード例 #28
0
 public virtual void removeRigidBody(btRigidBody body)
 {
     BulletDynamicsPINVOKE.btSimpleDynamicsWorld_removeRigidBody(swigCPtr, btRigidBody.getCPtr(body));
 }
コード例 #29
0
 public btHingeConstraint(btRigidBody rbA, SWIGTYPE_p_btVector3 pivotInA, SWIGTYPE_p_btVector3 axisInA, bool useReferenceFrameA)
     : this(BulletDynamicsPINVOKE.new_btHingeConstraint__SWIG_2(btRigidBody.getCPtr(rbA), SWIGTYPE_p_btVector3.getCPtr(pivotInA), SWIGTYPE_p_btVector3.getCPtr(axisInA), useReferenceFrameA), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #30
0
        public btRigidBody getRigidBodyA()
        {
            btRigidBody ret = new btRigidBody(BulletDynamicsPINVOKE.btSliderConstraint_getRigidBodyA(swigCPtr), false);

            return(ret);
        }
コード例 #31
0
 public btHinge2Constraint(btRigidBody rbA, btRigidBody rbB, SWIGTYPE_p_btVector3 anchor, SWIGTYPE_p_btVector3 axis1, SWIGTYPE_p_btVector3 axis2)
     : this(BulletDynamicsPINVOKE.new_btHinge2Constraint(btRigidBody.getCPtr(rbA), btRigidBody.getCPtr(rbB), SWIGTYPE_p_btVector3.getCPtr(anchor), SWIGTYPE_p_btVector3.getCPtr(axis1), SWIGTYPE_p_btVector3.getCPtr(axis2)), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #32
0
 public void synchronizeSingleMotionState(btRigidBody body)
 {
     BulletDynamicsPINVOKE.btDiscreteDynamicsWorld_synchronizeSingleMotionState(swigCPtr, btRigidBody.getCPtr(body));
 }
コード例 #33
0
 public btGearConstraint(btRigidBody rbA, btRigidBody rbB, SWIGTYPE_p_btVector3 axisInA, SWIGTYPE_p_btVector3 axisInB) : this(BulletDynamicsPINVOKE.new_btGearConstraint__SWIG_1(btRigidBody.getCPtr(rbA), btRigidBody.getCPtr(rbB), SWIGTYPE_p_btVector3.getCPtr(axisInA), SWIGTYPE_p_btVector3.getCPtr(axisInB)), true) {
   if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #34
0
 internal static HandleRef getCPtr(btRigidBody obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
コード例 #35
0
 public virtual void addRigidBody(btRigidBody body) {
   BulletDynamicsPINVOKE.btDiscreteDynamicsWorld_addRigidBody__SWIG_0(swigCPtr, btRigidBody.getCPtr(body));
 }
コード例 #36
0
 public float solveAngularLimits(float timeStep, SWIGTYPE_p_btVector3 axis, float jacDiagABInv, btRigidBody body0, btRigidBody body1)
 {
     float ret = BulletDynamicsPINVOKE.btRotationalLimitMotor_solveAngularLimits(swigCPtr, timeStep, SWIGTYPE_p_btVector3.getCPtr(axis), jacDiagABInv, btRigidBody.getCPtr(body0), btRigidBody.getCPtr(body1));
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
コード例 #37
0
 public virtual void addRigidBody(btRigidBody body, short group, short mask) {
   BulletDynamicsPINVOKE.btDiscreteDynamicsWorld_addRigidBody__SWIG_1(swigCPtr, btRigidBody.getCPtr(body), group, mask);
 }
コード例 #38
0
 public btGeneric6DofConstraint(btRigidBody rbB, SWIGTYPE_p_btTransform frameInB, bool useLinearReferenceFrameB)
     : this(BulletDynamicsPINVOKE.new_btGeneric6DofConstraint__SWIG_1(btRigidBody.getCPtr(rbB), SWIGTYPE_p_btTransform.getCPtr(frameInB), useLinearReferenceFrameB), true)
 {
     if (BulletDynamicsPINVOKE.SWIGPendingException.Pending) throw BulletDynamicsPINVOKE.SWIGPendingException.Retrieve();
 }
コード例 #39
0
        public btRigidBody getRigidBodyB()
        {
            btRigidBody ret = new btRigidBody(BulletDynamicsPINVOKE.btHingeConstraint_getRigidBodyB__SWIG_0(swigCPtr), false);

            return(ret);
        }