本文整理汇总了C++中Box3F::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ Box3F::contains方法的具体用法?C++ Box3F::contains怎么用?C++ Box3F::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box3F
的用法示例。
在下文中一共展示了Box3F::contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transformProjectRadius
void
SimInterior::RenderImage::render( TSRenderContext &rc )
{
//
ITRMetrics.render.reset();
ITRMetrics.numRenderedInteriors++;
rc.getCamera()->pushTransform(transform);
// Select the detail level we will be drawing at. This is a function of the
// bounding box for the highest level of detail, and the radius of the minimum
// level in the current state.
// - If camera is inside object's bounding box, draw highest detail level.
// - else check the projected radius of the lowest level of detail...
//
Point3F cameraCoord = rc.getCamera()->getCC();
Box3F bbox = instance->getHighestBoundingBox();
// We only set the detail by the pixels iff we're outside the interior, it's
// not a linked interior, and we're not rendering it through a link. Otherwise,
// the highest detail is drawn...
//
if (bbox.contains(cameraCoord) == false) {
float projPixels = rc.getCamera()->
transformProjectRadius(instance->getLowestCenterPt(),
instance->getLowestRadius());
projPixels *= 2.0f * rc.getCamera()->getPixelScale();
instance->setDetailByPixels(projPixels);
} else {
// If we're inside or rendering through a link,
// we draw at the highest detail level...
//
instance->setDetailLevel(0);
}
rend.render(rc, instance);
// Draw the bounding box if the flag is set...
//
if (g_drawSimInteriorBBox == true) {
TS::PointArray* pArray = rc.getPointArray();
Point3F bboxPts[8];
bboxPts[0].set(bbox.fMin.x, bbox.fMin.y, bbox.fMin.z);
bboxPts[1].set(bbox.fMin.x, bbox.fMax.y, bbox.fMin.z);
bboxPts[2].set(bbox.fMin.x, bbox.fMax.y, bbox.fMax.z);
bboxPts[3].set(bbox.fMin.x, bbox.fMin.y, bbox.fMax.z);
bboxPts[4].set(bbox.fMax.x, bbox.fMin.y, bbox.fMin.z);
bboxPts[5].set(bbox.fMax.x, bbox.fMax.y, bbox.fMin.z);
bboxPts[6].set(bbox.fMax.x, bbox.fMax.y, bbox.fMax.z);
bboxPts[7].set(bbox.fMax.x, bbox.fMin.y, bbox.fMax.z);
int start = pArray->addPoints(8, bboxPts);
pArray->drawLine(start + 0, start + 1, 253);
pArray->drawLine(start + 1, start + 2, 253);
pArray->drawLine(start + 2, start + 3, 253);
pArray->drawLine(start + 3, start + 0, 253);
pArray->drawLine(start + 4, start + 5, 253);
pArray->drawLine(start + 5, start + 6, 253);
pArray->drawLine(start + 6, start + 7, 253);
pArray->drawLine(start + 7, start + 4, 253);
pArray->drawLine(start + 0, start + 4, 253);
pArray->drawLine(start + 1, start + 5, 253);
pArray->drawLine(start + 2, start + 6, 253);
pArray->drawLine(start + 3, start + 7, 253);
}
rc.getCamera()->popTransform();
}