Description
The PositionLocal
property of the MeshVertex
struct represents the local position of a vertex within its mesh. This property is of type Vector3
, which means it holds three-dimensional coordinates (x, y, z) relative to the mesh's local space.
This property is marked with the Sandbox.HideAttribute
and System.Text.Json.Serialization.JsonIgnoreAttribute
, indicating that it is hidden from certain UI elements and ignored during JSON serialization, respectively.
Usage
Use the PositionLocal
property to get or set the local position of a vertex within its mesh. This is useful when you need to manipulate the vertex's position relative to the mesh's origin, such as when performing transformations or calculations that are specific to the mesh's local coordinate system.
Note that changes to PositionLocal
will not automatically update the world position of the vertex. To reflect changes in the world space, you may need to update the PositionWorld
property or apply transformations using the mesh's transform matrix.
Example
// Example of accessing and modifying the PositionLocal property
MeshVertex vertex = new MeshVertex();
// Get the local position of the vertex
Vector3 localPosition = vertex.PositionLocal;
// Set a new local position for the vertex
vertex.PositionLocal = new Vector3(1.0f, 2.0f, 3.0f);
// Note: Ensure that any changes to PositionLocal are consistent with the mesh's transform.