2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2008 Erwin Coumans http://continuousphysics.com/Bullet/
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
16 #ifndef SOFT_BODY_HELPERS_H
17 #define SOFT_BODY_HELPERS_H
19 #include "btSoftBody.h"
26 struct fDrawFlags { enum _ {
41 Std = Links+Faces+Tetras+Anchors+Notes+Joints,
42 StdTetra = Std-Faces+Tetras,
45 struct btSoftBodyHelpers
48 static void Draw( btSoftBody* psb,
50 int drawflags=fDrawFlags::Std);
52 static void DrawInfos( btSoftBody* psb,
58 static void DrawNodeTree( btSoftBody* psb,
63 static void DrawFaceTree( btSoftBody* psb,
67 /* Draw cluster tree */
68 static void DrawClusterTree(btSoftBody* psb,
72 /* Draw rigid frame */
73 static void DrawFrame( btSoftBody* psb,
76 static btSoftBody* CreateRope( btSoftBodyWorldInfo& worldInfo,
77 const btVector3& from,
82 static btSoftBody* CreatePatch(btSoftBodyWorldInfo& worldInfo,
83 const btVector3& corner00,
84 const btVector3& corner10,
85 const btVector3& corner01,
86 const btVector3& corner11,
91 /* Create an ellipsoid */
92 static btSoftBody* CreateEllipsoid(btSoftBodyWorldInfo& worldInfo,
93 const btVector3& center,
94 const btVector3& radius,
96 /* Create from trimesh */
97 static btSoftBody* CreateFromTriMesh( btSoftBodyWorldInfo& worldInfo,
98 const btScalar* vertices,
101 /* Create from convex-hull */
102 static btSoftBody* CreateFromConvexHull( btSoftBodyWorldInfo& worldInfo,
103 const btVector3* vertices,
107 #endif //SOFT_BODY_HELPERS_H