added helper function GeometryBatcher::addTexturedStripStrided for array of m2::PointD points.

This commit is contained in:
rachytski 2013-01-15 12:35:11 +03:00 committed by Alex Zolotarev
parent 178f6fa4fa
commit b26e2d91ea
2 changed files with 41 additions and 0 deletions

View file

@ -510,6 +510,37 @@ namespace graphics
addTriangleStrip(&vs, size, pipelineID);
}
void GeometryBatcher::addTexturedStripStrided(
m2::PointD const * coords,
size_t coordsStride,
m2::PointF const * normals,
size_t normalsStride,
m2::PointF const * texCoords,
size_t texCoordsStride,
unsigned size,
double depth,
int pipelineID)
{
VertexStream vs;
vs.m_dPos.m_x = (double*)(coords);
vs.m_dPos.m_xStride = coordsStride;
vs.m_dPos.m_y = (double*)(coords) + 1;
vs.m_dPos.m_yStride = coordsStride;
vs.m_dPos.m_z = (double*)(&depth);
vs.m_dPos.m_zStride = 0;
vs.m_fNormal.m_x = (float*)(normals);
vs.m_fNormal.m_xStride = normalsStride;
vs.m_fNormal.m_y = (float*)(normals) + 1;
vs.m_fNormal.m_yStride = normalsStride;
vs.m_fTex.m_u = (float*)(texCoords);
vs.m_fTex.m_uStride = texCoordsStride;
vs.m_fTex.m_v = (float*)(texCoords) + 1;
vs.m_fTex.m_vStride = texCoordsStride;
addTriangleStrip(&vs, size, pipelineID);
}
void GeometryBatcher::addTexturedListStrided(
m2::PointD const * coords,
size_t coordsStride,

View file

@ -141,6 +141,16 @@ namespace graphics
double depth,
int pipelineID);
void addTexturedStripStrided(m2::PointD const * coords,
size_t coordsStride,
m2::PointF const * normals,
size_t normalsStride,
m2::PointF const * texCoords,
size_t texCoordsStride,
unsigned size,
double depth,
int pipelineID);
void addTexturedList(m2::PointF const * coords,
m2::PointF const * texCoords,
m2::PointF const * normalCoords,