本文整理汇总了C++中AABB::CornerPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ AABB::CornerPoint方法的具体用法?C++ AABB::CornerPoint怎么用?C++ AABB::CornerPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AABB
的用法示例。
在下文中一共展示了AABB::CornerPoint方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initTree
void ChunkManager::initTree(ChunkTree& pChild)
{
boost::shared_ptr<Chunk>& pChunk = pChild.getValue();
AABB bounds = pChild.getParent()->getValue()->m_bounds;
vec center = bounds.CenterPoint();
vec c0 = bounds.CornerPoint(pChild.getCorner().index());
AABB b0(vec(min(c0.x, center.x),
min(c0.y, center.y),
min(c0.z, center.z)),
vec(max(c0.x, center.x),
max(c0.y, center.y),
max(c0.z, center.z)));
pChunk = boost::make_shared<Chunk>(b0, 1.0f/pChild.getLevel(), this);
pChunk->m_pTree = &pChild;
*pChunk->m_workInProgress = true;
m_chunkGeneratorQueue.push(pChild.getValueCopy());
}
示例2: Contains
bool Sphere::Contains(const AABB &aabb) const
{
for(int i = 0; i < 8; ++i)
if (!Contains(aabb.CornerPoint(i)))
return false;
return true;
}
示例3: Contains
bool OBB::Contains(const AABB &aabb) const
{
// Since both AABB and OBB are convex objects, this OBB contains the AABB
// if and only if it contains all its corner points.
for(int i = 0; i < 8; ++i)
if (!Contains(aabb.CornerPoint(i)))
return false;
return true;
}
示例4: min
void ChunkManager::initTree1(ChunkTree& pChild)
{
boost::shared_ptr<Chunk>& pChunk = pChild.getValue();
AABB bounds = pChild.getParent()->getValue()->m_bounds;
vec center = bounds.CenterPoint();
vec c0 = bounds.CornerPoint(pChild.getCorner().index());
AABB b0(vec(min(c0.x, center.x),
min(c0.y, center.y),
min(c0.z, center.z)),
vec(max(c0.x, center.x),
max(c0.y, center.y),
max(c0.z, center.z)));
pChunk = boost::make_shared<Chunk>(b0, 1.0f/pChild.getLevel(), this);
pChunk->m_pTree = &pChild;
pChunk->generateTerrain();
pChunk->generateMesh();
}
示例5: Enclose
void Sphere::Enclose(const AABB &aabb)
{
///@todo This might not be very optimal at all. Perhaps better to enclose the farthest point first.
for(int i = 0; i < 8; ++i)
Enclose(aabb.CornerPoint(i));
}