37 m_triangleVertices = NULL;
38 m_triangleNormals = NULL;
40 m_triangleVerticesConstData = NULL;
41 m_triangleMapsConstData = NULL;
61 m_triangleVerticesConstData = NULL;
62 m_triangleMapsConstData = NULL;
69 if (
this == &original_obj) {
81 m_materialId = material_id;
96 m_triangleVertices = triangles_vertices;
105 m_triangleNormals = triangles_normals;
114 m_textCoords = triangles_texture_coords;
120 return m_triangleVertices;
126 if(m_triangleVerticesConstData) {
127 return m_triangleVerticesConstData;
130 int count = m_triangleVertices->
size() * 3;
131 unsigned int index = 0;
132 m_triangleVerticesConstData =
new float[count];
134 for (
unsigned int i = 0; i < m_triangleVertices->
size(); i++) {
136 (*vec) *= k_QGLGameEditorViewport_SizeFactor;
137 m_triangleVerticesConstData[index++] = vec->x();
138 m_triangleVerticesConstData[index++] = vec->y();
139 m_triangleVerticesConstData[index++] = vec->z();
142 return m_triangleVerticesConstData;
148 return m_triangleNormals;
164 if(m_triangleMapsConstData) {
165 return m_triangleMapsConstData;
168 int count = m_textCoords->
size() * 2;
169 unsigned int index = 0;
170 m_triangleMapsConstData =
new float[count];
172 for (
unsigned int i = 0; i < m_textCoords->
size(); i++) {
173 m_triangleMapsConstData[index++] = m_textCoords->
objectAtIndex(i).
s;
174 m_triangleMapsConstData[index++] = 1 - m_textCoords->
objectAtIndex(i).
t;
177 return m_triangleMapsConstData;
CLPolygon & operator=(const CLPolygon &polygon)
void setTriangleMaps(CArray< TextureCoord > *maps)
float * getTriangleMapsConstData()
CArray< TextureCoord > * getTriangleMaps() const
CArray< btVector3 > * getTriangleVertices() const
CArray< btVector3 > * getTriangleNormals() const
virtual void copyValuesFromObject(const CLPolygon &polygon)
float * getTriangleVerticesConstData()
T objectAtIndex(unsigned int index) const
void setMaterialId(const std::string &material_id)
#define SAFE_RELEASE_ARRAY(x)
void setTriangleNormals(CArray< btVector3 > *normals)
const std::string & getMaterialId() const
unsigned int size() const
void setTriangleVertices(CArray< btVector3 > *vertices)