本文整理汇总了C++中LLStrider::setCount方法的典型用法代码示例。如果您正苦于以下问题:C++ LLStrider::setCount方法的具体用法?C++ LLStrider::setCount怎么用?C++ LLStrider::setCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLStrider
的用法示例。
在下文中一共展示了LLStrider::setCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPreviewTarget
void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
{
mCameraDistance = distance;
mCameraZoom = 1.f;
mCameraPitch = 0.f;
mCameraYaw = 0.f;
mCameraOffset.clearVec();
if (imagep)
{
mVolume->sculpt(imagep->getWidth(), imagep->getHeight(), imagep->getComponents(), imagep->getData(), 0);
}
const LLVolumeFace &vf = mVolume->getVolumeFace(0);
U32 num_indices = vf.mNumIndices;
U32 num_vertices = vf.mNumVertices;
mVertexBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0, 0);
mVertexBuffer->allocateBuffer(num_vertices, num_indices, TRUE);
LLStrider<LLVector3> vertex_strider;
LLStrider<LLVector3> normal_strider;
LLStrider<LLVector2> tc_strider;
LLStrider<U16> index_strider;
mVertexBuffer->getVertexStrider(vertex_strider);
mVertexBuffer->getNormalStrider(normal_strider);
mVertexBuffer->getTexCoord0Strider(tc_strider);
mVertexBuffer->getIndexStrider(index_strider);
// build vertices and normals
LLStrider<LLVector3> pos;
pos = (LLVector3*) vf.mPositions;
pos.setStride(16);
LLStrider<LLVector3> norm;
norm = (LLVector3*) vf.mNormals;
norm.setStride(16);
LLStrider<LLVector2> tc;
tc = (LLVector2*) vf.mTexCoords;
tc.setStride(8);
#ifdef OPENSIM // <FS:ND> protect against buffer overflows
pos.setCount( vf.mNumVertices );
norm.setCount( vf.mNumVertices );
tc.setCount( vf.mNumVertices );
#endif // </FS:ND>
for (U32 i = 0; i < num_vertices; i++)
{
*(vertex_strider++) = *pos++;
LLVector3 normal = *norm++;
normal.normalize();
*(normal_strider++) = normal;
*(tc_strider++) = *tc++;
}
// build indices
for (U16 i = 0; i < num_indices; i++)
{
*(index_strider++) = vf.mIndices[i];
}
}