Panda3D
|
00001 // Filename: physxBox.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 PHYSXBOX_H 00016 #define PHYSXBOX_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 : PhysxBox 00026 // Description : Represents an oriented bounding box, as a center 00027 // point, extents(radii) and a rotation. i.e. the 00028 // center of the box is at the center point, the box 00029 // is rotated around this point with the rotation and 00030 // it is 2*extents in width, height and depth. 00031 //////////////////////////////////////////////////////////////////// 00032 class EXPCL_PANDAPHYSX PhysxBox { 00033 00034 PUBLISHED: 00035 INLINE PhysxBox(); 00036 INLINE ~PhysxBox(); 00037 PhysxBox(const LPoint3f ¢er, const LVector3f &extents, const LMatrix3f &rot); 00038 00039 bool is_valid() const; 00040 void rotate(const LMatrix4f &m, PhysxBox &obb) const; 00041 void set_empty(); 00042 00043 LPoint3f get_center() const; 00044 LVector3f get_extents() const; 00045 LMatrix3f get_rot() const; 00046 00047 void set_center(LPoint3f center); 00048 void set_extents(LVector3f extents); 00049 void set_rot(LMatrix3f rot); 00050 00051 public: 00052 NxBox _box; 00053 }; 00054 00055 #include "physxBox.I" 00056 00057 #endif // PHYSBOX_H