Blender V4.3
btSoftBodySolvers.h
Go to the documentation of this file.
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. 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.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16#ifndef BT_SOFT_BODY_SOLVERS_H
17#define BT_SOFT_BODY_SOLVERS_H
18
20
21class btSoftBodyTriangleData;
22class btSoftBodyLinkData;
23class btSoftBodyVertexData;
25class btCollisionObject;
26class btSoftBody;
27
29{
30public:
41
42protected:
45 // Simulation timescale
47
48public:
55
57 {
58 }
59
63 virtual SolverTypes getSolverType() const = 0;
64
66 virtual bool checkInitialized() = 0;
67
69 virtual void optimize(btAlignedObjectArray<btSoftBody *> &softBodies, bool forceUpdate = false) = 0;
70
72 virtual void copyBackToSoftBodies(bool bMove = true) = 0;
73
75 virtual void predictMotion(btScalar solverdt) = 0;
76
78 virtual void solveConstraints(btScalar solverdt) = 0;
79
81 virtual void updateSoftBodies() = 0;
82
84 virtual void processCollision(btSoftBody *, const struct btCollisionObjectWrapper *) = 0;
85
87 virtual void processCollision(btSoftBody *, btSoftBody *) = 0;
88
90 virtual void setNumberOfPositionIterations(int iterations)
91 {
93 }
94
100
102 virtual void setNumberOfVelocityIterations(int iterations)
103 {
104 m_numberOfVelocityIterations = iterations;
105 }
106
109 {
111 }
112
115 {
116 return m_timeScale;
117 }
118
119#if 0
123 virtual void addCollisionObjectForSoftBody( int clothIdentifier, btCollisionObject *collisionObject ) = 0;
124#endif
125};
126
132{
133protected:
134public:
138
140 {
141 }
142
144 virtual void copySoftBodyToVertexBuffer(const btSoftBody *const softBody, btVertexBufferDescriptor *vertexBuffer) = 0;
145};
146
147#endif // #ifndef BT_SOFT_BODY_SOLVERS_H
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition btScalar.h:314
virtual void copySoftBodyToVertexBuffer(const btSoftBody *const softBody, btVertexBufferDescriptor *vertexBuffer)=0
virtual void processCollision(btSoftBody *, btSoftBody *)=0
virtual int getNumberOfVelocityIterations()
virtual void predictMotion(btScalar solverdt)=0
virtual void setNumberOfVelocityIterations(int iterations)
virtual void processCollision(btSoftBody *, const struct btCollisionObjectWrapper *)=0
virtual void setNumberOfPositionIterations(int iterations)
virtual int getNumberOfPositionIterations()
virtual SolverTypes getSolverType() const =0
virtual bool checkInitialized()=0
virtual void copyBackToSoftBodies(bool bMove=true)=0
virtual ~btSoftBodySolver()
virtual void updateSoftBodies()=0
virtual void solveConstraints(btScalar solverdt)=0
virtual void optimize(btAlignedObjectArray< btSoftBody * > &softBodies, bool forceUpdate=false)=0