static void GetTextureExtents( Vector4 vAxisU, Vector4 vAxisV, Vector2 vScale, Sandbox.PolygonMesh/FaceExtents extents, Vector2& topLeft, Vector2& bottomRight )

book_4_sparkGenerated
code_blocksInput

Description

The GetTextureExtents method calculates the texture extents for a given face in a polygon mesh. It uses the provided U and V axis vectors, scale, and face extents to determine the top-left and bottom-right coordinates of the texture mapping.

Usage

To use the GetTextureExtents method, provide the U and V axis vectors, scale, and face extents as input parameters. The method will output the top-left and bottom-right coordinates of the texture mapping.

Example

Vector4 uAxis = new Vector4(1, 0, 0, 0);
Vector4 vAxis = new Vector4(0, 1, 0, 0);
Vector2 scale = new Vector2(1, 1);
PolygonMesh.FaceExtents extents = new PolygonMesh.FaceExtents();
Vector2 topLeft, bottomRight;

PolygonMesh.GetTextureExtents(uAxis, vAxis, scale, extents, out topLeft, out bottomRight);

// topLeft and bottomRight now contain the calculated texture extents.