当前位置: 首页>>代码示例>>C++>>正文


C++ AABB::CornerPoint方法代码示例

本文整理汇总了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());

}
开发者ID:Regiuz,项目名称:GfxApi,代码行数:25,代码来源:ChunkManager.cpp

示例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;
}
开发者ID:juj,项目名称:MathGeoLib,代码行数:8,代码来源:Sphere.cpp

示例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;
}
开发者ID:Ilikia,项目名称:naali,代码行数:10,代码来源:OBB.cpp

示例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();

}
开发者ID:Regiuz,项目名称:GfxApi,代码行数:23,代码来源:ChunkManager.cpp

示例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));
}
开发者ID:jjiezheng,项目名称:MathGeoLib,代码行数:6,代码来源:Sphere.cpp


注:本文中的AABB::CornerPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。