Panda3D
bulletHelper.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file bulletHelper.h
10  * @author enn0x
11  * @date 2011-01-19
12  */
13 
14 #ifndef __BULLET_HELPER_H__
15 #define __BULLET_HELPER_H__
16 
17 #include "pandabase.h"
18 
19 #include "bullet_includes.h"
20 #include "bullet_utils.h"
21 
22 #include "collisionNode.h"
23 #include "nodePath.h"
24 #include "nodePathCollection.h"
25 
26 class BulletSoftBodyNode;
27 
28 /**
29  *
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=nullptr,
49  bool two_sided=false);
50 
51  static PT(Geom) make_geom_from_links(BulletSoftBodyNode *node,
52  const GeomVertexFormat *format=nullptr);
53 
54  static void make_texcoords_for_patch(Geom *geom, int resx, int resy);
55 
56  MAKE_PROPERTY(sb_index, get_sb_index);
57  MAKE_PROPERTY(sb_flip, get_sb_flip);
58 
59 private:
60  static PT(InternalName) _sb_index;
61  static PT(InternalName) _sb_flip;
62 
63  static bool is_tangible(CollisionNode *cnode);
64 
65  static PT(Geom) make_geom(BulletSoftBodyNode *node,
66  const GeomVertexFormat *format,
67  bool use_faces,
68  bool two_sided);
69 };
70 
71 #include "bulletHelper.I"
72 
73 #endif // __BULLET_HELPER_H__
Geom
A container for geometry primitives.
Definition: geom.h:54
nodePath.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
BulletSoftBodyNode
Definition: bulletSoftBodyNode.h:71
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
InternalName
Encodes a string name in a hash table, mapping it to a pointer.
Definition: internalName.h:38
BulletHelper
Definition: bulletHelper.h:31
collisionNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bulletHelper.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bullet_includes.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bullet_utils.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
GeomVertexFormat
This class defines the physical layout of the vertex data stored within a Geom.
Definition: geomVertexFormat.h:55
NodePath
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:159
nodePathCollection.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CollisionNode
A node in the scene graph that can hold any number of CollisionSolids.
Definition: collisionNode.h:30
NodePathCollection
This is a set of zero or more NodePaths.
Definition: nodePathCollection.h:26