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{
55
56//------------------------------------------------------------------------------
59inline
61 baseVertex(0),
62 numVertices(0),
63 baseIndex(0),
64 numIndices(0)
65{
66 // empty
67}
68
69//------------------------------------------------------------------------------
72inline void
77
78//------------------------------------------------------------------------------
81inline IndexT
83{
84 return this->baseVertex;
85}
86
87//------------------------------------------------------------------------------
90inline void
95
96//------------------------------------------------------------------------------
99inline SizeT
101{
102 return this->numVertices;
103}
104
105//------------------------------------------------------------------------------
108inline void
113
114//------------------------------------------------------------------------------
117inline IndexT
119{
120 return this->baseIndex;
121}
122
123//------------------------------------------------------------------------------
126inline void
131
132//------------------------------------------------------------------------------
135inline SizeT
137{
138 return this->numIndices;
139}
140
141//------------------------------------------------------------------------------
144inline SizeT
146{
147 if (this->numIndices > 0)
148 {
150 }
151 else
152 {
154 }
155}
156
157//------------------------------------------------------------------------------
160inline void
165
166//------------------------------------------------------------------------------
169inline const Math::bbox&
171{
172 return this->boundingBox;
173}
174
175} // namespace PrimitiveGroup
176//------------------------------------------------------------------------------
177
Math::bbox boundingBox
Definition primitivegroup.h:53
SizeT GetNumPrimitives(const CoreGraphics::PrimitiveTopology::Code &topo) const
get computed number of primitives
Definition primitivegroup.h:145
SizeT GetNumIndices() const
get number of indices
Definition primitivegroup.h:136
IndexT GetBaseIndex() const
get base index index
Definition primitivegroup.h:118
IndexT baseIndex
Definition primitivegroup.h:51
SizeT numVertices
Definition primitivegroup.h:50
IndexT baseVertex
Definition primitivegroup.h:49
PrimitiveGroup()
constructor
Definition primitivegroup.h:60
SizeT numIndices
Definition primitivegroup.h:52
SizeT GetNumVertices() const
get number of vertices
Definition primitivegroup.h:100
void SetBoundingBox(const Math::bbox &bbox)
Set the bounding box.
Definition primitivegroup.h:161
void SetNumVertices(SizeT n)
set number of vertices
Definition primitivegroup.h:91
void SetBaseVertex(IndexT i)
set base vertex index
Definition primitivegroup.h:73
const Math::bbox & GetBoundingBox() const
Get the bounding box for this primitive.
Definition primitivegroup.h:170
void SetBaseIndex(IndexT i)
set base index index
Definition primitivegroup.h:109
void SetNumIndices(SizeT n)
set number of indices
Definition primitivegroup.h:127
IndexT GetBaseVertex() const
get index of base vertex
Definition primitivegroup.h:82
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
Nebula's bounding box class.
Definition bbox.h:24
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:42
int IndexT
Definition types.h:41