Header menu logo Mibo

PrimitiveMesh Type

Effectless procedural geometry — the MonoGame analog of raylib's universal Mesh. Wraps a VertexBuffer + IndexBuffer plus a primitive count.

Per §4.1 of the monogame3d plan, PrimitiveMesh is the unit that Material3D (the PBR-param carrier) is allowed to pair with — unlike ModelMeshPart, it owns no Effect, so there is no material conflation. The pipeline (ForwardPipeline) binds the active camera matrices and lighting onto a BasicEffect (B5/B6) or the custom PBR Effect (B9) when drawing.

Record fields

Record Field Description

Bounds

Full Usage: Bounds

Field type: BoundingSphere

Local-space bounding sphere (unit primitives centered on origin). Used by the shadow pass to frustum-cull caster meshes per light (B11). Transform by the draw's world matrix to get the world-space sphere.

Field type: BoundingSphere

Indices

Full Usage: Indices

Field type: IndexBuffer

Index buffer (16-bit, IndexElementSize.SixteenBits).

Field type: IndexBuffer

PrimitiveCount

Full Usage: PrimitiveCount

Field type: int

Number of triangles (primitive count for DrawIndexedPrimitives).

Field type: int

Vertices

Full Usage: Vertices

Field type: VertexBuffer

Vertex buffer holding VertexPositionNormalTexture vertices.

Field type: VertexBuffer

Instance members

Instance member Description

this.Dispose

Full Usage: this.Dispose

Releases the underlying GPU buffers. Idempotent.

this.Draw

Full Usage: this.Draw

Parameters:

Draws this primitive with a configured effect. Binds the vertex/index buffers, applies each pass of the effect's current technique, and issues a single DrawIndexedPrimitives per pass. The caller is responsible for setting World/View/Projection (and lighting) on the effect first.

gd : GraphicsDevice
effect : Effect

Type something to start searching.