Nebula
Loading...
Searching...
No Matches
primitivegroup.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
14#include "math/bbox.h"
15
16//------------------------------------------------------------------------------
17namespace CoreGraphics
18{
50
51//------------------------------------------------------------------------------
54inline
56 baseVertex(0),
57 numVertices(0),
58 baseIndex(0),
59 numIndices(0)
60{
61 // empty
62}
63
64//------------------------------------------------------------------------------
67inline void
72
73//------------------------------------------------------------------------------
76inline IndexT
78{
79 return this->baseVertex;
80}
81
82//------------------------------------------------------------------------------
85inline void
90
91//------------------------------------------------------------------------------
94inline SizeT
96{
97 return this->numVertices;
98}
99
100//------------------------------------------------------------------------------
103inline void
108
109//------------------------------------------------------------------------------
112inline IndexT
114{
115 return this->baseIndex;
116}
117
118//------------------------------------------------------------------------------
121inline void
126
127//------------------------------------------------------------------------------
130inline SizeT
132{
133 return this->numIndices;
134}
135
136//------------------------------------------------------------------------------
139inline SizeT
141{
142 if (this->numIndices > 0)
143 {
145 }
146 else
147 {
149 }
150}
151
152} // namespace PrimitiveGroup
153//------------------------------------------------------------------------------
154
Defines a group of primitives as a subset of a vertex buffer and index buffer plus the primitive topo...
Definition primitivegroup.h:20
SizeT GetNumPrimitives(const CoreGraphics::PrimitiveTopology::Code &topo) const
get computed number of primitives
Definition primitivegroup.h:140
SizeT GetNumIndices() const
get number of indices
Definition primitivegroup.h:131
IndexT GetBaseIndex() const
get base index index
Definition primitivegroup.h:113
IndexT baseIndex
Definition primitivegroup.h:47
SizeT numVertices
Definition primitivegroup.h:46
IndexT baseVertex
Definition primitivegroup.h:45
PrimitiveGroup()
constructor
Definition primitivegroup.h:55
SizeT numIndices
Definition primitivegroup.h:48
SizeT GetNumVertices() const
get number of vertices
Definition primitivegroup.h:95
void SetNumVertices(SizeT n)
set number of vertices
Definition primitivegroup.h:86
void SetBaseVertex(IndexT i)
set base vertex index
Definition primitivegroup.h:68
void SetBaseIndex(IndexT i)
set base index index
Definition primitivegroup.h:104
void SetNumIndices(SizeT n)
set number of indices
Definition primitivegroup.h:122
IndexT GetBaseVertex() const
get index of base vertex
Definition primitivegroup.h:77
Code
enumeration
Definition primitivetopology.h:23
static SizeT NumberOfPrimitives(Code topology, SizeT numVertices)
compute number of primitives given a primitive type and number of vertices/indices
Definition primitivetopology.cc:86
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48