16 #ifndef BT_SOFT_BODY_SOLVER_DATA_H
17 #define BT_SOFT_BODY_SOLVER_DATA_H
174 int newSize = previousSize + numLinks;
445 if( maxVertices == 0 )
446 maxVertices = numVertices;
447 int newSize = previousSize + maxVertices;
460 for(
int vertexIndex = previousSize; vertexIndex < newSize; ++vertexIndex )
462 for(
int vertexIndex = (previousSize + numVertices); vertexIndex < newSize; ++vertexIndex )
685 int newSize = previousSize + numTriangles;
706 return m_area[triangleIndex];
747 #endif // #ifndef BT_SOFT_BODY_SOLVER_DATA_H
virtual void setTriangleAt(const TriangleDescription &triangle, int triangleIndex)
btAlignedObjectArray< Vectormath::Aos::Vector3 > m_vertexForceAccumulator
float m_linkLinearStiffness
void createVertices(int numVertices, int clothIdentifier, int maxVertices=0)
Create numVertices new vertices for cloth clothIdentifier maxVertices allows a buffer zone of extra v...
float getLinkLinearStiffness() const
float & getLinkLengthRatio(int linkIndex)
Return the link length ratio from for link linkIndex as stored on the host.
LinkNodePair(int v0, int v1)
int getClothIdentifier(int vertexIndex)
btAlignedObjectArray< Vectormath::Aos::Point3 > m_vertexPreviousPosition
virtual void createTriangles(int numTriangles)
Vectormath::Aos::Point3 getPosition() const
void setPosition(const Vectormath::Aos::Point3 &position)
virtual void setLinkAt(const LinkDescription &link, int linkIndex)
Insert the link described into the correct data structures assuming space has already been allocated ...
btAlignedObjectArray< Vectormath::Aos::Vector3 > m_normal
virtual float & getStrengthCorrected(int linkIndex)
Return a reference to the strength of the link corrected for link sorting.
btAlignedObjectArray< TriangleNodeSet > m_vertexIndices
virtual bool onAccelerator()
Return true if data is on the accelerator.
btAlignedObjectArray< Vectormath::Aos::Point3 > m_vertexPosition
virtual bool moveFromAccelerator(bool bCopy=false, bool bCopyMinimum=true)
Move data to host memory from the accelerator if bCopy is false.
float & getRestLengthSquared(int linkIndex)
Return reference to rest length squared for link linkIndex as stored on the host. ...
float getLinkStrength() const
VertexDescription(const Vectormath::Aos::Point3 &position, float mass)
Vectormath::Aos::Point3 m_position
int & getTriangleCount(int vertexIndex)
Get access to the array of how many triangles touch each vertex.
virtual bool moveToAccelerator()
Move data from host memory to the accelerator.
float & getLinearStiffnessCoefficient(int linkIndex)
Return reference to linear stiffness coefficient for link linkIndex as stored on the host...
LinkNodePair & getVertexPair(int linkIndex)
Return reference to the vertex index pair for link linkIndex as stored on the host.
virtual bool onAccelerator()
Return true if data is on the accelerator.
Class describing a vertex for input into the system.
btAlignedObjectArray< Vectormath::Aos::Vector3 > m_linksCLength
void setInverseMass(float inverseMass)
float & getStrength(int linkIndex)
Return reference to strength of link linkIndex as stored on the host.
btAlignedObjectArray< float > m_vertexArea
TriangleNodeSet getVertexSet() const
float getInverseMass() const
btAlignedObjectArray< float > m_linkStrength
float & getMassLSC(int linkIndex)
Return reference to the MassLSC value for link linkIndex as stored on the host.
Vectormath::Aos::Vector3 & getNormal(int triangleIndex)
Get access to the normal vector for this triangle.
int size() const
return the number of elements in the array
float m_inverseMass
Inverse mass.
TriangleNodeSet(int newVertex0, int newVertex1, int newVertex2)
btAlignedObjectArray< Vectormath::Aos::Point3 > & getVertexPositions()
btAlignedObjectArray< LinkNodePair > m_links
TriangleDescription(int newVertex0, int newVertex1, int newVertex2)
Class representing a link as a set of three indices into the vertex array.
LinkDescription(int newVertex0, int newVertex1, float linkLinearStiffness)
float & getArea(int vertexIndex)
Get access to the area controlled by this vertex.
virtual ~btSoftBodyTriangleData()
float & getTriangleArea(int triangleIndex)
Get access to the triangle area.
float & getRestLength(int linkIndex)
Return reference to the rest length of link linkIndex as stored on the host.
btAlignedObjectArray< float > m_linksRestLengthSquared
btAlignedObjectArray< float > m_linksLengthRatio
btAlignedObjectArray< Vectormath::Aos::Vector3 > m_vertexNormal
btAlignedObjectArray< float > m_linksMaterialLinearStiffnessCoefficient
virtual bool onAccelerator()
Return true if data is on the accelerator.
LinkNodePair getVertexPair() const
Vectormath::Aos::Vector3 getNormal(int vertexIndex) const
Class describing a link for input into the system.
Wrapper for vertex data information.
virtual bool moveFromAccelerator()
Move data from host memory from the accelerator.
Vectormath::Aos::Vector3 & getNormal(int vertexIndex)
Return a reference to the normal of vertex vertexIndex as stored on the host.
void resize(int newsize, const T &fillData=T())
void setVertex1(int vertex)
btAlignedObjectArray< float > m_linksMassLSC
float & getInverseMass(int vertexIndex)
Return a reference to the inverse mass of vertex vertexIndex as stored on the host.
Vectormath::Aos::Point3 & getPosition(int vertexIndex)
Return a reference to the position of vertex vertexIndex as stored on the host.
btAlignedObjectArray< float > m_area
btAlignedObjectArray< Vectormath::Aos::Vector3 > m_vertexVelocity
btAlignedObjectArray< int > m_clothIdentifier
Vectormath::Aos::Vector3 & getVelocity(int vertexIndex)
Return a reference to the velocity of vertex vertexIndex as stored on the host.
void setLinkLinearStiffness(float linearStiffness)
btAlignedObjectArray< int > m_vertexTriangleCount
btAlignedObjectArray< float > m_linksRestLength
Vectormath::Aos::Point3 & getPreviousPosition(int vertexIndex)
Return a reference to the previous position of vertex vertexIndex as stored on the host...
Vectormath::Aos::Vector3 & getForceAccumulator(int vertexIndex)
Return a reference to the force accumulator of vertex vertexIndex as stored on the host...
virtual ~btSoftBodyVertexData()
const TriangleNodeSet & getVertexSet(int triangleIndex)
Return the vertex index set for triangle triangleIndex as stored on the host.
void setLinkStrength(float strength)
Vectormath::Aos::Vector3 & getCurrentLength(int linkIndex)
Return reference to current length of link linkIndex as stored on the host.
virtual bool moveToAccelerator()
Move data from host memory to the accelerator.
virtual bool moveToAccelerator()
Move data from host memory to the accelerator.
void setVertexAt(const VertexDescription &vertex, int vertexIndex)
Vectormath::Aos::Point3 getPosition(int vertexIndex) const
btAlignedObjectArray< float > m_vertexInverseMass
Class representing a triangle as a set of three indices into the vertex array.
virtual bool moveFromAccelerator()
Move data from host memory from the accelerator.
virtual ~btSoftBodyLinkData()
void setVertex0(int vertex)
virtual void createLinks(int numLinks)
Allocate enough space in all link-related arrays to fit numLinks links.