OPC_HybridModel.h
Go to the documentation of this file.
1 /*
3  * OPCODE - Optimized Collision Detection
4  * Copyright (C) 2001 Pierre Terdiman
5  * Homepage: http://www.codercorner.com/Opcode.htm
6  */
8 
10 
16 
19 // Include Guard
20 #ifndef __OPC_HYBRIDMODEL_H__
21 #define __OPC_HYBRIDMODEL_H__
22 
25  {
27 
29 
33  inline_ udword GetNbTriangles() const { return (Data & 15)+1; }
35 
37 
41  inline_ udword GetTriangleIndex() const { return Data>>4; }
43  inline_ void SetData(udword nb, udword index) { ASSERT(nb>0 && nb<=16); nb--; Data = (index<<4)|(nb&15); }
44  };
45 
47  {
48  public:
49  // Constructor/Destructor
50  HybridModel();
51  virtual ~HybridModel();
52 
54 
59  override(BaseModel) bool Build(const OPCODECREATE& create);
61 
63 
67  override(BaseModel) udword GetUsedBytes() const;
69 
71 
77  override(BaseModel) bool Refit();
79 
81 
85  inline_ const LeafTriangles* GetLeafTriangles() const { return mTriangles; }
87 
89 
93  inline_ const udword* GetIndices() const { return mIndices; }
95 
96  private:
101 
102  // Internal methods
103  void Release();
104  };
105 
106 #endif // __OPC_HYBRIDMODEL_H__
udword mNbPrimitives
Number of primitives in the model.
Leaf descriptor.
LeafTriangles * mTriangles
Array of mNbLeaves leaf descriptors.
#define inline_
#define OPCODE_API
Definition: Opcode.h:68
udword mNbLeaves
Number of leaf nodes in the model.
udword * mIndices
Array of primitive indices.
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65
inline_ udword GetTriangleIndex() const
Model creation structure.
Definition: OPC_BaseModel.h:24
#define ASSERT(exp)
Definition: OPC_IceHook.h:24
udword Data
Packed data.
inline_ udword GetNbTriangles() const
static BodyCustomizerHandle create(BodyHandle bodyHandle, const char *modelName)
inline_ void SetData(udword nb, udword index)


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:04