Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

btOpenCLSoftBodySolver Class Reference

#include <btSoftBodySolver_OpenCL.h>

Inheritance diagram for btOpenCLSoftBodySolver:
Inheritance graph
[legend]
Collaboration diagram for btOpenCLSoftBodySolver:
Collaboration graph
[legend]

List of all members.

Classes

struct  AnchorNodeInfoCL
struct  CollisionObjectIndices
struct  UIntVector3

Public Member Functions

 btOpenCLSoftBodySolver (cl_command_queue queue, cl_context ctx, bool bUpdateAchchoredNodePos=false)
virtual ~btOpenCLSoftBodySolver ()
btOpenCLAcceleratedSoftBodyInterfacefindSoftBodyInterface (const btSoftBody *const softBody)
virtual btSoftBodyLinkDatagetLinkData ()
virtual btSoftBodyVertexDatagetVertexData ()
virtual btSoftBodyTriangleDatagetTriangleData ()
virtual SolverTypes getSolverType () const
 Return the type of the solver.
virtual bool checkInitialized ()
 Ensure that this solver is initialized.
virtual void updateSoftBodies ()
 Perform necessary per-step updates of soft bodies such as recomputing normals and bounding boxes.
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 solveConstraints (float solverdt)
 Solve constraints for a set of soft bodies.
virtual void predictMotion (float solverdt)
 Predict motion of soft bodies into next timestep.
virtual void processCollision (btSoftBody *, const btCollisionObjectWrapper *)
virtual void processCollision (btSoftBody *, btSoftBody *)
 Process a collision between two soft bodies.
virtual void setDefaultWorkgroupSize (size_t workGroupSize)
virtual size_t getDefaultWorkGroupSize () const
void setCLFunctions (CLFunctions *funcs)

Public Attributes

btSoftBodyLinkDataOpenCL m_linkData
btSoftBodyVertexDataOpenCL m_vertexData
btSoftBodyTriangleDataOpenCL m_triangleData

Protected Member Functions

virtual bool buildShaders ()
void resetNormalsAndAreas (int numVertices)
void normalizeNormalsAndAreas (int numVertices)
void executeUpdateSoftBodies (int firstTriangle, int numTriangles)
void prepareCollisionConstraints ()
 Sort the collision object details array and generate indexing into it for the per-cloth collision object array.
Vectormath::Aos::Vector3 ProjectOnAxis (const Vectormath::Aos::Vector3 &v, const Vectormath::Aos::Vector3 &a)
void ApplyClampedForce (float solverdt, const Vectormath::Aos::Vector3 &force, const Vectormath::Aos::Vector3 &vertexVelocity, float inverseMass, Vectormath::Aos::Vector3 &vertexForce)
int findSoftBodyIndex (const btSoftBody *const softBody)
virtual void applyForces (float solverdt)
void updateFixedVertexPositions ()
virtual void integrate (float solverdt)
 Integrate motion on the solver.
virtual void updateConstants (float timeStep)
float computeTriangleArea (const Vectormath::Aos::Point3 &vertex0, const Vectormath::Aos::Point3 &vertex1, const Vectormath::Aos::Point3 &vertex2)
void prepareLinks ()
void solveLinksForVelocity (int startLink, int numLinks, float kst)
void updatePositionsFromVelocities (float solverdt)
virtual void solveLinksForPosition (int startLink, int numLinks, float kst, float ti)
void updateVelocitiesFromPositionsWithVelocities (float isolverdt)
void updateVelocitiesFromPositionsWithoutVelocities (float isolverdt)
virtual void solveCollisionsAndUpdateVelocities (float isolverdt)
void updateBounds ()
void releaseKernels ()

Protected Attributes

CLFunctions m_defaultCLFunctions
CLFunctionsm_currentCLFunctions
bool m_updateSolverConstants
 Variable to define whether we need to update solver constants on the next iteration.
bool m_shadersInitialized
btAlignedObjectArray
< btOpenCLAcceleratedSoftBodyInterface * > 
m_softBodySet
 Cloths owned by this solver.
btAlignedObjectArray
< Vectormath::Aos::Vector3
m_perClothAcceleration
 Acceleration value to be applied to all non-static vertices in the solver.
btOpenCLBuffer
< Vectormath::Aos::Vector3
m_clPerClothAcceleration
btAlignedObjectArray
< Vectormath::Aos::Vector3
m_perClothWindVelocity
 Wind velocity to be applied normal to all non-static vertices in the solver.
btOpenCLBuffer
< Vectormath::Aos::Vector3
m_clPerClothWindVelocity
btAlignedObjectArray< float > m_perClothDampingFactor
 Velocity damping factor.
btOpenCLBuffer< float > m_clPerClothDampingFactor
btAlignedObjectArray< float > m_perClothVelocityCorrectionCoefficient
 Velocity correction coefficient.
