Bullet Collision Detection & Physics Library
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btDX11SIMDAwareSoftBodySolver Class Reference

#include <btSoftBodySolver_DX11SIMDAware.h>

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

Classes

struct  SolvePositionsFromLinksKernelCB
 

Public Member Functions

 btDX11SIMDAwareSoftBodySolver (ID3D11Device *dx11Device, ID3D11DeviceContext *dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory=&D3DX11CompileFromMemory)
 
virtual ~btDX11SIMDAwareSoftBodySolver ()
 
virtual btSoftBodyLinkDatagetLinkData ()
 
virtual void optimize (btAlignedObjectArray< btSoftBody * > &softBodies, bool forceUpdate=false)
 Optimize soft bodies in this solver. More...
 
virtual void solveConstraints (float solverdt)
 Solve constraints for a set of soft bodies. More...
 
virtual SolverTypes getSolverType () const
 Return the type of the solver. More...
 
- Public Member Functions inherited from btDX11SoftBodySolver
 btDX11SoftBodySolver (ID3D11Device *dx11Device, ID3D11DeviceContext *dx11Context, DXFunctions::CompileFromMemoryFunc dx11CompileFromMemory=&D3DX11CompileFromMemory)
 
virtual ~btDX11SoftBodySolver ()
 
void setEnableUpdateBounds (bool enableBounds)
 
bool getEnableUpdateBounds () const
 
virtual btSoftBodyVertexDatagetVertexData ()
 
virtual btSoftBodyTriangleDatagetTriangleData ()
 
btAcceleratedSoftBodyInterfacefindSoftBodyInterface (const btSoftBody *const softBody)
 
const
btAcceleratedSoftBodyInterface
*const 
findSoftBodyInterface (const btSoftBody *const softBody) const
 
virtual bool checkInitialized ()
 Ensure that this solver is initialized. More...
 
virtual void updateSoftBodies ()
 Perform necessary per-step updates of soft bodies such as recomputing normals and bounding boxes. More...
 
virtual void copyBackToSoftBodies (bool bMove=true)
 Copy necessary data back to the original soft body source objects. More...
 
virtual void predictMotion (float solverdt)
 Predict motion of soft bodies into next timestep. More...
 
virtual void processCollision (btSoftBody *, const btCollisionObjectWrapper *)
 
virtual void processCollision (btSoftBody *, btSoftBody *)
 Process a collision between two soft bodies. More...
 
- Public Member Functions inherited from btSoftBodySolver
 btSoftBodySolver ()
 
virtual ~btSoftBodySolver ()
 
virtual void processCollision (btSoftBody *, const struct btCollisionObjectWrapper *)=0
 Process a collision between one of the world's soft bodies and another collision object. More...
 
virtual void setNumberOfPositionIterations (int iterations)
 Set the number of velocity constraint solver iterations this solver uses. More...
 
virtual int getNumberOfPositionIterations ()
 Get the number of velocity constraint solver iterations this solver uses. More...
 
virtual void setNumberOfVelocityIterations (int iterations)
 Set the number of velocity constraint solver iterations this solver uses. More...
 
virtual int getNumberOfVelocityIterations ()
 Get the number of velocity constraint solver iterations this solver uses. More...
 
float getTimeScale ()
 Return the timescale that the simulation is using. More...
 

Protected Member Functions

virtual bool buildShaders ()
 
void updateConstants (float timeStep)
 
void solveLinksForPosition (int startLink, int numLinks, float kst, float ti)
 
- Protected Member Functions inherited from btDX11SoftBodySolver
virtual void integrate (float solverdt)
 Integrate motion on the solver. More...
 
float computeTriangleArea (const Vectormath::Aos::Point3 &vertex0, const Vectormath::Aos::Point3 &vertex1, const Vectormath::Aos::Point3 &vertex2)
 
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. More...
 
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)
 
virtual void applyForces (float solverdt)
 
int findSoftBodyIndex (const btSoftBody *const softBody)
 
virtual void prepareLinks ()
 
void updatePositionsFromVelocities (float solverdt)
 
void solveLinksForPosition (int startLink, int numLinks, float kst, float ti)
 
void solveLinksForVelocity (int startLink, int numLinks, float kst)
 
void updateVelocitiesFromPositionsWithVelocities (float isolverdt)
 
