當前位置: 首頁>>代碼示例>>C#>>正文


C# BulletSPlugin.BulletConstraint類代碼示例

本文整理匯總了C#中OpenSim.Region.Physics.BulletSPlugin.BulletConstraint的典型用法代碼示例。如果您正苦於以下問題:C# BulletConstraint類的具體用法?C# BulletConstraint怎麽用?C# BulletConstraint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BulletConstraint類屬於OpenSim.Region.Physics.BulletSPlugin命名空間,在下文中一共展示了BulletConstraint類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BSHingeConstraint

 public BSHingeConstraint(BulletSim world, BulletBody obj1, BulletBody obj2,
                 Vector3 pivotInA, Vector3 pivotInB,
                 Vector3 axisInA, Vector3 axisInB,
                 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies)
 {
     m_world = world;
     m_body1 = obj1;
     m_body2 = obj2;
     m_constraint = new BulletConstraint(
                         BulletSimAPI.CreateHingeConstraint2(m_world.ptr, m_body1.ptr, m_body2.ptr,
                             pivotInA, pivotInB,
                             axisInA, axisInB,
                             useLinearReferenceFrameA, disableCollisionsBetweenLinkedBodies));
     m_enabled = true;
 }
開發者ID:p07r0457,項目名稱:opensim,代碼行數:15,代碼來源:BSHingeConstraint.cs

示例2: BS6DofConstraint

 // Create a btGeneric6DofConstraint
 public BS6DofConstraint(BulletSim world, BulletBody obj1, BulletBody obj2,
                 Vector3 frame1, Quaternion frame1rot,
                 Vector3 frame2, Quaternion frame2rot,
                 bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies)
 {
     m_world = world;
     m_body1 = obj1;
     m_body2 = obj2;
     m_constraint = new BulletConstraint(
                         BulletSimAPI.Create6DofConstraint2(m_world.ptr, m_body1.ptr, m_body2.ptr,
                             frame1, frame1rot,
                             frame2, frame2rot,
                             useLinearReferenceFrameA, disableCollisionsBetweenLinkedBodies));
     m_enabled = true;
     world.physicsScene.DetailLog("{0},BS6DofConstraint,createFrame,wID={1}, rID={2}, rBody={3}, cID={4}, cBody={5}",
                         BSScene.DetailLogZero, world.worldID,
                         obj1.ID, obj1.ptr.ToString("X"), obj2.ID, obj2.ptr.ToString("X"));
 }
開發者ID:p07r0457,項目名稱:opensim,代碼行數:19,代碼來源:BS6DofConstraint.cs

示例3: TranslationalLimitMotor

 public abstract bool TranslationalLimitMotor(BulletConstraint constrain, float enable, float targetVel, float maxMotorForce);
開發者ID:KSLcom,項目名稱:Aurora-Sim,代碼行數:1,代碼來源:BSApiTemplate.cs

示例4: SetFrames

 public abstract bool SetFrames(BulletConstraint constrain,
     Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot);
開發者ID:KSLcom,項目名稱:Aurora-Sim,代碼行數:2,代碼來源:BSApiTemplate.cs

示例5: SetConstraintNumSolverIterations

 public abstract void SetConstraintNumSolverIterations(BulletConstraint constrain, float iterations);
開發者ID:KSLcom,項目名稱:Aurora-Sim,代碼行數:1,代碼來源:BSApiTemplate.cs

示例6: SetBreakingImpulseThreshold

 public abstract bool SetBreakingImpulseThreshold(BulletConstraint constrain, float threshold);
開發者ID:KSLcom,項目名稱:Aurora-Sim,代碼行數:1,代碼來源:BSApiTemplate.cs

示例7: RemoveConstraintRef

 public abstract void RemoveConstraintRef(BulletBody obj, BulletConstraint constrain);
開發者ID:KSLcom,項目名稱:Aurora-Sim,代碼行數:1,代碼來源:BSApiTemplate.cs

示例8: HasAnisotripicFriction

 public abstract bool HasAnisotripicFriction(BulletConstraint constrain);
開發者ID:KSLcom,項目名稱:Aurora-Sim,代碼行數:1,代碼來源:BSApiTemplate.cs

示例9: AddConstraintToWorld

        public override bool AddConstraintToWorld(BulletWorld pWorld, BulletConstraint pConstraint, bool pDisableCollisionsBetweenLinkedObjects)
        {
            DiscreteDynamicsWorld world = (pWorld as BulletWorldXNA).world;
            TypedConstraint constraint = (pConstraint as BulletConstraintXNA).constrain;
            world.AddConstraint(constraint, pDisableCollisionsBetweenLinkedObjects);

            return true;
        }
