Panda3D
 All Classes Functions Variables Enumerations
bulletTriangleMeshShape.h
1 // Filename: bulletTriangleMeshShape.h
2 // Created by: enn0x (09Feb10)
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_TRIANGLE_MESH_SHAPE_H__
16 #define __BULLET_TRIANGLE_MESH_SHAPE_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 #include "bulletShape.h"
22 
23 #include "luse.h"
24 
25 class BulletTriangleMesh;
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : BulletTriangleMeshShape
29 // Description :
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDABULLET BulletTriangleMeshShape : public BulletShape {
32 
33 PUBLISHED:
34  BulletTriangleMeshShape(BulletTriangleMesh *mesh, bool dynamic, bool compress=true, bool bvh=true);
36  INLINE void operator = (const BulletTriangleMeshShape &copy);
37  INLINE ~BulletTriangleMeshShape();
38 
39  void refit_tree(const LPoint3 &aabb_min, const LPoint3 &aabb_max);
40 
41  INLINE bool is_static() const;
42  INLINE bool is_dynamic() const;
43 
44 public:
45  virtual btCollisionShape *ptr() const;
46 
47 private:
48  btBvhTriangleMeshShape *_bvh_shape;
49  btGImpactMeshShape *_gimpact_shape;
50 
51  PT(BulletTriangleMesh) _mesh;
52 
53 ////////////////////////////////////////////////////////////////////
54 public:
55  static TypeHandle get_class_type() {
56  return _type_handle;
57  }
58  static void init_type() {
59  BulletShape::init_type();
60  register_type(_type_handle, "BulletTriangleMeshShape",
61  BulletShape::get_class_type());
62  }
63  virtual TypeHandle get_type() const {
64  return get_class_type();
65  }
66  virtual TypeHandle force_init_type() {
67  init_type();
68  return get_class_type();
69  }
70 
71 private:
72  static TypeHandle _type_handle;
73 };
74 
75 #include "bulletTriangleMeshShape.I"
76 
77 #endif // __BULLET_TRIANGLE_MESH_SHAPE_H__
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85