69 if(!primitives || !nb_prims)
return false;
110 if(!primitives || !nb_prims)
return false;
121 mIMesh->GetTriangle(VP, *primitives++);
152 mIMesh->GetTriangle(VP, index);
155 return ((*VP.
Vertex[0])[axis]
175 float SplitValue = 0.0f;
180 mIMesh->GetTriangle(VP, primitives[
i]);
182 SplitValue += (*VP.
Vertex[0])[axis];
183 SplitValue += (*VP.
Vertex[1])[axis];
184 SplitValue += (*VP.
Vertex[2])[axis];
186 return SplitValue / float(nb_prims*3);
203 if(!primitives || !nb_prims)
return false;
212 global_box.
Extend(mVertexArray[primitives[
i]]);
228 return mVertexArray[index][axis];
246 float SplitValue = 0.0f;
250 SplitValue += mVertexArray[primitives[
i]][axis];
252 return SplitValue / float(nb_prims);
inline_ void GetCenter(Point ¢er) const
Get box center.
const AABB * mAABBArray
Shortcut to an app-controlled array of AABBs.
udword mRules
Building/Splitting rules (a combination of SplittingRules flags)
unsigned int udword
sizeof(udword) must be 4
#define MAX_FLOAT
max possible float value
void Extend(const Point &p)
void SetMinMax(const Point &min, const Point &max)
Split at geometric center (else split in the middle)
virtual float GetSplittingValue(udword index, udword axis) const =0
virtual bool ComputeGlobalBox(const udword *primitives, udword nb_prims, AABB &global_box) const =0
#define MIN_FLOAT
min possible loat value
BuildSettings mSettings
Splitting rules & split limit [Opcode 1.3].