開發者ID:BogusCurry,項目名稱:WhiteCore-Dev,代碼行數:8,代碼來源:BSAPIXNA.cs

示例10: AddConstraintRef

 public override void AddConstraintRef(BulletBody pBody, BulletConstraint pConstraint)
 {
     RigidBody body = (pBody as BulletBodyXNA).rigidBody;
     TypedConstraint constrain = (pConstraint as BulletConstraintXNA).constrain;
     body.AddConstraintRef(constrain);
 }
開發者ID:BogusCurry,項目名稱:WhiteCore-Dev,代碼行數:6,代碼來源:BSAPIXNA.cs

示例11: UseFrameOffset

 public override bool UseFrameOffset(BulletConstraint pConstraint, float onOff)
 {
     Generic6DofConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as Generic6DofConstraint;
     constraint.SetUseFrameOffset((onOff == 0) ? false : true);
     return true;
 }
開發者ID:BogusCurry,項目名稱:WhiteCore-Dev,代碼行數:6,代碼來源:BSAPIXNA.cs

示例12: TranslationalLimitMotor

        public override bool TranslationalLimitMotor(BulletConstraint pConstraint, float ponOff, float targetVelocity, float maxMotorForce)
        {
            TypedConstraint tconstrain = (pConstraint as BulletConstraintXNA).constrain;
            bool onOff = ponOff != 0;
            bool ret = false;

            switch (tconstrain.GetConstraintType())
            {
            case TypedConstraintType.D6_CONSTRAINT_TYPE:
                Generic6DofConstraint constrain = tconstrain as Generic6DofConstraint;
                constrain.GetTranslationalLimitMotor().m_enableMotor[0] = onOff;
                constrain.GetTranslationalLimitMotor().m_targetVelocity[0] = targetVelocity;
                constrain.GetTranslationalLimitMotor().m_maxMotorForce[0] = maxMotorForce;
                ret = true;
                break;
            }

            return ret;
        }
開發者ID:BogusCurry,項目名稱:WhiteCore-Dev,代碼行數:19,代碼來源:BSAPIXNA.cs

示例13: SetLinearLimits

 public override bool SetLinearLimits(BulletConstraint pConstraint, Vector3 low, Vector3 high)
 {
     Generic6DofConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as Generic6DofConstraint;
     IndexedVector3 lowlimit = new IndexedVector3(low.X, low.Y, low.Z);
     IndexedVector3 highlimit = new IndexedVector3(high.X, high.Y, high.Z);
     constraint.SetLinearLowerLimit(lowlimit);
     constraint.SetLinearUpperLimit(highlimit);
     return true;
 }
開發者ID:BogusCurry,項目名稱:WhiteCore-Dev,代碼行數:9,代碼來源:BSAPIXNA.cs

示例14: SetFrames

        //SetFrames(m_constraint.ptr, frameA, frameArot, frameB, frameBrot);
        public override bool SetFrames(BulletConstraint pConstraint, Vector3 pframe1, Quaternion pframe1rot, Vector3 pframe2, Quaternion pframe2rot)
        {
            Generic6DofConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as Generic6DofConstraint;
            IndexedVector3 frame1v = new IndexedVector3(pframe1.X, pframe1.Y, pframe1.Z);
            IndexedQuaternion frame1rot = new IndexedQuaternion(pframe1rot.X, pframe1rot.Y, pframe1rot.Z, pframe1rot.W);
            IndexedMatrix frame1 = IndexedMatrix.CreateFromQuaternion(frame1rot);
            frame1._origin = frame1v;

            // 20131224 not used        IndexedVector3 frame2v = new IndexedVector3(pframe2.X, pframe2.Y, pframe2.Z);
            IndexedQuaternion frame2rot = new IndexedQuaternion(pframe2rot.X, pframe2rot.Y, pframe2rot.Z, pframe2rot.W);
            IndexedMatrix frame2 = IndexedMatrix.CreateFromQuaternion(frame2rot);
            frame2._origin = frame1v;
            constraint.SetFrames(ref frame1, ref frame2);
            return true;
        }
開發者ID:BogusCurry,項目名稱:WhiteCore-Dev,代碼行數:16,代碼來源:BSAPIXNA.cs

示例15: DumpConstraint

 public virtual void DumpConstraint(BulletWorld sim, BulletConstraint constrain)
 {
 }
開發者ID:KSLcom,項目名稱:Aurora-Sim,代碼行數:3,代碼來源:BSApiTemplate.cs


注:本文中的OpenSim.Region.Physics.BulletSPlugin.BulletConstraint類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。