Description
The Position
property of a PhysicsBody
represents the position of the physics body in world coordinates. This property is of type Vector3
, which is a structure that holds three-dimensional vector data, typically used to represent positions or directions in 3D space.
Usage
You can use the Position
property to get or set the current position of a PhysicsBody
in the world. Modifying this property will directly affect the location of the physics body within the simulation.
Example
// Example of setting the position of a PhysicsBody
PhysicsBody myPhysicsBody = new PhysicsBody();
myPhysicsBody.Position = new Vector3(10.0f, 5.0f, 3.0f);
// Example of getting the position of a PhysicsBody
Vector3 currentPosition = myPhysicsBody.Position;
// Use currentPosition for further calculations or logic