void updateVelocitiesFromPositionsWithoutVelocities (float isolverdt)
 
void computeBounds ()
 
void solveCollisionsAndUpdateVelocities (float isolverdt)
 
void updateBounds ()
 
void releaseKernels ()
 

Protected Attributes

btSoftBodyLinkDataDX11SIMDAware m_linkData
 Link data for all cloths. More...
 
bool m_updateSolverConstants
 Variable to define whether we need to update solver constants on the next iteration. More...
 
- Protected Attributes inherited from btDX11SoftBodySolver
ID3D11Device * m_dx11Device
 
ID3D11DeviceContext * m_dx11Context
 
DXFunctions dxFunctions
 
bool m_updateSolverConstants
 Variable to define whether we need to update solver constants on the next iteration. More...
 
bool m_shadersInitialized
 
btAlignedObjectArray
< btAcceleratedSoftBodyInterface * > 
m_softBodySet
 Cloths owned by this solver. More...
 
btAlignedObjectArray
< Vectormath::Aos::Vector3
m_perClothAcceleration
 Acceleration value to be applied to all non-static vertices in the solver. More...
 
btDX11Buffer
< Vectormath::Aos::Vector3
m_dx11PerClothAcceleration
 
btAlignedObjectArray
< Vectormath::Aos::Vector3
m_perClothWindVelocity
 Wind velocity to be applied normal to all non-static vertices in the solver. More...
 
btDX11Buffer
< Vectormath::Aos::Vector3
m_dx11PerClothWindVelocity
 
btAlignedObjectArray< float > m_perClothDampingFactor
 Velocity damping factor. More...
 
btDX11Buffer< float > m_dx11PerClothDampingFactor
 
btAlignedObjectArray< float > m_perClothVelocityCorrectionCoefficient
 Velocity correction coefficient. More...
 
btDX11Buffer< float > m_dx11PerClothVelocityCorrectionCoefficient
 
btAlignedObjectArray< float > m_perClothLiftFactor
 Lift parameter for wind effect on cloth. More...
 
btDX11Buffer< float > m_dx11PerClothLiftFactor
 
btAlignedObjectArray< float > m_perClothDragFactor
 Drag parameter for wind effect on cloth. More...
 
btDX11Buffer< float > m_dx11PerClothDragFactor
 
btAlignedObjectArray< float > m_perClothMediumDensity
 Density of the medium in which each cloth sits. More...
 
btDX11Buffer< float > m_dx11PerClothMediumDensity
 
btAlignedObjectArray
< CollisionObjectIndices
m_perClothCollisionObjects
 Collision shape details: pair of index of first collision shape for the cloth and number of collision objects. More...
 
btDX11Buffer
< CollisionObjectIndices
m_dx11PerClothCollisionObjects
 
btAlignedObjectArray
< CollisionShapeDescription
m_collisionObjectDetails
 Collision shapes being passed across to the cloths in this solver. More...
 
btDX11Buffer
< CollisionShapeDescription
m_dx11CollisionObjectDetails
 
btAlignedObjectArray< UIntVector3m_perClothMinBounds
 Minimum bounds for each cloth. More...
 
btDX11Buffer< UIntVector3m_dx11PerClothMinBounds
 
btAlignedObjectArray< UIntVector3m_perClothMaxBounds
 Maximum bounds for each cloth. More...
 
btDX11Buffer< UIntVector3m_dx11PerClothMaxBounds
 
btAlignedObjectArray< float > m_perClothFriction
 Friction coefficient for each cloth. More...
 
btDX11Buffer< float > m_dx11PerClothFriction
 
DXFunctions::KernelDesc prepareLinksKernel
 
DXFunctions::KernelDesc solvePositionsFromLinksKernel
 
DXFunctions::KernelDesc vSolveLinksKernel
 
DXFunctions::KernelDesc integrateKernel
 
DXFunctions::KernelDesc addVelocityKernel
 
DXFunctions::KernelDesc updatePositionsFromVelocitiesKernel
 
DXFunctions::KernelDesc updateVelocitiesFromPositionsWithoutVelocitiesKernel
 
DXFunctions::KernelDesc updateVelocitiesFromPositionsWithVelocitiesKernel
 
