OPC_Model.h 3.3 KB

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