57 class cCollisionRecorder;
58 struct cCollisionSettings;
152 static cPointArrayPtr
create(
cVertexArrayPtr a_vertexArray) {
return (std::make_shared<cPointArray>(a_vertexArray)); }
165 cPointArrayPtr
copy();
251 const unsigned int a_vertexIndex)
288 const unsigned int a_vertexNumber)
const 290 switch (a_vertexNumber)
292 case 0 :
return (
m_indices[a_elementIndex]);
321 texCoord.
set(0.0, 0.0, 0.0);
351 glBufferData(GL_ELEMENT_ARRAY_BUFFER, numPoints *
sizeof(
unsigned int), &(
m_indices[0]), GL_STATIC_DRAW);
359 glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, numPoints *
sizeof(
unsigned int), &(
m_indices[0]));
367 glEnableClientState(GL_VERTEX_ARRAY);
369 glDrawElements(GL_POINTS, numPoints, GL_UNSIGNED_INT, (
void*)0);
370 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
This class implements a 3D vector.
Definition: CVector3d.h:88
unsigned int getVertexIndex0(const unsigned int a_pointIndex) const
Definition: CPointArray.h:269
std::shared_ptr< cPointArray > cPointArrayPtr
Definition: CPointArray.h:71
virtual unsigned int getNumVerticesPerElement()
This method returns the number of vertices that compose a point.
Definition: CPointArray.h:162
Implements an abstract class for describing elements composed of vertices.
This class implements an array of 3D points.
Definition: CPointArray.h:105
std::vector< unsigned int > m_indices
Element indices to vertices.
Definition: CGenericArray.h:230
std::vector< bool > m_allocated
Element allocation flags.
Definition: CGenericArray.h:233
cPointArray(cVertexArrayPtr a_vertexArray)
Definition: CPointArray.h:120
std::list< unsigned int > m_freeElements
List of free elements.
Definition: CGenericArray.h:259
cPointArrayPtr copy()
This method copies point data and return new point array.
Definition: CPointArray.cpp:212
void clear()
This method clears all points from the array.
Definition: CPointArray.h:142
void set(const double &a_x, const double &a_y, const double &a_z)
This method initializes this vector with components x, y, and z passed as arguments.
Definition: CVector3d.h:298
This class implements a base class for all 2D or 3D objects in CHAI3D.
Definition: CGenericObject.h:112
This class implements a collision detection recorder that stores all collision events that are report...
Definition: CCollisionBasics.h:185
bool m_flagMarkForUpdate
If true then element data has been modified.
Definition: CGenericArray.h:236
void setVertex(const unsigned int a_pointIndex, const unsigned int a_vertexIndex)
Definition: CPointArray.h:250
This structure stores the collision settings that are passed to a collision detector when querying fo...
Definition: CCollisionBasics.h:242
virtual unsigned int getNumElements()
This method returns the number of allocated elements.
Definition: CGenericArray.h:145
GLuint m_elementBuffer
OpenGL Buffer for storing elements.
Definition: CGenericArray.h:249
cVector3d getTexCoordAtPosition(const unsigned int a_pointIndex, const cVector3d &a_localPos)
Definition: CPointArray.h:310
std::shared_ptr< cVertexArray > cVertexArrayPtr
Definition: CVertexArray.h:107
void compress()
This method compresses the array by removing non used points.
Definition: CPointArray.cpp:248
void render()
Definition: CPointArray.h:334
~cPointArray()
Definition: CPointArray.h:138
int newPoint(const unsigned int a_vertexIndex0)
Definition: CPointArray.h:180
static cPointArrayPtr create(cVertexArrayPtr a_vertexArray)
Shared cPointArray allocator.
Definition: CPointArray.h:152
Definition: CAudioBuffer.cpp:56
virtual bool computeCollision(const unsigned int a_elementIndex, cGenericObject *a_object, cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings) const
This method checks if a given line segment intersects a selected point from this array.
Definition: CPointArray.cpp:73
This class implements an abstract class for describing geometrical elements composed of vertices...
Definition: CGenericArray.h:90
virtual unsigned int getVertexIndex(const unsigned int a_elementIndex, const unsigned int a_vertexNumber) const
Definition: CPointArray.h:287
bool m_flagMarkForResize
If true then element array size has changed.
Definition: CGenericArray.h:239
void removePoint(const unsigned int a_pointIndex)
Definition: CPointArray.h:221
cVertexArrayPtr m_vertices
Vertex array that contains all vertices used to describe the elements of this array.
Definition: CGenericArray.h:227