DXFunctions::KernelDesc solveCollisionsAndUpdateVelocitiesKernel
 
DXFunctions::KernelDesc resetNormalsAndAreasKernel
 
DXFunctions::KernelDesc normalizeNormalsAndAreasKernel
 
DXFunctions::KernelDesc computeBoundsKernel
 
DXFunctions::KernelDesc updateSoftBodiesKernel
 
DXFunctions::KernelDesc applyForcesKernel
 
bool m_enableUpdateBounds
 
- Protected Attributes inherited from btSoftBodySolver
int m_numberOfPositionIterations
 
int m_numberOfVelocityIterations
 
float m_timeScale
 

Additional Inherited Members

- Public Types inherited from btSoftBodySolver
enum  SolverTypes {
  DEFAULT_SOLVER,
  CPU_SOLVER,
  CL_SOLVER,
  CL_SIMD_SOLVER,
  DX_SOLVER,
  DX_SIMD_SOLVER
}
 
- Public Attributes inherited from btDX11SoftBodySolver
btSoftBodyLinkDataDX11 m_linkData
 Link data for all cloths. More...
 
btSoftBodyVertexDataDX11 m_vertexData
 
btSoftBodyTriangleDataDX11 m_triangleData
 

Detailed Description

Definition at line 27 of file btSoftBodySolver_DX11SIMDAware.h.

Constructor & Destructor Documentation

btDX11SIMDAwareSoftBodySolver::btDX11SIMDAwareSoftBodySolver ( ID3D11Device *  dx11Device,
ID3D11DeviceContext *  dx11Context,
DXFunctions::CompileFromMemoryFunc  dx11CompileFromMemory = &D3DX11CompileFromMemory 
)

Definition at line 176 of file btSoftBodySolver_DX11SIMDAware.cpp.

btDX11SIMDAwareSoftBodySolver::~btDX11SIMDAwareSoftBodySolver ( )
virtual

Definition at line 188 of file btSoftBodySolver_DX11SIMDAware.cpp.

Member Function Documentation

bool btDX11SIMDAwareSoftBodySolver::buildShaders ( )
protectedvirtual

Reimplemented from btDX11SoftBodySolver.

Definition at line 485 of file btSoftBodySolver_DX11SIMDAware.cpp.

btSoftBodyLinkData & btDX11SIMDAwareSoftBodySolver::getLinkData ( )
virtual

Reimplemented from btDX11SoftBodySolver.

Definition at line 194 of file btSoftBodySolver_DX11SIMDAware.cpp.

virtual SolverTypes btDX11SIMDAwareSoftBodySolver::getSolverType ( ) const
inlinevirtual

Return the type of the solver.

Reimplemented from btDX11SoftBodySolver.

Definition at line 73 of file btSoftBodySolver_DX11SIMDAware.h.

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

Optimize soft bodies in this solver.

Reimplemented from btDX11SoftBodySolver.

Definition at line 202 of file btSoftBodySolver_DX11SIMDAware.cpp.

void btDX11SIMDAwareSoftBodySolver::solveConstraints ( float  solverdt)
virtual

Solve constraints for a set of soft bodies.

Reimplemented from btDX11SoftBodySolver.

Definition at line 329 of file btSoftBodySolver_DX11SIMDAware.cpp.

void btDX11SIMDAwareSoftBodySolver::solveLinksForPosition ( int  startLink,
int  numLinks,
float  kst,
float  ti 
)
protected

Definition at line 415 of file btSoftBodySolver_DX11SIMDAware.cpp.

void btDX11SIMDAwareSoftBodySolver::updateConstants ( float  timeStep)
protectedvirtual

Reimplemented from btDX11SoftBodySolver.

Definition at line 383 of file btSoftBodySolver_DX11SIMDAware.cpp.

Member Data Documentation

btSoftBodyLinkDataDX11SIMDAware btDX11SIMDAwareSoftBodySolver::m_linkData
protected

Link data for all cloths.

Note that this will be sorted batch-wise for efficient computation and m_linkAddresses will maintain the addressing.

Definition at line 40 of file btSoftBodySolver_DX11SIMDAware.h.

bool btDX11SIMDAwareSoftBodySolver::m_updateSolverConstants
protected

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

Definition at line 43 of file btSoftBodySolver_DX11SIMDAware.h.


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