Description
The LocalPoint
method of the PhysicsBody
class is used to convert a point from world coordinates to local coordinates relative to the physics body. This method takes a Vector3
parameter representing the point in world space and returns a PhysicsPoint
object that represents the same point in the local space of the physics body.
Usage
To use the LocalPoint
method, you need to have an instance of PhysicsBody
. Call the method with a Vector3
representing the world position you want to convert to local coordinates.
Example
// Assume 'physicsBody' is an instance of PhysicsBody
Vector3 worldPosition = new Vector3(10, 5, 3);
PhysicsPoint localPoint = physicsBody.LocalPoint(worldPosition);
// 'localPoint' now contains the local coordinates of the point relative to 'physicsBody'.