/** * 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(); }
/** * 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); }
/** * 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(); }