MeshUtilities Class

Summary

Various utility methods for using the Weaver.MeshBuilder class.
Assembly
Weaver.dll
Namespace
Weaver
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["MeshUtilities"] class Type type-node

Syntax

public static class MeshUtilities

Methods

Name Value Summary
BuildRingXY(MeshBuilder, int, float, float) void
Adds indices, vertices, and normals to form a ring on the XY plane with the specified parameters.
static
CalculateNormals(MeshBuilder, int, int, int) void
Doesn't take into account vertices that are shared by multiple triangles. Only the last triangle to include each vertex will determine its normal.
static
DuplicateVertex(MeshBuilder, int, Vector3) void
Adds a new vertex with its position at `builder.Vertices[vertex]` and the specified `normal` value.
static
DuplicateVertex(MeshBuilder, int, Vector3, Vector2) void
Adds a new vertex with its position at `builder.Vertices[vertex]` and the specified `normal` and `uv` values.
static
DuplicateVertex(MeshBuilder, int, Vector3, Vector3, Vector2) void
Adds a new vertex with its position at 'builder.Vertices[vertex] + offset' and the specified `normal` and `uv` values.
static
ExtrudePolygon(MeshBuilder, int, int, int, Vector3) void
Duplicates the vertex data of a polygon with the vertices offset by `extrusion` and adds indices to join them as faces to the original vertices.
static
GetUVs(MeshBuilder, int) List<Vector4>
static
PlaceQuadUVs(List<Vector2>, Vector2, Vector2) void
Adds 4 UV values to planar map a quad.
static
PlaceQuadVertices(List<Vector3>, Vector3, Vector2) void
Adds 4 vertices to form a quad.
static
PlanarMapXY(MeshBuilder) void
Planar maps the UV values for all vertices using their XY positions.
static
PlanarMapXY(MeshBuilder, int, int, Rect, Rect) void
Planar maps the UV values for a range of vertices into the `uvArea` based on their XY positions relative to `vertexArea`.
static
RotateVertices(MeshBuilder, Quaternion) void
Multiplies all vertices and normaly by `rotation`.
static
ScaleVertices(MeshBuilder, float) void
Multiplies all vertices by `scale`.
static
SetCount<T>(List<T>, int) void
Adds members to the list (or removes them) until the count reaches the specified value.
static
ShapeEquilateralPolygonXY(MeshBuilder, int, Vector3, int, float) void
Adds indices, vertices, normals, and UVs for a polygon on the XY plane with the specified parameters.
static
ShapeEquilateralPolygonXY(MeshBuilder, int, Vector3, int, float, Rect) void
Adds indices, vertices, normals, and UVs for a polygon on the XY plane with the specified parameters.
static
TranslateVertices(MeshBuilder, Vector3) void
Adds the specified translation to all vertices up to the current vertex count.
static
TranslateVertices(MeshBuilder, Vector3, int) void
Adds the specified translation to all vertices from the specified start index up to the current vertex count.
static
TranslateVertices(MeshBuilder, Vector3, int, int) void
Adds the specified translation to all vertices in the specified range.
static
VectorXYFromAngle(float, float, float) Vector3
Generates a vector with the specified z value and length in the specified direction on the XY axis.
static