| 1 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 |
/* |
| 3 |
* OPCODE - Optimized Collision Detection |
| 4 |
* Copyright (C) 2001 Pierre Terdiman |
| 5 |
* Homepage: http://www.codercorner.com/Opcode.htm |
| 6 |
*/ |
| 7 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 8 |
|
| 9 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 10 |
/** |
| 11 |
* Contains code for OPCODE models. |
| 12 |
* \file OPC_Model.h |
| 13 |
* \author Pierre Terdiman |
| 14 |
* \date March, 20, 2001 |
| 15 |
*/ |
| 16 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 17 |
|
| 18 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 19 |
// Include Guard |
| 20 |
#ifndef __OPC_MODEL_H__ |
| 21 |
#define __OPC_MODEL_H__ |
| 22 |
|
| 23 |
class OPCODE_API Model : public BaseModel |
| 24 |
{ |
| 25 |
public: |
| 26 |
// Constructor/Destructor |
| 27 |
Model(); |
| 28 |
virtual ~Model(); |
| 29 |
|
| 30 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 31 |
/** |
| 32 |
* Builds a collision model. |
| 33 |
* \param create [in] model creation structure |
| 34 |
* \return true if success |
| 35 |
*/ |
| 36 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 37 |
override(BaseModel) bool Build(const OPCODECREATE& create); |
| 38 |
|
| 39 |
#ifdef __MESHMERIZER_H__ |
| 40 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 41 |
/** |
| 42 |
* Gets the collision hull. |
| 43 |
* \return the collision hull if it exists |
| 44 |
*/ |
| 45 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 46 |
inline_ const CollisionHull* GetHull() const { return mHull; } |
| 47 |
#endif // __MESHMERIZER_H__ |
| 48 |
|
| 49 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 50 |
/** |
| 51 |
* Gets the number of bytes used by the tree. |
| 52 |
* \return amount of bytes used |
| 53 |
*/ |
| 54 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 55 |
override(BaseModel) udword GetUsedBytes() const; |
| 56 |
|
| 57 |
private: |
| 58 |
#ifdef __MESHMERIZER_H__ |
| 59 |
CollisionHull* mHull; //!< Possible convex hull |
| 60 |
#endif // __MESHMERIZER_H__ |
| 61 |
// Internal methods |
| 62 |
void Release(); |
| 63 |
}; |
| 64 |
|
| 65 |
#endif //__OPC_MODEL_H__ |