Project290.Physics.Dynamics.Body.GetLocalVector C# (CSharp) Method

GetLocalVector() public method

Gets a local vector given a world vector. Note that the vector only takes the rotation into account, not the position.
public GetLocalVector ( Vector2 &worldVector ) : Vector2
worldVector Vector2 A vector in world coordinates.
return Vector2
        public Vector2 GetLocalVector(ref Vector2 worldVector)
        {
            return new Vector2(worldVector.X*Xf.R.Col1.X + worldVector.Y*Xf.R.Col1.Y,
                               worldVector.X*Xf.R.Col2.X + worldVector.Y*Xf.R.Col2.Y);
        }