Panda3D

bulletHelper.h

00001 // Filename: bulletHelper.h
00002 // Created by:  enn0x (19Jan11)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
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 //       Class : BulletHelper
00029 // Description : 
00030 ////////////////////////////////////////////////////////////////////
00031 class EXPCL_PANDABULLET BulletHelper {
00032 
00033 PUBLISHED:
00034 
00035   // Collision shapes
00036   static NodePathCollection from_collision_solids(NodePath &np, bool clear=false);
00037 
00038   // Internal names
00039   INLINE static PT(InternalName) get_sb_index();
00040   INLINE static PT(InternalName) get_sb_flip();
00041 
00042   // Geom vertex data
00043   static CPT(GeomVertexFormat) add_sb_index_column(const GeomVertexFormat *format);
00044   static CPT(GeomVertexFormat) add_sb_flip_column(const GeomVertexFormat *format);
00045 
00046   // Geom utils
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__
 All Classes Functions Variables Enumerations