/*
 * Copyright (c) 2003, jMonkeyEngine - Mojo Monkey Coding
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this 
 * list of conditions and the following disclaimer. 
 * 
 * Redistributions in binary form must reproduce the above copyright notice, 
 * this list of conditions and the following disclaimer in the documentation 
 * and/or other materials provided with the distribution. 
 * 
 * Neither the name of the Mojo Monkey Coding, jME, jMonkey Engine, nor the 
 * names of its contributors may be used to endorse or promote products derived 
 * from this software without specific prior written permission. 
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 * POSSIBILITY OF SUCH DAMAGE.
 *
 */
package com.jme.intersection;

import java.util.logging.Level;

import com.jme.scene.Geometry;
import com.jme.scene.Node;
import com.jme.scene.Spatial;
import com.jme.util.LoggingSystem;

/**
 * <code>CollisionDetection</code> provides a system for calculating collisions
 * based on given criteria. 
 * @author Mark Powell
 * @version $Id: CollisionDetection.java,v 1.4 2004-02-20 16:44:43 mojomonkey Exp $
 */
public class CollisionDetection {

    /**
     * 
     * <code>hasCollision</code> determines if a static test Spatial is 
     * colliding with any scene objects. 
     * @param test the node to test for collisions.
     * @param scene the world to test the node against.
     * @param results the list of collisions.
     */
    public static void hasCollision(
        Spatial test,
        Spatial scene,
        CollisionResults results) {
        
        if (Intersection
            .intersection(test.getWorldBound(), scene.getWorldBound())) {
            if ((scene instanceof Node)) {
                Node parent = (Node) scene;
                for (int i = 0; i < parent.getQuantity(); i++) {
                    hasCollision(test, parent.getChild(i), results);
                }
            } else {
                //find the triangle that is being hit.
                //add this node and the triangle to the CollisionResults list.
                results.addNode((Geometry) scene);
            }
        }
    }
}

@@ -1658,41 +1658,8 @@
 n;%0A%0A
-import java.util.logging.Level;%0A%0A
 impo
@@ -1745,43 +1745,8 @@
 ial;
-%0Aimport com.jme.util.LoggingSystem;
 %0A%0A/*
@@ -1924,17 +1924,17 @@
 ava,v 1.
-4
+5
  2004-02
@@ -1944,13 +1944,13 @@
  16:
-44:43
+56:46
  moj
@@ -2409,24 +2409,76 @@
  results) %7B%0A
+    %09%0A    %09if(test == scene) %7B%0A    %09%09return;%0A    %09%7D%0A
         %0A   

Test was actually needed... oops.