Panda3D
 All Classes Functions Variables Enumerations
bulletShape.h
1 // Filename: bulletShape.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_SHAPE_H__
16 #define __BULLET_SHAPE_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 
22 #include "typedReferenceCount.h"
23 #include "boundingSphere.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : BulletShape
27 // Description :
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDABULLET BulletShape : public TypedReferenceCount {
30 
31 PUBLISHED:
32  INLINE virtual ~BulletShape();
33 
34  INLINE bool is_polyhedral() const;
35  INLINE bool is_convex() const;
36  INLINE bool is_convex_2d() const;
37  INLINE bool is_concave() const;
38  INLINE bool is_infinite() const;
39  INLINE bool is_non_moving() const;
40  INLINE bool is_soft_body() const;
41 
42  void set_margin(PN_stdfloat margin);
43  const char *get_name() const;
44 
45  PN_stdfloat get_margin() const;
46 
47  BoundingSphere get_shape_bounds() const;
48 
49 public:
50  virtual btCollisionShape *ptr() const = 0;
51 
52  LVecBase3 get_local_scale() const;
53  void set_local_scale(const LVecBase3 &scale);
54 
55 ////////////////////////////////////////////////////////////////////
56 public:
57  static TypeHandle get_class_type() {
58  return _type_handle;
59  }
60  static void init_type() {
61  TypedReferenceCount::init_type();
62  register_type(_type_handle, "BulletShape",
63  TypedReferenceCount::get_class_type());
64  }
65  virtual TypeHandle get_type() const {
66  return get_class_type();
67  }
68  virtual TypeHandle force_init_type() {
69  init_type();
70  return get_class_type();
71  }
72 
73 private:
74  static TypeHandle _type_handle;
75 };
76 
77 #include "bulletShape.I"
78 
79 #endif // __BULLET_SHAPE_H__
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This defines a bounding sphere, consisting of a center and a radius.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85