Panda3D
 All Classes Functions Variables Enumerations
bulletHelper.h
1 // Filename: bulletHelper.h
2 // Created by: enn0x (19Jan11)
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_HELPER_H__
16 #define __BULLET_HELPER_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 #include "bullet_utils.h"
22 
23 #include "collisionNode.h"
24 #include "nodePath.h"
25 #include "nodePathCollection.h"
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : BulletHelper
29 // Description :
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDABULLET BulletHelper {
32 
33 PUBLISHED:
34 
35  // Collision shapes
36  static NodePathCollection from_collision_solids(NodePath &np, bool clear=false);
37 
38  // Internal names
39  INLINE static PT(InternalName) get_sb_index();
40  INLINE static PT(InternalName) get_sb_flip();
41 
42  // Geom vertex data
43  static CPT(GeomVertexFormat) add_sb_index_column(const GeomVertexFormat *format);
44  static CPT(GeomVertexFormat) add_sb_flip_column(const GeomVertexFormat *format);
45 
46  // Geom utils
47  static PT(Geom) make_geom_from_faces(BulletSoftBodyNode *node,
48  const GeomVertexFormat *format=NULL,
49  bool two_sided=false);
50 
51  static PT(Geom) make_geom_from_links(BulletSoftBodyNode *node,
52  const GeomVertexFormat *format=NULL);
53 
54  static void make_texcoords_for_patch(Geom *geom, int resx, int resy);
55 
56 private:
57  static PT(InternalName) _sb_index;
58  static PT(InternalName) _sb_flip;
59 
60  static bool is_tangible(CollisionNode *cnode);
61 
62  static PT(Geom) make_geom(BulletSoftBodyNode *node,
63  const GeomVertexFormat *format,
64  bool use_faces,
65  bool two_sided);
66 };
67 
68 #include "bulletHelper.I"
69 
70 #endif // __BULLET_HELPER_H__
A container for geometry primitives.
Definition: geom.h:58
A node in the scene graph that can hold any number of CollisionSolids.
Definition: collisionNode.h:33
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165
This is a set of zero or more NodePaths.