btOpenCLBuffer< float > m_clPerClothVelocityCorrectionCoefficient
btAlignedObjectArray< float > m_perClothLiftFactor
 Lift parameter for wind effect on cloth.
btOpenCLBuffer< float > m_clPerClothLiftFactor
btAlignedObjectArray< float > m_perClothDragFactor
 Drag parameter for wind effect on cloth.
btOpenCLBuffer< float > m_clPerClothDragFactor
btAlignedObjectArray< float > m_perClothMediumDensity
 Density of the medium in which each cloth sits.
btOpenCLBuffer< float > m_clPerClothMediumDensity
btAlignedObjectArray
< CollisionObjectIndices
m_perClothCollisionObjects
 Collision shape details: pair of index of first collision shape for the cloth and number of collision objects.
btOpenCLBuffer
< CollisionObjectIndices
m_clPerClothCollisionObjects
btAlignedObjectArray
< CollisionShapeDescription
m_collisionObjectDetails
 Collision shapes being passed across to the cloths in this solver.
btOpenCLBuffer
< CollisionShapeDescription
m_clCollisionObjectDetails
btAlignedObjectArray< float > m_perClothFriction
 Friction coefficient for each cloth.
btOpenCLBuffer< float > m_clPerClothFriction
btAlignedObjectArray
< AnchorNodeInfoCL
m_anchorNodeInfoArray
btAlignedObjectArray
< Vectormath::Aos::Point3
m_anchorPosition
btOpenCLBuffer
< Vectormath::Aos::Point3
m_clAnchorPosition
btAlignedObjectArray< int > m_anchorIndex
btOpenCLBuffer< int > m_clAnchorIndex
bool m_bUpdateAnchoredNodePos
cl_kernel m_prepareLinksKernel
cl_kernel m_solvePositionsFromLinksKernel
cl_kernel m_updateConstantsKernel
cl_kernel m_integrateKernel
cl_kernel m_addVelocityKernel
cl_kernel m_updatePositionsFromVelocitiesKernel
cl_kernel m_updateVelocitiesFromPositionsWithoutVelocitiesKernel
cl_kernel m_updateVelocitiesFromPositionsWithVelocitiesKernel
cl_kernel m_vSolveLinksKernel
cl_kernel m_solveCollisionsAndUpdateVelocitiesKernel
cl_kernel m_resetNormalsAndAreasKernel
cl_kernel m_normalizeNormalsAndAreasKernel
cl_kernel m_updateSoftBodiesKernel
cl_kernel m_outputToVertexArrayKernel
cl_kernel m_applyForcesKernel
cl_kernel m_updateFixedVertexPositionsKernel
cl_command_queue m_cqCommandQue
cl_context m_cxMainContext
size_t m_defaultWorkGroupSize

Detailed Description

Definition at line 243 of file btSoftBodySolver_OpenCL.h.


Constructor & Destructor Documentation

btOpenCLSoftBodySolver::btOpenCLSoftBodySolver ( cl_command_queue  queue,
cl_context  ctx,
bool  bUpdateAchchoredNodePos = false 
)

Definition at line 603 of file btSoftBodySolver_OpenCL.cpp.

btOpenCLSoftBodySolver::~btOpenCLSoftBodySolver (  )  [virtual]

Definition at line 652 of file btSoftBodySolver_OpenCL.cpp.


Member Function Documentation

void btOpenCLSoftBodySolver::ApplyClampedForce ( float  solverdt,
const Vectormath::Aos::Vector3 force,
const Vectormath::Aos::Vector3 vertexVelocity,
float  inverseMass,
Vectormath::Aos::Vector3 vertexForce 
) [protected]

Definition at line 1013 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::applyForces ( float  solverdt  )  [protected, virtual]

Definition at line 1050 of file btSoftBodySolver_OpenCL.cpp.

bool btOpenCLSoftBodySolver::buildShaders (  )  [protected, virtual]

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 1786 of file btSoftBodySolver_OpenCL.cpp.

bool btOpenCLSoftBodySolver::checkInitialized (  )  [virtual]

Ensure that this solver is initialized.

Implements btSoftBodySolver.

Definition at line 1777 of file btSoftBodySolver_OpenCL.cpp.

float btOpenCLSoftBodySolver::computeTriangleArea ( const Vectormath::Aos::Point3 vertex0,
const Vectormath::Aos::Point3 vertex1,
const Vectormath::Aos::Point3 vertex2 
) [protected]

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 1120 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::copyBackToSoftBodies ( bool  bMove = true  )  [virtual]

Copy necessary data back to the original soft body source objects.

Implements btSoftBodySolver.

Definition at line 678 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::executeUpdateSoftBodies ( int  firstTriangle,
int  numTriangles 
) [protected]

