Esempio n. 1
0
        // Limit:
        // C = norm(pB - pA) - L
        // u = (pB - pA) / norm(pB - pA)
        // Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA))
        // J = [-u -cross(rA, u) u cross(rB, u)]
        // K = J * invM * JT
        //   = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2
        internal RopeJoint(RopeJointDef def) : base(def)
        {
            m_localAnchorA = def.localAnchorA;
            m_localAnchorB = def.localAnchorB;

            m_maxLength = def.maxLength;

            m_mass    = 0.0f;
            m_impulse = 0.0f;
            m_state   = LimitState.e_inactiveLimit;
            m_length  = 0.0f;
        }
Esempio n. 2
0
		// Limit:
		// C = norm(pB - pA) - L
		// u = (pB - pA) / norm(pB - pA)
		// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA))
		// J = [-u -cross(rA, u) u cross(rB, u)]
		// K = J * invM * JT
		//   = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2
		internal RopeJoint(RopeJointDef def): base(def)
		{
			m_localAnchorA = def.localAnchorA;
			m_localAnchorB = def.localAnchorB;

			m_maxLength = def.maxLength;

			m_mass = 0.0f;
			m_impulse = 0.0f;
			m_state = LimitState.e_inactiveLimit;
			m_length = 0.0f;
		}