00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __BULLET_HELPER_H__
00016 #define __BULLET_HELPER_H__
00017
00018 #include "pandabase.h"
00019
00020 #include "bullet_includes.h"
00021 #include "bullet_utils.h"
00022
00023 #include "collisionNode.h"
00024 #include "nodePath.h"
00025 #include "nodePathCollection.h"
00026
00027
00028
00029
00030
00031 class EXPCL_PANDABULLET BulletHelper {
00032
00033 PUBLISHED:
00034
00035
00036 static NodePathCollection from_collision_solids(NodePath &np, bool clear=false);
00037
00038
00039 INLINE static PT(InternalName) get_sb_index();
00040 INLINE static PT(InternalName) get_sb_flip();
00041
00042
00043 static CPT(GeomVertexFormat) add_sb_index_column(const GeomVertexFormat *format);
00044 static CPT(GeomVertexFormat) add_sb_flip_column(const GeomVertexFormat *format);
00045
00046
00047 static PT(Geom) make_geom_from_faces(BulletSoftBodyNode *node,
00048 const GeomVertexFormat *format=NULL,
00049 bool two_sided=false);
00050
00051 static PT(Geom) make_geom_from_links(BulletSoftBodyNode *node,
00052 const GeomVertexFormat *format=NULL);
00053
00054 static void make_texcoords_for_patch(Geom *geom, int resx, int resy);
00055
00056 private:
00057 static PT(InternalName) _sb_index;
00058 static PT(InternalName) _sb_flip;
00059
00060 static bool is_tangible(CollisionNode *cnode);
00061
00062 static PT(Geom) make_geom(BulletSoftBodyNode *node,
00063 const GeomVertexFormat *format,
00064 bool use_faces,
00065 bool two_sided);
00066 };
00067
00068 #include "bulletHelper.I"
00069
00070 #endif // __BULLET_HELPER_H__