Ejemplo n.º 1
0
        /**
         * Copy
         *
         * @param original
         */
        public void Copy(OctNode original)
        {
            int i;

            for (i = 0; i < 6; i++)
            {
                Adjacent [i] = original.GetAdjacent(i);
                OctFaces [i] = original.GetFace(i);
            }
            for (i = 0; i < 8; i++)
            {
                Child [i] = original.GetChild(i);
            }
            ObjList = original.GetList();
            NumObj  = original.GetNumObj();
        }
Ejemplo n.º 2
0
    /**
     * FindLightBlock
     *
     * @param tree
     * @param ray
     * @param maxt
     * @return boolean
     */
    private bool FindLightBlock(OctNode tree, Ray ray, double maxt)
    {
        OctNode     current = tree.FindTreeNode(ray.GetOrigin());
        IntersectPt test    = new IntersectPt();
        Point       testpt  = new Point();

        while (current != null)
        {
            ObjNode currentnode = current.GetList();
            while (currentnode != null)
            {
                bool found = false;
                if (currentnode.GetObj().GetCachePt().GetID() == ray.GetID())
                {
                    found = true;
                }
                if (!found)
                {
                    test.SetOrigID(0);
                    if (currentnode.GetObj().Intersect(ray, test))
                    {
                        if (test.GetT() < maxt)
                        {
                            return(true);
                        }
                    }
                }
                currentnode = currentnode.Next();
            }
            OctNode adjacent = current.Intersect(ray, testpt, test.GetThreshold());
            if (adjacent == null)
            {
                current = null;
            }
            else
            {
                current = adjacent.FindTreeNode(testpt);
            }
        }
        return(false);
    }
Ejemplo n.º 3
0
	/**
	 * Copy
	 *
	 * @param original
	 */
	public void Copy(OctNode original)
	{
		int i;

		for(i = 0; i < 6; i++)
		{
			Adjacent[i] = original.GetAdjacent(i);
			OctFaces[i] = original.GetFace(i);
		}
		for(i = 0; i < 8; i++)
		{
			Child[i] = original.GetChild(i);
		}
		ObjList = original.GetList();
		NumObj = original.GetNumObj();
	}