FarseerPhysics.Dynamics.Body.getLocalPoint C# (CSharp) Method

getLocalPoint() public method

Gets a local point relative to the body's origin given a world point. Note that the vector only takes the rotation into account, not the position.
public getLocalPoint ( Vector2 &worldPoint ) : Vector2
worldPoint Vector2 A point in world coordinates.
return Vector2
		public Vector2 getLocalPoint( ref Vector2 worldPoint )
		{
			return MathUtils.mulT( ref _xf, worldPoint );
		}

Usage Example

Example #1
0
		public static RevoluteJoint CreateRevoluteJoint( World world, Body bodyA, Body bodyB, Vector2 anchor )
		{
			var localanchorA = bodyA.getLocalPoint( bodyB.getWorldPoint( anchor ) );
			var joint = new RevoluteJoint( bodyA, bodyB, localanchorA, anchor );
			world.addJoint( joint );
			return joint;
		}