本文整理汇总了C++中LLDrawable::isState方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDrawable::isState方法的具体用法?C++ LLDrawable::isState怎么用?C++ LLDrawable::isState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLDrawable
的用法示例。
在下文中一共展示了LLDrawable::isState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateRiggedFaceVertexBuffer
void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face)
{
LLVector4a* weight = vol_face.mWeights;
if (!weight)
{
return;
}
LLPointer<LLVertexBuffer> buffer = face->getVertexBuffer();
LLDrawable* drawable = face->getDrawable();
U32 data_mask = face->getRiggedVertexBufferDataMask();
if (buffer.isNull() ||
buffer->getTypeMask() != data_mask ||
buffer->getNumVerts() != vol_face.mNumVertices ||
buffer->getNumIndices() != vol_face.mNumIndices ||
(drawable && drawable->isState(LLDrawable::REBUILD_ALL)))
{
if (drawable && drawable->isState(LLDrawable::REBUILD_ALL))
{ //rebuild EVERY face in the drawable, not just this one, to avoid missing drawable wide rebuild issues
for (S32 i = 0; i < drawable->getNumFaces(); ++i)
{
LLFace* facep = drawable->getFace(i);
U32 face_data_mask = facep->getRiggedVertexBufferDataMask();
if (face_data_mask)
{
LLPointer<LLVertexBuffer> cur_buffer = facep->getVertexBuffer();
const LLVolumeFace& cur_vol_face = volume->getVolumeFace(i);
getRiggedGeometry(facep, cur_buffer, face_data_mask, skin, volume, cur_vol_face);
}
}
drawable->clearState(LLDrawable::REBUILD_ALL);
buffer = face->getVertexBuffer();
}
else
{ //just rebuild this face
getRiggedGeometry(face, buffer, data_mask, skin, volume, vol_face);
}
}
if (sShaderLevel <= 0 && face->mLastSkinTime < avatar->getLastSkinTime())
{
avatar->updateSoftwareSkinnedVertices(skin, weight, vol_face, buffer);
}
}
示例2: updateRiggedFaceVertexBuffer
void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* face,
const LLMeshSkinInfo* skin, LLVolume* volume,
const LLVolumeFace& vol_face, LLVOVolume* vobj)
{
LLVector4a* weight = vol_face.mWeights;
if (!weight)
{
return;
}
LLPointer<LLVertexBuffer> buffer = face->getVertexBuffer();
LLDrawable* drawable = face->getDrawable();
U32 data_mask = face->getRiggedVertexBufferDataMask();
if (buffer.isNull() || buffer->getTypeMask() != data_mask ||
buffer->getRequestedVerts() != vol_face.mNumVertices ||
buffer->getRequestedIndices() != vol_face.mNumIndices ||
(drawable && drawable->isState(LLDrawable::REBUILD_ALL)))
{
face->setGeomIndex(0);
face->setIndicesIndex(0);
if (buffer.isNull() || buffer->getTypeMask() != data_mask)
{ //make a new buffer
if (sShaderLevel > 0)
{
buffer = new LLVertexBuffer(data_mask, GL_DYNAMIC_DRAW_ARB);
}
else
{
buffer = new LLVertexBuffer(data_mask, GL_STREAM_DRAW_ARB);
}
buffer->allocateBuffer(vol_face.mNumVertices,
vol_face.mNumIndices, true);
}
else
{ //resize existing buffer
buffer->resizeBuffer(vol_face.mNumVertices, vol_face.mNumIndices);
}
face->setSize(vol_face.mNumVertices, vol_face.mNumIndices);
face->setVertexBuffer(buffer);
U16 offset = 0;
LLMatrix4 mat_vert = skin->mBindShapeMatrix;
glh::matrix4f m((F32*) mat_vert.mMatrix);
m = m.inverse().transpose();
F32 mat3[] = { m.m[0], m.m[1], m.m[2],
m.m[4], m.m[5], m.m[6],
m.m[8], m.m[9], m.m[10] };
LLMatrix3 mat_normal(mat3);
static LLCachedControl<bool> mesh_enable_deformer(gSavedSettings, "MeshEnableDeformer");
if (mesh_enable_deformer)
{
LLDeformedVolume* deformed_volume = vobj->getDeformedVolume();
deformed_volume->deform(volume, avatar, skin, face->getTEOffset());
face->getGeometryVolume(*deformed_volume, face->getTEOffset(), mat_vert,
mat_normal, offset, true);
}
else
{
face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert,
mat_normal, offset, true);
}
}
if (sShaderLevel <= 0 && face->mLastSkinTime < avatar->getLastSkinTime())
{ //perform software vertex skinning for this face
LLStrider<LLVector3> position;
LLStrider<LLVector3> normal;
bool has_normal = buffer->hasDataType(LLVertexBuffer::TYPE_NORMAL);
buffer->getVertexStrider(position);
if (has_normal)
{
buffer->getNormalStrider(normal);
}
LLVector4a* pos = (LLVector4a*) position.get();
LLVector4a* norm = has_normal ? (LLVector4a*) normal.get() : NULL;
//build matrix palette
LLMatrix4a mp[64];
LLMatrix4* mat = (LLMatrix4*) mp;
for (U32 j = 0; j < skin->mJointNames.size(); ++j)
{
LLJoint* joint = avatar->getJoint(skin->mJointNames[j]);
if (joint)
{
mat[j] = skin->mInvBindMatrix[j];
mat[j] *= joint->getWorldMatrix();
}
}
//.........这里部分代码省略.........