public Vertex3D[] Build(Vector3 position, float width, float height, float depth, float ClockwiseRotationDegreesAroundY, RectangularCuboidMeshTexCoords?texCoords = null) { if (width <= 0.0f) { width = 1.0f; } if (height <= 0.0f) { height = 1.0f; } if (depth <= 0.0f) { depth = 1.0f; } var tex = texCoords == null?RectangularCuboidMeshTexCoords.StandardCuboidTexCoords() : texCoords.Value; var rads = ClockwiseRotationDegreesAroundY * (float)Math.PI / 180.0f; var twoPi = (float)Math.PI * 2.0f; //Don't really need to clamp to range here but why not.. while (rads >= twoPi) { rads -= twoPi; } while (rads < 0.0f) { rads += twoPi; } return(GenerateMesh(ref position, ref width, ref height, ref depth, ref rads, ref tex)); }