Esempio n. 1
0
        public LineJoint(LineJointDef def)
            : base(def)
        {
            _localAnchor1 = def.localAnchor1;
            _localAnchor2 = def.localAnchor2;
            _localXAxis1  = def.localAxis1;
            _localYAxis1  = _localXAxis1.CrossScalarPreMultiply(1.0f);

            _impulse      = Vector2.Zero;
            _motorMass    = 0.0f;
            _motorImpulse = 0.0f;

            _lowerTranslation = def.lowerTranslation;
            _upperTranslation = def.upperTranslation;
            _maxMotorForce    = Settings.FORCE_INV_SCALE(def.maxMotorForce);
            _motorSpeed       = def.motorSpeed;
            _enableLimit      = def.enableLimit;
            _enableMotor      = def.enableMotor;
            _limitState       = LimitState.InactiveLimit;

            _axis = Vector2.Zero;
            _perp = Vector2.Zero;
        }
Esempio n. 2
0
        public LineJoint(LineJointDef def)
            : base(def)
        {
            _localAnchor1 = def.localAnchor1;
            _localAnchor2 = def.localAnchor2;
            _localXAxis1  = def.localAxis1;
            _localYAxis1  = Vec2.Cross(1.0f, _localXAxis1);

            _impulse.SetZero();
            _motorMass    = 0.0f;
            _motorImpulse = 0.0f;

            _lowerTranslation = def.lowerTranslation;
            _upperTranslation = def.upperTranslation;
            _maxMotorForce    = Settings.FORCE_INV_SCALE(def.maxMotorForce);
            _motorSpeed       = def.motorSpeed;
            _enableLimit      = def.enableLimit;
            _enableMotor      = def.enableMotor;
            _limitState       = LimitState.InactiveLimit;

            _axis.SetZero();
            _perp.SetZero();
        }