本文整理汇总了C++中LLVOVolume::getRelativeXform方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVOVolume::getRelativeXform方法的具体用法?C++ LLVOVolume::getRelativeXform怎么用?C++ LLVOVolume::getRelativeXform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVOVolume
的用法示例。
在下文中一共展示了LLVOVolume::getRelativeXform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateDistance
void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
{
//switch LOD with the spatial group to avoid artifacts
//LLSpatialGroup* sg = getSpatialGroup();
LLVector3 pos;
//if (!sg || sg->changeLOD())
{
LLVOVolume* volume = getVOVolume();
if (volume)
{
volume->updateRelativeXform();
pos = volume->getRelativeXform().getTranslation();
if (isStatic())
{
pos += volume->getRegion()->getOriginAgent();
}
if (isState(LLDrawable::HAS_ALPHA))
{
for (S32 i = 0; i < getNumFaces(); i++)
{
LLFace* facep = getFace(i);
if (facep->getPoolType() == LLDrawPool::POOL_ALPHA)
{
LLVector3 box = (facep->mExtents[1] - facep->mExtents[0]) * 0.25f;
LLVector3 v = (facep->mCenterLocal-camera.getOrigin());
const LLVector3& at = camera.getAtAxis();
for (U32 j = 0; j < 3; j++)
{
v.mV[j] -= box.mV[j] * at.mV[j];
}
facep->mDistance = v * camera.getAtAxis();
}
}
}
}
else
{
pos = LLVector3(getPositionGroup());
}
pos -= camera.getOrigin();
mDistanceWRTCamera = llround(pos.magVec(), 0.01f);
mVObjp->updateLOD();
}
}
示例2: renderSelected
void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color)
{
if (mDrawablep->getSpatialGroup() == NULL)
{
return;
}
mDrawablep->getSpatialGroup()->rebuildGeom();
mDrawablep->getSpatialGroup()->rebuildMesh();
if(mDrawablep.isNull() || mVertexBuffer.isNull())
{
return;
}
if (mGeomCount > 0 && mIndicesCount > 0)
{
gGL.getTexUnit(0)->bind(imagep);
gGL.pushMatrix();
if (mDrawablep->isActive())
{
glMultMatrixf((GLfloat*)mDrawablep->getRenderMatrix().mMatrix);
}
else
{
glMultMatrixf((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix);
}
glColor4fv(color.mV);
#if MESH_ENABLED
if (mDrawablep->isState(LLDrawable::RIGGED))
{
LLVOVolume* volume = mDrawablep->getVOVolume();
if (volume)
{
LLRiggedVolume* rigged = volume->getRiggedVolume();
if (rigged)
{
LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.f, -1.f);
glMultMatrixf((F32*) volume->getRelativeXform().mMatrix);
const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset());
LLVertexBuffer::unbind();
glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions);
if (vol_face.mTexCoords)
{
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords);
}
glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
}
}
else
#endif //MESH_ENABLED
{
mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0);
#if !LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkClientArrays("", LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0);
#endif
mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex);
}
gGL.popMatrix();
}
}