Definition at line 957 of file btSoftBodySolver_OpenCL.cpp.

int btOpenCLSoftBodySolver::findSoftBodyIndex ( const btSoftBody *const   softBody  )  [protected]

Definition at line 1766 of file btSoftBodySolver_OpenCL.cpp.

btOpenCLAcceleratedSoftBodyInterface * btOpenCLSoftBodySolver::findSoftBodyInterface ( const btSoftBody *const   softBody  ) 

Definition at line 1754 of file btSoftBodySolver_OpenCL.cpp.

virtual size_t btOpenCLSoftBodySolver::getDefaultWorkGroupSize (  )  const [inline, virtual]

Definition at line 492 of file btSoftBodySolver_OpenCL.h.

btSoftBodyLinkData & btOpenCLSoftBodySolver::getLinkData (  )  [virtual]

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 899 of file btSoftBodySolver_OpenCL.cpp.

virtual SolverTypes btOpenCLSoftBodySolver::getSolverType (  )  const [inline, virtual]

Return the type of the solver.

Implements btSoftBodySolver.

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 466 of file btSoftBodySolver_OpenCL.h.

btSoftBodyTriangleData & btOpenCLSoftBodySolver::getTriangleData (  )  [virtual]

Definition at line 911 of file btSoftBodySolver_OpenCL.cpp.

btSoftBodyVertexData & btOpenCLSoftBodySolver::getVertexData (  )  [virtual]

Definition at line 905 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::integrate ( float  solverdt  )  [protected, virtual]

Integrate motion on the solver.

Definition at line 1093 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::normalizeNormalsAndAreas ( int  numVertices  )  [protected]

Definition at line 937 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::optimize ( btAlignedObjectArray< btSoftBody * > &  softBodies,
bool  forceUpdate = false 
) [virtual]

Optimize soft bodies in this solver.

Implements btSoftBodySolver.

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 711 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::predictMotion ( float  solverdt  )  [virtual]

Predict motion of soft bodies into next timestep.

Implements btSoftBodySolver.

Definition at line 1638 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::prepareCollisionConstraints (  )  [protected]

Sort the collision object details array and generate indexing into it for the per-cloth collision object array.

Definition at line 1188 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::prepareLinks (  )  [protected]

Definition at line 1308 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::processCollision ( btSoftBody softBody,
const btCollisionObjectWrapper collisionObject 
) [virtual]

Definition at line 1710 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::processCollision ( btSoftBody ,
btSoftBody  
) [virtual]

Process a collision between two soft bodies.

Implements btSoftBodySolver.

Definition at line 1704 of file btSoftBodySolver_OpenCL.cpp.

Vectormath::Aos::Vector3 btOpenCLSoftBodySolver::ProjectOnAxis ( const Vectormath::Aos::Vector3 v,
const Vectormath::Aos::Vector3 a 
) [protected]

Definition at line 1008 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::releaseKernels (  )  [protected]

Definition at line 657 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::resetNormalsAndAreas ( int  numVertices  )  [protected]

Definition at line 917 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::setCLFunctions ( CLFunctions funcs  )  [inline]

Definition at line 497 of file btSoftBodySolver_OpenCL.h.

virtual void btOpenCLSoftBodySolver::setDefaultWorkgroupSize ( size_t  workGroupSize  )  [inline, virtual]

Definition at line 488 of file btSoftBodySolver_OpenCL.h.

void btOpenCLSoftBodySolver::solveCollisionsAndUpdateVelocities ( float  isolverdt  )  [protected, virtual]

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 1439 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::solveConstraints ( float  solverdt  )  [virtual]

Solve constraints for a set of soft bodies.

Implements btSoftBodySolver.

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 1234 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::solveLinksForPosition ( int  startLink,
int  numLinks,
float  kst,
float  ti 
) [protected, virtual]

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 1347 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::solveLinksForVelocity ( int  startLink,
int  numLinks,
float  kst 
) [protected]

Definition at line 1370 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::updateBounds (  )  [protected]

Definition at line 1133 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::updateConstants ( float  timeStep  )  [protected, virtual]

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 1144 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::updateFixedVertexPositions (  )  [protected]

Definition at line 1024 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::updatePositionsFromVelocities ( float  solverdt  )  [protected]

Definition at line 1328 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::updateSoftBodies (  )  [virtual]

Perform necessary per-step updates of soft bodies such as recomputing normals and bounding boxes.

Implements btSoftBodySolver.

Definition at line 978 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::updateVelocitiesFromPositionsWithoutVelocities ( float  isolverdt  )  [protected]

Definition at line 1415 of file btSoftBodySolver_OpenCL.cpp.

void btOpenCLSoftBodySolver::updateVelocitiesFromPositionsWithVelocities ( float  isolverdt  )  [protected]

