The UpdateHull
method updates the hull of a PhysicsShape
with a new set of points, position, and rotation. This method is useful for dynamically changing the shape of a physics object in the game world.
The UpdateHull
method updates the hull of a PhysicsShape
with a new set of points, position, and rotation. This method is useful for dynamically changing the shape of a physics object in the game world.
To use the UpdateHull
method, you need to provide a Vector3
for the position, a Rotation
for the orientation, and a System.Span<Vector3>
containing the points that define the new hull shape. This method does not return a value.
// Example of using UpdateHull PhysicsShape shape = new PhysicsShape(); Vector3 newPosition = new Vector3(1.0f, 2.0f, 3.0f); Rotation newRotation = new Rotation(0.0f, 0.0f, 0.0f); Vector3[] newPoints = new Vector3[] { new Vector3(0.0f, 0.0f, 0.0f), new Vector3(1.0f, 0.0f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f) }; shape.UpdateHull(newPosition, newRotation, newPoints);