Panda3D
bulletMinkowskiSumShape.h
1 // Filename: bulletMinkowskiSumShape.h
2 // Created by: enn0x (15Aug13)
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_MINKOWSKI_SUM_SHAPE_H__
16 #define __BULLET_MINKOWSKI_SUM_SHAPE_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 #include "bullet_utils.h"
22 #include "bulletShape.h"
23 
24 #include "transformState.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : BulletMinkowskiSumShape
28 // Description :
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDABULLET BulletMinkowskiSumShape : public BulletShape {
31 
32 PUBLISHED:
33  BulletMinkowskiSumShape(const BulletShape *shape_a, const BulletShape *shape_b);
35  INLINE void operator = (const BulletMinkowskiSumShape &copy);
36  INLINE ~BulletMinkowskiSumShape();
37 
38  INLINE void set_transform_a(const TransformState *ts);
39  INLINE void set_transform_b(const TransformState *ts);
40  INLINE CPT(TransformState) get_transform_a() const;
41  INLINE CPT(TransformState) get_transform_b() const;
42 
43  INLINE const BulletShape *get_shape_a() const;
44  INLINE const BulletShape *get_shape_b() const;
45 
46  INLINE PN_stdfloat get_margin() const;
47 
48 public:
49  virtual btCollisionShape *ptr() const;
50 
51 private:
52  btMinkowskiSumShape *_shape;
53 
54  CPT(BulletShape) _shape_a;
55  CPT(BulletShape) _shape_b;
56 
57 ////////////////////////////////////////////////////////////////////
58 public:
59  static TypeHandle get_class_type() {
60  return _type_handle;
61  }
62  static void init_type() {
63  BulletShape::init_type();
64  register_type(_type_handle, "BulletMinkowskiSumShape",
65  BulletShape::get_class_type());
66  }
67  virtual TypeHandle get_type() const {
68  return get_class_type();
69  }
70  virtual TypeHandle force_init_type() {
71  init_type();
72  return get_class_type();
73  }
74 
75 private:
76  static TypeHandle _type_handle;
77 };
78 
79 #include "bulletMinkowskiSumShape.I"
80 
81 #endif // __BULLET_MINKOWSKI_SUM_SHAPE_H__
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85