Vector3 LocalPosition

book_4_sparkGenerated
code_blocksInput

Description

The LocalPosition field represents the position offset from the physics body's position. It is a Vector3 value that specifies the local position of the PhysicsPoint relative to the attached PhysicsBody. This field is useful when you need to define a specific point on a physics body, such as when creating joints or other physics interactions that require precise positioning.

Usage

To use the LocalPosition field, you can directly access it from an instance of PhysicsPoint. This field is public and non-static, meaning it is specific to each instance of PhysicsPoint. You can read or modify this field to adjust the local position offset of the point relative to its associated physics body.

Example

// Example of setting the LocalPosition of a PhysicsPoint
PhysicsBody myBody = new PhysicsBody();
PhysicsPoint myPoint = new PhysicsPoint();

// Set the local position offset
myPoint.LocalPosition = new Vector3(1.0f, 0.0f, 0.0f);

// Now myPoint is offset by (1, 0, 0) from myBody's position