Пример #1
0
    bool DiCullNode::IsIn( DiAABB &box )
    {
        if (box.IsNull()) 
        {
            return false;
        }

        if (box.IsInfinite())
        {
            return true;
        }

        DiVec3 center = mWorldAABB.GetMaximum().midPoint( mWorldAABB.GetMinimum() );

        DiVec3 bmin = box.GetMinimum();
        DiVec3 bmax = box.GetMaximum();

        bool centre = ( bmax > center && bmin < center );
        if (!centre)
        {
            return false;
        }

        DiVec3 octreeSize = bmax - bmin;
        DiVec3 nodeSize = mWorldAABB.GetMaximum() - mWorldAABB.GetMinimum();
        return nodeSize < octreeSize;
    }
Пример #2
0
	void DiFocusedShadowPolicy::PointListBody::addAAB(const DiAABB& aab)
	{
		const DiVec3& min = aab.GetMinimum();
		const DiVec3& max = aab.GetMaximum();

		DiVec3 currentVertex = min;
		// min min min
		addPoint(currentVertex);

		// min min max
		currentVertex.z = max.z;
		addPoint(currentVertex);

		// min max max
		currentVertex.y = max.y;
		addPoint(currentVertex);

		// min max min
		currentVertex.z = min.z;
		addPoint(currentVertex);

		// max max min
		currentVertex.x = max.x;
		addPoint(currentVertex);

		// max max max
		currentVertex.z = max.z;
		addPoint(currentVertex);

		// max min max
		currentVertex.y = min.y;
		addPoint(currentVertex);

		// max min min
		currentVertex.z = min.z;
		addPoint(currentVertex); 

	}