Universe.Physics.BulletSPlugin.BSAPIXNA.TranslationalLimitMotor C# (CSharp) Метод

TranslationalLimitMotor() публичный Метод

public TranslationalLimitMotor ( BulletConstraint pConstraint, float ponOff, float targetVelocity, float maxMotorForce ) : bool
pConstraint BulletConstraint
ponOff float
targetVelocity float
maxMotorForce float
Результат bool
        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;
        }
BSAPIXNA