Exemplo n.º 1
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);
		}