Class Primitives
Provides methods for rendering 3D "primitives".
public static class Primitives
- Inheritance
-
Primitives
- Inherited Members
Methods
RenderCapsule(MtCapsule, MtColor)
Renders a capsule at the given position with the given radius and color.
public static void RenderCapsule(MtCapsule capsule, MtColor color)
Parameters
RenderCapsule(MtCapsule, Vector4)
Renders a capsule at the given position with the given radius and color.
public static void RenderCapsule(MtCapsule capsule, Vector4 color)
Parameters
RenderLine(MtLineSegment, MtColor)
Renders a line with the given color.
public static void RenderLine(MtLineSegment line, MtColor color)
Parameters
lineMtLineSegmentThe line to render.
colorMtColorThe color of the line.
RenderLine(MtLineSegment, Vector4)
Renders a line with the given color.
public static void RenderLine(MtLineSegment line, Vector4 color)
Parameters
lineMtLineSegmentThe line to render.
colorVector4The color of the line.
RenderLine(Vector3, Vector3, MtColor)
Renders a line at the given start and end position with the given color.
public static void RenderLine(Vector3 start, Vector3 end, MtColor color)
Parameters
startVector3The start position of the line.
endVector3The end position of the line.
colorMtColorThe color of the line.
RenderLine(Vector3, Vector3, Vector4)
Renders a line at the given start and end position with the given color.
public static void RenderLine(Vector3 start, Vector3 end, Vector4 color)
Parameters
startVector3The start position of the line.
endVector3The end position of the line.
colorVector4The color of the line.
RenderMesh(MeshHandle, Matrix4x4, MtColor)
Renders a given mesh with the given transform and color.
public static void RenderMesh(MeshHandle mesh, Matrix4x4 transform, MtColor color)
Parameters
meshMeshHandleThe mesh to render. Must have been previously registered via SupplyCustomMesh(Span<Vector4>, Span<uint>).
transformMatrix4x4The transform of the mesh
colorMtColorThe color of the mesh
RenderMesh(MeshHandle, Matrix4x4, Vector4)
Renders a given mesh with the given transform and color.
public static void RenderMesh(MeshHandle mesh, Matrix4x4 transform, Vector4 color)
Parameters
meshMeshHandleThe mesh to render. Must have been previously registered via SupplyCustomMesh(Span<Vector4>, Span<uint>).
transformMatrix4x4The transform of the mesh
colorVector4The color of the mesh
RenderObb(MtObb, MtColor)
Renders an oriented bounding box at the given position with the given size and color.
public static void RenderObb(MtObb obb, MtColor color)
Parameters
obbMtObbThe oriented bounding box to render.
colorMtColorThe color of the oriented bounding box.
RenderObb(MtObb, Vector4)
Renders an oriented bounding box at the given position with the given size and color.
public static void RenderObb(MtObb obb, Vector4 color)
Parameters
obbMtObbThe oriented bounding box to render.
colorVector4The color of the oriented bounding box.
RenderSphere(MtSphere, MtColor)
Renders a sphere at the given position with the given radius and color.
public static void RenderSphere(MtSphere sphere, MtColor color)
Parameters
RenderSphere(MtSphere, Vector4)
Renders a sphere at the given position with the given radius and color.
public static void RenderSphere(MtSphere sphere, Vector4 color)
Parameters
RenderSphere(Vector3, float, MtColor)
Renders a sphere at the given position with the given radius and color.
public static void RenderSphere(Vector3 position, float radius, MtColor color)
Parameters
positionVector3The position of the sphere.
radiusfloatThe radius of the sphere.
colorMtColorThe color of the sphere.
RenderSphere(Vector3, float, Vector4)
Renders a sphere at the given position with the given radius and color.
public static void RenderSphere(Vector3 position, float radius, Vector4 color)
Parameters
positionVector3The position of the sphere.
radiusfloatThe radius of the sphere.
colorVector4The color of the sphere.
SupplyCustomMesh(Span<Vector4>, Span<uint>)
Registers a custom mesh to be used with RenderMesh(MeshHandle, Matrix4x4, MtColor).
public static MeshHandle SupplyCustomMesh(Span<Vector4> vertices, Span<uint> indices)
Parameters
verticesSpan<Vector4>The vertices of the mesh with each w component set to 1.
indicesSpan<uint>The indices of the mesh.
Returns
- MeshHandle
A handle to the registered mesh.
SupplyCustomMesh(string)
Loads and registers a mesh from a .obj file.
public static MeshHandle SupplyCustomMesh(string objPath)
Parameters
objPathstringThe path to the .obj file
Returns
- MeshHandle
A handle to the registered mesh, or Invalid if loading failed.