Panda3D
 All Classes Functions Variables Enumerations
bulletBoxShape.h
1 // Filename: bulletBoxShape.h
2 // Created by: enn0x (24Jan10)
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 __BULLET_BOX_SHAPE_H__
16 #define __BULLET_BOX_SHAPE_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 #include "bulletShape.h"
22 
23 #include "luse.h"
24 
25 #include "collisionBox.h"
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : BulletBoxShape
29 // Description :
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDABULLET BulletBoxShape : public BulletShape {
32 
33 PUBLISHED:
34  BulletBoxShape(const LVecBase3 &halfExtents);
35  INLINE BulletBoxShape(const BulletBoxShape &copy);
36  INLINE void operator = (const BulletBoxShape &copy);
37  INLINE ~BulletBoxShape();
38 
39  LVecBase3 get_half_extents_without_margin() const;
40  LVecBase3 get_half_extents_with_margin() const;
41 
42  static BulletBoxShape *make_from_solid(const CollisionBox *solid);
43 
44 public:
45  virtual btCollisionShape *ptr() const;
46 
47 private:
48  btBoxShape *_shape;
49 
50 ////////////////////////////////////////////////////////////////////
51 public:
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  BulletShape::init_type();
57  register_type(_type_handle, "BulletBoxShape",
58  BulletShape::get_class_type());
59  }
60  virtual TypeHandle get_type() const {
61  return get_class_type();
62  }
63  virtual TypeHandle force_init_type() {
64  init_type();
65  return get_class_type();
66  }
67 
68 private:
69  static TypeHandle _type_handle;
70 };
71 
72 #include "bulletBoxShape.I"
73 
74 #endif // __BULLET_BOX_SHAPE_H__
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
A cuboid collision volume or object.
Definition: collisionBox.h:30
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85