Box2DX.Dynamics.Jacobian.Compute C# (CSharp) Метод

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

public Compute ( System.Vector2 x1, float a1, System.Vector2 x2, float a2 ) : float
x1 System.Vector2
a1 float
x2 System.Vector2
a2 float
Результат float
		public float Compute(Vector2 x1, float a1, Vector2 x2, float a2)
		{
			return Vector2.Dot(Linear1, x1) + Angular1 * a1 + Vector2.Dot(Linear2, x2) + Angular2 * a2;
		}
	}

Usage Example

Пример #1
0
        internal override void SolveVelocityConstraints(TimeStep step)
        {
            Body b1 = _body1;
            Body b2 = _body2;

            float Cdot = _J.Compute(b1._linearVelocity, b1._angularVelocity, b2._linearVelocity, b2._angularVelocity);

            float impulse = _mass * (-Cdot);

            _impulse += impulse;

            b1._linearVelocity  += b1._invMass * impulse * _J.Linear1;
            b1._angularVelocity += b1._invI * impulse * _J.Angular1;
            b2._linearVelocity  += b2._invMass * impulse * _J.Linear2;
            b2._angularVelocity += b2._invI * impulse * _J.Angular2;
        }
All Usage Examples Of Box2DX.Dynamics.Jacobian::Compute