00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __BULLET_TRIANGLE_MESH_SHAPE_H__
00016 #define __BULLET_TRIANGLE_MESH_SHAPE_H__
00017
00018 #include "pandabase.h"
00019
00020 #include "bullet_includes.h"
00021 #include "bulletShape.h"
00022
00023 #include "luse.h"
00024
00025 class BulletTriangleMesh;
00026
00027
00028
00029
00030
00031 class EXPCL_PANDABULLET BulletTriangleMeshShape : public BulletShape {
00032
00033 PUBLISHED:
00034 BulletTriangleMeshShape(BulletTriangleMesh *mesh, bool dynamic, bool compress=true, bool bvh=true);
00035 INLINE BulletTriangleMeshShape(const BulletTriangleMeshShape ©);
00036 INLINE void operator = (const BulletTriangleMeshShape ©);
00037 INLINE ~BulletTriangleMeshShape();
00038
00039 void refit_tree(const LPoint3 &aabb_min, const LPoint3 &aabb_max);
00040
00041 INLINE bool is_static() const;
00042 INLINE bool is_dynamic() const;
00043
00044 public:
00045 virtual btCollisionShape *ptr() const;
00046
00047 private:
00048 btBvhTriangleMeshShape *_bvh_shape;
00049 btGImpactMeshShape *_gimpact_shape;
00050
00051 PT(BulletTriangleMesh) _mesh;
00052
00053
00054 public:
00055 static TypeHandle get_class_type() {
00056 return _type_handle;
00057 }
00058 static void init_type() {
00059 BulletShape::init_type();
00060 register_type(_type_handle, "BulletTriangleMeshShape",
00061 BulletShape::get_class_type());
00062 }
00063 virtual TypeHandle get_type() const {
00064 return get_class_type();
00065 }
00066 virtual TypeHandle force_init_type() {
00067 init_type();
00068 return get_class_type();
00069 }
00070
00071 private:
00072 static TypeHandle _type_handle;
00073 };
00074
00075 #include "bulletTriangleMeshShape.I"
00076
00077 #endif // __BULLET_TRIANGLE_MESH_SHAPE_H__