BoundingBox.pkg 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. $#include "BoundingBox.h"
  2. class BoundingBox
  3. {
  4. public:
  5. BoundingBox();
  6. BoundingBox(const BoundingBox& box);
  7. BoundingBox(const Rect& rect);
  8. BoundingBox(const Vector3& min, const Vector3& max);
  9. BoundingBox(float min, float max);
  10. BoundingBox(const Frustum& frustum);
  11. BoundingBox(const Polyhedron& poly);
  12. BoundingBox(const Sphere& sphere);
  13. bool operator == (const BoundingBox& rhs) const;
  14. void Define(const BoundingBox& box);
  15. void Define(const Rect& rect);
  16. void Define(const Vector3& min, const Vector3& max);
  17. void Define(float min, float max);
  18. void Define(const Vector3& point);
  19. void Define(const Frustum& frustum);
  20. void Define(const Polyhedron& poly);
  21. void Define(const Sphere& sphere);
  22. void Merge(const Vector3& point);
  23. void Merge(const BoundingBox& box);
  24. void Merge(const Frustum& frustum);
  25. void Merge(const Polyhedron& poly);
  26. void Merge(const Sphere& sphere);
  27. void Clip(const BoundingBox& box);
  28. void Transform(const Matrix3& transform);
  29. void Transform(const Matrix3x4& transform);
  30. void Clear();
  31. Vector3 Center() const;
  32. Vector3 Size() const;
  33. Vector3 HalfSize() const;
  34. BoundingBox Transformed(const Matrix3& transform) const;
  35. BoundingBox Transformed(const Matrix3x4& transform) const;
  36. Rect Projected(const Matrix4& projection) const;
  37. Intersection IsInside(const Vector3& point) const;
  38. Intersection IsInside(const BoundingBox& box) const;
  39. Intersection IsInsideFast(const BoundingBox& box) const;
  40. Intersection IsInside(const Sphere& sphere) const;
  41. Intersection IsInsideFast(const Sphere& sphere) const;
  42. String ToString() const;
  43. Vector3 min_ @ min;
  44. Vector3 max_ @ max;
  45. bool defined_ @ defined;
  46. tolua_readonly tolua_property__get_set Vector3 center;
  47. tolua_readonly tolua_property__get_set Vector3 size;
  48. tolua_readonly tolua_property__get_set Vector3 halfSize;
  49. };
  50. ${
  51. #define TOLUA_DISABLE_tolua_get_BoundingBox_center
  52. #define tolua_get_BoundingBox_center tolua_MathLuaAPI_BoundingBox_Center00
  53. #define TOLUA_DISABLE_tolua_get_BoundingBox_size
  54. #define tolua_get_BoundingBox_size tolua_MathLuaAPI_BoundingBox_Size00
  55. #define TOLUA_DISABLE_tolua_get_BoundingBox_halfSize
  56. #define tolua_get_BoundingBox_halfSize tolua_MathLuaAPI_BoundingBox_HalfSize00
  57. $}