Panda3D
bulletSphereShape.h
1 // Filename: bulletSphereShape.h
2 // Created by: enn0x (23Jan10)
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_SPHERE_SHAPE_H__
16 #define __BULLET_SPHERE_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 "collisionSphere.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : BulletSphereShape
28 // Description :
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDABULLET BulletSphereShape : public BulletShape {
31 
32 PUBLISHED:
33  BulletSphereShape(PN_stdfloat radius);
34  INLINE BulletSphereShape(const BulletSphereShape &copy);
35  INLINE void operator = (const BulletSphereShape &copy);
36  INLINE ~BulletSphereShape();
37 
38  INLINE PN_stdfloat get_radius() const;
39 
40  static BulletSphereShape *make_from_solid(const CollisionSphere *solid);
41 
42 public:
43  virtual btCollisionShape *ptr() const;
44 
45 private:
46  btSphereShape *_shape;
47 
48 ////////////////////////////////////////////////////////////////////
49 public:
50  static TypeHandle get_class_type() {
51  return _type_handle;
52  }
53  static void init_type() {
54  BulletShape::init_type();
55  register_type(_type_handle, "BulletSphereShape",
56  BulletShape::get_class_type());
57  }
58  virtual TypeHandle get_type() const {
59  return get_class_type();
60  }
61  virtual TypeHandle force_init_type() {
62  init_type();
63  return get_class_type();
64  }
65 
66 private:
67  static TypeHandle _type_handle;
68 };
69 
70 #include "bulletSphereShape.I"
71 
72 #endif // __BULLET_SPHERE_SHAPE_H__
A spherical collision volume or object.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85