Panda3D
physxBounds3.h
1 // Filename: physxBounds3.h
2 // Created by: enn0x (31Oct09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PHYSXBOUNDS3_H
16 #define PHYSXBOUNDS3_H
17 
18 #include "pandabase.h"
19 #include "luse.h"
20 
21 #include "config_physx.h"
22 #include "physx_includes.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : PhysxBounds3
26 // Description : Represention of a axis aligned bounding box.
27 // The box is stored as minimum and maximum extent
28 // corners. Alternate representation would be center
29 // and dimensions. May be empty or nonempty. If not
30 // empty, min <= max has to hold.
31 ////////////////////////////////////////////////////////////////////
32 class EXPCL_PANDAPHYSX PhysxBounds3 {
33 
34 PUBLISHED:
35  INLINE PhysxBounds3();
36  INLINE ~PhysxBounds3();
37 
38  void bounds_of_obb(const LMatrix3f &orientation, const LPoint3f &translation, const LVector3f &half_dims);
39  void combine(const PhysxBounds3 &b2);
40  bool contain(const LPoint3f &p) const;
41  void fatten(float distance);
42  void include(const LPoint3f &v);
43  bool intersects(const PhysxBounds3 &b) const;
44  bool intersects2d(const PhysxBounds3 &b, unsigned axis_to_ignore) const;
45  bool is_empty() const;
46  void scale(float scale);
47  void set(const LPoint3f &min, const LPoint3f &max);
48  void set_center_extents(const LPoint3f &center, const LVector3f &extents);
49  void set_empty();
50  void set_infinite();
51  void transform(const LMatrix3f &orientation, const LPoint3f &translation);
52 
53  LPoint3f get_max() const;
54  LPoint3f get_min() const;
55  LPoint3f get_center() const;
56  LVector3f get_dimensions() const;
57 
58  void set_max(LPoint3f value);
59  void set_min(LPoint3f value);
60 
61 public:
62  NxBounds3 _bounds;
63 };
64 
65 #include "physxBounds3.I"
66 
67 #endif // PHYSBOUNDS3_H
Represention of a axis aligned bounding box.
Definition: physxBounds3.h:32
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
This is a 3-by-3 transform matrix.
Definition: lmatrix.h:110