Panda3D
|
00001 // Filename: physxBounds3.h 00002 // Created by: enn0x (31Oct09) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef PHYSXBOUNDS3_H 00016 #define PHYSXBOUNDS3_H 00017 00018 #include "pandabase.h" 00019 #include "luse.h" 00020 00021 #include "config_physx.h" 00022 #include "physx_includes.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : PhysxBounds3 00026 // Description : Represention of a axis aligned bounding box. 00027 // The box is stored as minimum and maximum extent 00028 // corners. Alternate representation would be center 00029 // and dimensions. May be empty or nonempty. If not 00030 // empty, min <= max has to hold. 00031 //////////////////////////////////////////////////////////////////// 00032 class EXPCL_PANDAPHYSX PhysxBounds3 { 00033 00034 PUBLISHED: 00035 INLINE PhysxBounds3(); 00036 INLINE ~PhysxBounds3(); 00037 00038 void bounds_of_obb(const LMatrix3f &orientation, const LPoint3f &translation, const LVector3f &half_dims); 00039 void combine(const PhysxBounds3 &b2); 00040 bool contain(const LPoint3f &p) const; 00041 void fatten(float distance); 00042 void include(const LPoint3f &v); 00043 bool intersects(const PhysxBounds3 &b) const; 00044 bool intersects2d(const PhysxBounds3 &b, unsigned axis_to_ignore) const; 00045 bool is_empty() const; 00046 void scale(float scale); 00047 void set(const LPoint3f &min, const LPoint3f &max); 00048 void set_center_extents(const LPoint3f ¢er, const LVector3f &extents); 00049 void set_empty(); 00050 void set_infinite(); 00051 void transform(const LMatrix3f &orientation, const LPoint3f &translation); 00052 00053 LPoint3f get_max() const; 00054 LPoint3f get_min() const; 00055 LPoint3f get_center() const; 00056 LVector3f get_dimensions() const; 00057 00058 void set_max(LPoint3f value); 00059 void set_min(LPoint3f value); 00060 00061 public: 00062 NxBounds3 _bounds; 00063 }; 00064 00065 #include "physxBounds3.I" 00066 00067 #endif // PHYSBOUNDS3_H