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

#include <btSoftBodySolverTriangleData_OpenCL.h>

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

Classes

struct  btSomePair
 Start and length values for computation batches over link data. More...
 

Public Member Functions

 btSoftBodyTriangleDataOpenCL (cl_command_queue queue, cl_context ctx)
 
virtual ~btSoftBodyTriangleDataOpenCL ()
 
virtual void createTriangles (int numTriangles)
 Allocate enough space in all link-related arrays to fit numLinks links. More...
 
virtual void setTriangleAt (const btSoftBodyTriangleData::TriangleDescription &triangle, int triangleIndex)
 Insert the link described into the correct data structures assuming space has already been allocated by a call to createLinks. More...
 
virtual bool onAccelerator ()
 Return true if data is on the accelerator. More...
 
virtual bool moveToAccelerator ()
 Move data from host memory to the accelerator. More...
 
virtual bool moveFromAccelerator ()
 Move data from host memory from the accelerator. More...
 
void generateBatches ()
 Generate (and later update) the batching for the entire triangle set. More...
 
- Public Member Functions inherited from btSoftBodyTriangleData
 btSoftBodyTriangleData ()
 
virtual ~btSoftBodyTriangleData ()
 
virtual void clear ()
 
int getNumTriangles ()
 
const TriangleNodeSetgetVertexSet (int triangleIndex)
 Return the vertex index set for triangle triangleIndex as stored on the host. More...
 
float & getTriangleArea (int triangleIndex)
 Get access to the triangle area. More...
 
Vectormath::Aos::Vector3getNormal (int triangleIndex)
 Get access to the normal vector for this triangle. More...
 

Public Attributes

bool m_onGPU
 
cl_command_queue m_queue
 
btOpenCLBuffer
< btSoftBodyTriangleData::TriangleNodeSet
m_clVertexIndices
 
btOpenCLBuffer< float > m_clArea
 
btOpenCLBuffer
< Vectormath::Aos::Vector3
m_clNormal
 
btAlignedObjectArray< int > m_triangleAddresses
 Link addressing information for each cloth. More...
 
btAlignedObjectArray< btSomePairm_batchStartLengths
 

Additional Inherited Members

- Protected Attributes inherited from btSoftBodyTriangleData
btAlignedObjectArray
< TriangleNodeSet
m_vertexIndices
 
btAlignedObjectArray< float > m_area
 
btAlignedObjectArray
< Vectormath::Aos::Vector3
m_normal
 

Detailed Description

Definition at line 25 of file btSoftBodySolverTriangleData_OpenCL.h.

Constructor & Destructor Documentation

btSoftBodyTriangleDataOpenCL::btSoftBodyTriangleDataOpenCL ( cl_command_queue  queue,
cl_context  ctx 
)

Definition at line 392 of file btSoftBodySolver_OpenCL.cpp.

btSoftBodyTriangleDataOpenCL::~btSoftBodyTriangleDataOpenCL ( )
virtual

Definition at line 400 of file btSoftBodySolver_OpenCL.cpp.

Member Function Documentation

void btSoftBodyTriangleDataOpenCL::createTriangles ( int  numTriangles)
virtual

Allocate enough space in all link-related arrays to fit numLinks links.

Reimplemented from btSoftBodyTriangleData.

Definition at line 405 of file btSoftBodySolver_OpenCL.cpp.

void btSoftBodyTriangleDataOpenCL::generateBatches ( )

Generate (and later update) the batching for the entire triangle set.

This redoes a lot of work because it batches the entire set when each cloth is inserted. In theory we could delay it until just before we need the cloth. It's a one-off overhead, though, so that is a later optimisation.

Definition at line 461 of file btSoftBodySolver_OpenCL.cpp.

bool btSoftBodyTriangleDataOpenCL::moveFromAccelerator ( )
virtual

Move data from host memory from the accelerator.

The CPU version will always return that it has moved it.

Reimplemented from btSoftBodyTriangleData.

Definition at line 442 of file btSoftBodySolver_OpenCL.cpp.

bool btSoftBodyTriangleDataOpenCL::moveToAccelerator ( )
virtual

Move data from host memory to the accelerator.

The CPU version will always return that it has moved it.

Reimplemented from btSoftBodyTriangleData.

Definition at line 429 of file btSoftBodySolver_OpenCL.cpp.

bool btSoftBodyTriangleDataOpenCL::onAccelerator ( )
virtual

Return true if data is on the accelerator.

The CPU version of this class will return true here because the CPU is the same as the accelerator.

Reimplemented from btSoftBodyTriangleData.

Definition at line 424 of file btSoftBodySolver_OpenCL.cpp.

void btSoftBodyTriangleDataOpenCL::setTriangleAt ( const btSoftBodyTriangleData::TriangleDescription triangle,
int  triangleIndex 
)
virtual

Insert the link described into the correct data structures assuming space has already been allocated by a call to createLinks.

Reimplemented from btSoftBodyTriangleData.

Definition at line 417 of file btSoftBodySolver_OpenCL.cpp.

Member Data Documentation

btAlignedObjectArray< btSomePair > btSoftBodyTriangleDataOpenCL::m_batchStartLengths

Definition at line 54 of file btSoftBodySolverTriangleData_OpenCL.h.

btOpenCLBuffer<float> btSoftBodyTriangleDataOpenCL::m_clArea

Definition at line 32 of file btSoftBodySolverTriangleData_OpenCL.h.

btOpenCLBuffer<Vectormath::Aos::Vector3> btSoftBodyTriangleDataOpenCL::m_clNormal

Definition at line 33 of file btSoftBodySolverTriangleData_OpenCL.h.

btOpenCLBuffer<btSoftBodyTriangleData::TriangleNodeSet> btSoftBodyTriangleDataOpenCL::m_clVertexIndices

Definition at line 31 of file btSoftBodySolverTriangleData_OpenCL.h.

bool btSoftBodyTriangleDataOpenCL::m_onGPU

Definition at line 28 of file btSoftBodySolverTriangleData_OpenCL.h.

cl_command_queue btSoftBodyTriangleDataOpenCL::m_queue

Definition at line 29 of file btSoftBodySolverTriangleData_OpenCL.h.

btAlignedObjectArray< int > btSoftBodyTriangleDataOpenCL::m_triangleAddresses

Link addressing information for each cloth.

Allows link locations to be computed independently of data batching.

Definition at line 39 of file btSoftBodySolverTriangleData_OpenCL.h.


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