Description
The Local
method of the PhysicsPoint
struct is used to create a physics point that is relative to a given physics body. This method allows you to specify a local position and rotation, which are optional, to define the point's offset from the body's origin. This is particularly useful for defining attachment points for joints or other physics interactions.
Usage
To use the Local
method, you need to provide a PhysicsBody
instance to which the point will be attached. Optionally, you can specify a local position and rotation using Vector3
and Rotation
respectively. If these are not provided, the point will default to the body's origin.
Example usage:
PhysicsBody myBody = new PhysicsBody();
Vector3? localPos = new Vector3(1.0f, 0.0f, 0.0f);
Rotation? localRot = Rotation.From(0, 90, 0);
PhysicsPoint point = PhysicsPoint.Local(myBody, localPos, localRot);
Example
PhysicsBody myBody = new PhysicsBody();
Vector3? localPos = new Vector3(1.0f, 0.0f, 0.0f);
Rotation? localRot = Rotation.From(0, 90, 0);
PhysicsPoint point = PhysicsPoint.Local(myBody, localPos, localRot);