Description | Hierarchy | Fields | Methods | Properties |
type TMeshBuffer = class(TReferenceCounted)
Struct for holding a mesh with a single material.
A part of a TMesh which has the same material on each face of that group. Logical groups of an TMesh need not be put into separate mesh buffers, but can be. Separately animated parts of the mesh must be put into separate mesh buffers. Some mesh buffer implementations have limitations on the number of vertices the buffer can hold. In that case, logical grouping can help. Moreover, the number of vertices should be optimized for the GPU upload, which often depends on the type of gfx card. Typial figures are 1000-10000 vertices per buffer.
Since meshbuffers are used for drawing, and hence will be exposed to the driver, chances are high that they are Grab()'ed from somewhere. It's therefore required to dynamically allocate meshbuffers which are passed to a video driver and only drop the buffer once it's not used in the current code block anymore.
![]() |
procedure Append(Vertices: Pointer; NumVertices: LongWord; Indices: PWord; NumIndices: LongWord); overload; inline; |
![]() |
procedure Append(Other: TMeshBuffer); overload; inline; |
![]() |
procedure RecalculateBoundingBox; inline; |
![]() |
procedure SetDirty(Buffer: TBufferType); inline; |
![]() |
procedure SetHardwareMappingHint(Hint: THardwareMappingHint; Buffer: TBufferType); inline; |
![]() |
property BoundingBox: TBoundingBox read GetBoundingBox write SetBoundingBox; |
![]() |
property IndexChangeID: LongWord read GetIndexChangeID; |
![]() |
property IndexCount: LongWord read GetIndexCount; |
![]() |
property IndexHardwareMappingHint: THardwareMappingHint
read GetIndexHardwareMappingHint; |
![]() |
property IndexType: TIndexType read GetIndexType; |
![]() |
property Indices: PWord read GetIndices; |
![]() |
property Material: PMaterial read GetMaterial; |
![]() |
property Normals[Index: LongWord]: TVector3D read GetNormal write SetNormal; |
![]() |
property Positions[Index: LongWord]: TVector3D read GetPosition write SetPosition; |
![]() |
property TCoords[Index: LongWord]: TVector2D read GetTCoords write SetTCoords; |
![]() |
property VertexChangeID: LongWord read GetVertexChangeID; |
![]() |
property VertexCount: LongWord read GetVertexCount; |
![]() |
property VertexHardwareMappingHint: THardwareMappingHint
read GetVertexHardwareMappingHint; |
![]() |
property VertexType: TVertexType read GetVertexType; |
![]() |
property Vertices: Pointer read GetVertices; |
![]() |
procedure Append(Vertices: Pointer; NumVertices: LongWord; Indices: PWord; NumIndices: LongWord); overload; inline; |
Parameters |
![]() |
procedure Append(Other: TMeshBuffer); overload; inline; |
Append the meshbuffer to the current buffer. Parameters
|
![]() |
procedure RecalculateBoundingBox; inline; |
Recalculates the bounding box. Should be called if the mesh changed. |
![]() |
procedure SetDirty(Buffer: TBufferType); inline; |
Flags the meshbuffer as changed, reloads hardware buffers. |
![]() |
procedure SetHardwareMappingHint(Hint: THardwareMappingHint; Buffer: TBufferType); inline; |
Sets the hardware mapping hint for the video driver. |
![]() |
property BoundingBox: TBoundingBox read GetBoundingBox write SetBoundingBox; |
The axis aligned bounding box of this meshbuffer. |
![]() |
property IndexChangeID: LongWord read GetIndexChangeID; |
Get the currently used ID for identification of changes. |
![]() |
property IndexCount: LongWord read GetIndexCount; |
The number of indices in the buffer. |
![]() |
property IndexHardwareMappingHint: THardwareMappingHint
read GetIndexHardwareMappingHint; |
The current hardware mapping hint. |
![]() |
property IndexType: TIndexType read GetIndexType; |
The type of index data. |
![]() |
property Indices: PWord read GetIndices; |
Provides a pointer to the index data. |
![]() |
property Material: PMaterial read GetMaterial; |
The mesh buffer's |
![]() |
property Normals[Index: LongWord]: TVector3D read GetNormal write SetNormal; |
Provides access to the normal vector of each vertex. |
![]() |
property Positions[Index: LongWord]: TVector3D read GetPosition write SetPosition; |
Provides access to the position of each vertex. |
![]() |
property TCoords[Index: LongWord]: TVector2D read GetTCoords write SetTCoords; |
Provides access to the texture coordinates of each vertex. |
![]() |
property VertexChangeID: LongWord read GetVertexChangeID; |
Get the currently used ID for identification of changes. |
![]() |
property VertexCount: LongWord read GetVertexCount; |
The number of vertices in the buffer. |
![]() |
property VertexHardwareMappingHint: THardwareMappingHint
read GetVertexHardwareMappingHint; |
The current hardware mapping hint. |
![]() |
property VertexType: TVertexType read GetVertexType; |
The type of vertex stored in this buffer. |
![]() |
property Vertices: Pointer read GetVertices; |
Provides a pointer to the vertex data. |