Definition at line 1391 of file btSoftBodySolver_OpenCL.cpp.


Member Data Documentation

Definition at line 375 of file btSoftBodySolver_OpenCL.h.

Definition at line 366 of file btSoftBodySolver_OpenCL.h.

Definition at line 363 of file btSoftBodySolver_OpenCL.h.

Definition at line 364 of file btSoftBodySolver_OpenCL.h.

Definition at line 386 of file btSoftBodySolver_OpenCL.h.

Definition at line 369 of file btSoftBodySolver_OpenCL.h.

Definition at line 367 of file btSoftBodySolver_OpenCL.h.

Definition at line 365 of file btSoftBodySolver_OpenCL.h.

Definition at line 346 of file btSoftBodySolver_OpenCL.h.

Definition at line 308 of file btSoftBodySolver_OpenCL.h.

Definition at line 340 of file btSoftBodySolver_OpenCL.h.

Definition at line 318 of file btSoftBodySolver_OpenCL.h.

Definition at line 330 of file btSoftBodySolver_OpenCL.h.

Definition at line 354 of file btSoftBodySolver_OpenCL.h.

Definition at line 326 of file btSoftBodySolver_OpenCL.h.

Definition at line 334 of file btSoftBodySolver_OpenCL.h.

Definition at line 322 of file btSoftBodySolver_OpenCL.h.

Definition at line 314 of file btSoftBodySolver_OpenCL.h.

Collision shapes being passed across to the cloths in this solver.

Definition at line 345 of file btSoftBodySolver_OpenCL.h.

Definition at line 389 of file btSoftBodySolver_OpenCL.h.

Definition at line 291 of file btSoftBodySolver_OpenCL.h.

Definition at line 390 of file btSoftBodySolver_OpenCL.h.

Definition at line 290 of file btSoftBodySolver_OpenCL.h.

Definition at line 392 of file btSoftBodySolver_OpenCL.h.

Definition at line 374 of file btSoftBodySolver_OpenCL.h.

Reimplemented in btOpenCLSoftBodySolverSIMDAware.

Definition at line 284 of file btSoftBodySolver_OpenCL.h.

Definition at line 382 of file btSoftBodySolver_OpenCL.h.

Definition at line 385 of file btSoftBodySolver_OpenCL.h.

Acceleration value to be applied to all non-static vertices in the solver.

Index n is cloth n, array sized by number of cloths in the world not the solver.

Definition at line 307 of file btSoftBodySolver_OpenCL.h.

Collision shape details: pair of index of first collision shape for the cloth and number of collision objects.

Definition at line 339 of file btSoftBodySolver_OpenCL.h.

Velocity damping factor.

Definition at line 317 of file btSoftBodySolver_OpenCL.h.

Drag parameter for wind effect on cloth.

Definition at line 329 of file btSoftBodySolver_OpenCL.h.

Friction coefficient for each cloth.

Definition at line 353 of file btSoftBodySolver_OpenCL.h.

Lift parameter for wind effect on cloth.

Definition at line 325 of file btSoftBodySolver_OpenCL.h.

Density of the medium in which each cloth sits.

Definition at line 333 of file btSoftBodySolver_OpenCL.h.

Velocity correction coefficient.

Definition at line 321 of file btSoftBodySolver_OpenCL.h.

Wind velocity to be applied normal to all non-static vertices in the solver.

Index n is cloth n, array sized by number of cloths in the world not the solver.

Definition at line 313 of file btSoftBodySolver_OpenCL.h.

Definition at line 371 of file btSoftBodySolver_OpenCL.h.

Definition at line 381 of file btSoftBodySolver_OpenCL.h.

Definition at line 296 of file btSoftBodySolver_OpenCL.h.

Cloths owned by this solver.

Only our cloths are in this array.

Definition at line 302 of file btSoftBodySolver_OpenCL.h.

Definition at line 380 of file btSoftBodySolver_OpenCL.h.

Definition at line 372 of file btSoftBodySolver_OpenCL.h.

Definition at line 286 of file btSoftBodySolver_OpenCL.h.

Definition at line 373 of file btSoftBodySolver_OpenCL.h.

Definition at line 387 of file btSoftBodySolver_OpenCL.h.

Definition at line 376 of file btSoftBodySolver_OpenCL.h.

Definition at line 383 of file btSoftBodySolver_OpenCL.h.

Variable to define whether we need to update solver constants on the next iteration.

Definition at line 294 of file btSoftBodySolver_OpenCL.h.

Definition at line 377 of file btSoftBodySolver_OpenCL.h.

Definition at line 378 of file btSoftBodySolver_OpenCL.h.

Definition at line 285 of file btSoftBodySolver_OpenCL.h.

Definition at line 379 of file btSoftBodySolver_OpenCL.h.


The documentation for this class was generated from the following files: