Skip to content

Class ProceduralMeshes

Namespace: Apogee.Content
Assembly: Apogee.Content.dll

Simple shapes built in code: for sample scenes, tools and tests. Every mesh has normals, UVs and tangents, and counter-clockwise front faces.

public static class ProceduralMeshes

Inheritance

object ← ProceduralMeshes

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

Box(string, Vector3, int, float)

A box centered on the origin. uvScale repeats the texture along each face.

public static MeshData Box(string name, Vector3 size, int material, float uvScale = 1)

Parameters

name string

size Vector3

material int

uvScale float

Returns

MeshData

Cylinder(string, float, float, int, int)

An upright cylinder from y = 0 to height, smooth shaded around its side, with a cap on top and bottom.

public static MeshData Cylinder(string name, float radius, float height, int segments, int material)

Parameters

name string

radius float

height float

segments int

material int

Returns

MeshData

Plane(string, float, float, int, float)

A horizontal rectangle on y = 0 facing up, centered on the origin, with the texture repeating uvScale times per meter.

public static MeshData Plane(string name, float width, float depth, int material, float uvScale = 1)

Parameters

name string

width float

depth float

material int

uvScale float

Returns

MeshData

Sphere(string, float, int, int, int)

A UV sphere centered on the origin.

public static MeshData Sphere(string name, float radius, int segments, int rings, int material)

Parameters

name string

radius float

segments int

rings int

material int

Returns

MeshData