Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
86 int numVertices = clothVertices.
size();
95 float *vertexPointer = basePointer + vertexOffset;
97 for (
int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex)
99 btVector3 position = clothVertices[vertexIndex].m_x;
100 *(vertexPointer + 0) = (
float)position.
getX();
101 *(vertexPointer + 1) = (
float)position.
getY();
102 *(vertexPointer + 2) = (
float)position.
getZ();
103 vertexPointer += vertexStride;
110 float *normalPointer = basePointer + normalOffset;
112 for (
int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex)
114 btVector3 normal = clothVertices[vertexIndex].m_n;
115 *(normalPointer + 0) = (
float)normal.
getX();
116 *(normalPointer + 1) = (
float)normal.
getY();
117 *(normalPointer + 2) = (
float)normal.
getZ();
118 normalPointer += normalStride;
virtual void copySoftBodyToVertexBuffer(const btSoftBody *const softBody, btVertexBufferDescriptor *vertexBuffer)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void defaultCollisionHandler(const btCollisionObjectWrapper *pcoWrap)
void copyFromArray(const btAlignedObjectArray &otherArray)
btDefaultSoftBodySolver()
bool m_updateSolverConstants
Variable to define whether we need to update solver constants on the next iteration.
virtual bool hasVertexPositions() const
virtual float * getBasePointer() const
Return the base pointer in memory to the first vertex.
virtual bool hasNormals() const
const btScalar & getX() const
Return the x value.
virtual void optimize(btAlignedObjectArray< btSoftBody * > &softBodies, bool forceUpdate=false)
Optimize soft bodies in this solver.
virtual void copyBackToSoftBodies(bool bMove=true)
Copy necessary data back to the original soft body source objects.
virtual void predictMotion(btScalar solverdt)
Predict motion of soft bodies into next timestep.
virtual int getVertexStride() const
Return the vertex stride in number of floats between vertices.
virtual void updateSoftBodies()
Perform necessary per-step updates of soft bodies such as recomputing normals and bounding boxes.
void predictMotion(btScalar dt)
btVector3 can be used to represent 3D points and vectors.
virtual int getNormalOffset() const
Return the vertex offset in floats from the base pointer.
const btScalar & getZ() const
Return the z value.
btAlignedObjectArray< btSoftBody * > m_softBodySet
const btScalar & getY() const
Return the y value.
virtual bool checkInitialized()
Ensure that this solver is initialized.
virtual void solveConstraints(btScalar solverdt)
Solve constraints for a set of soft bodies.
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
virtual void processCollision(btSoftBody *, const btCollisionObjectWrapper *)
virtual int getVertexOffset() const
Return the vertex offset in floats from the base pointer.
virtual ~btDefaultSoftBodySolver()
virtual BufferTypes getBufferType() const =0
Return the type of the vertex buffer descriptor.
virtual int getNormalStride() const
Return the vertex stride in number of floats between vertices.
int size() const
return the number of elements in the array