Go to the documentation of this file.
156 if(!
create.mIMesh || !
create.mIMesh->IsValid())
return false;
160 if(NbDegenerate)
Log(
"OPCODE WARNING: found %d degenerate faces in model! Collision might report wrong results!\n", NbDegenerate);
193 if(current->IsLeaf())
204 if(current->IsLeaf())
246 bool MustKeepIndices =
true;
254 MustKeepIndices =
false;
276 if(!LeafTree->
Build(&TB))
goto FreeAndExit;
315 #ifdef OPC_USE_FCOMI // a 15% speedup on my machine, not much
345 if(!
mTree)
return false;
363 if(Current.HasPosLeaf())
365 const LeafTriangles& CurrentLeaf = LT[Current.GetPosPrimitive()];
367 Min.SetPlusInfinity();
368 Max.SetMinusInfinity();
370 Point TmpMin, TmpMax;
408 if(Current.HasNegLeaf())
410 const LeafTriangles& CurrentLeaf = LT[Current.GetNegPrimitive()];
412 Min_.SetPlusInfinity();
413 Max_.SetMinusInfinity();
415 Point TmpMin, TmpMax;
453 Min.x =
FCMin2(Min.x, Min_.x);
454 Max.x =
FCMax2(Max.x, Max_.x);
455 Min.y =
FCMin2(Min.y, Min_.y);
456 Max.y =
FCMax2(Max.y, Max_.y);
457 Min.z =
FCMin2(Min.z, Min_.z);
458 Max.z =
FCMax2(Max.z, Max_.z);
463 Current.mAABB.SetMinMax(Min, Max);
bool CreateTree(bool no_leaf, bool quantized)
inline_ BOOL IsQuantized() const
inline_ void SetMeshInterface(const MeshInterface *imesh)
bool Build(AABBTreeBuilder *builder)
virtual bool Build(const OPCODECREATE &create)=0
const inline_ udword * GetPrimitives() const
inline_ void GetTriangle(VertexPointers &vp, udword index) const
udword mNbPrimitives
Number of primitives in the model.
LeafTriangles * mTriangles
#define DELETESINGLE(x)
Deletes an instance of a class.
inline_ void GetMin(Point &min) const
Get min point of the box.
udword mNbPrimitives
Total number of primitives.
unsigned int udword
sizeof(udword) must be 4
const AABB * mAABBArray
Shortcut to an app-controlled array of AABBs.
inline_ BOOL HasLeafNodes() const
udword mNbLeaves
Number of leaf nodes in the model.
inline_ udword GetNbPrimitives() const
inline_ float FCMax2(float a, float b)
A global function to find MAX(a,b) using FCOMI/FCMOV.
static BodyCustomizerHandle create(BodyHandle bodyHandle, const char *modelName)
virtual bool Build(AABBTree *tree)=0
static int max(int a, int b)
inline_ void CopyMemory(void *dest, const void *src, udword size)
Model creation structure.
@ OPC_SINGLE_NODE
Special case for 1-node models.
inline_ void ComputeMinMax(Point &min, Point &max, const VertexPointers &vp)
udword * mIndices
Array of primitive indices.
static int min(int a, int b)
const inline_ LeafTriangles * GetLeafTriangles() const
virtual udword GetUsedBytes() const =0
inline_ float FCMin3(float a, float b, float c)
A global function to find MIN(a,b,c) using FCOMI/FCMOV.
BuildSettings mSettings
Splitting rules & split limit [Opcode 1.3].
inline_ float FCMax3(float a, float b, float c)
A global function to find MAX(a,b,c) using FCOMI/FCMOV.
inline_ void SetData(udword nb, udword index)
LeafTriangles * mTriangles
Array of mNbLeaves leaf descriptors.
inline_ udword GetNbTriangles() const
const MeshInterface * mIMesh
User-defined mesh interface.
inline_ void GetMax(Point &max) const
Get max point of the box.
const inline_ udword * GetIndices() const
udword mModelCode
Model code = combination of ModelFlag(s)
virtual udword GetUsedBytes() const =0
udword Walk(WalkingCallback callback, void *user_data) const
inline_ udword GetTriangleIndex() const
#define DELETEARRAY(x)
Deletes an array.
AABBOptimizedTree * mTree
Optimized tree owned by the model.
inline_ float FCMin2(float a, float b)
A global function to find MIN(a,b) using FCOMI/FCMOV.
inline_ udword GetNbNodes() const
AABBTree * mSource
Original source tree.
const MeshInterface * mIMesh
Shortcut to an app-controlled mesh interface.
#define null
our own NULL pointer
udword mLimit
Limit number of primitives / node. If limit is 1, build a complete tree (2*N-1 nodes)
openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:03