Collision detection between nodes

we are making a first person shooter game and have our player with gun model attached to a cameranode object. we have an array of trees / plants / bushes which is an array of spatials:



public static ArrayList<Spatial> vegetationList = new ArrayList<Spatial>();



we're trying to implement collision detection between the player and the trees / bushes so that he cant simply walk through them!! after this we hope to implement bullet collision with these trees, (we already have collision with the terrain, other bullets and our player and bot).



does anyone know of any tutorials or ideas on how to do this? what we have been trying is this :



for(int i=0; i < Vegetation.vegetationList.size(); i++){

Spatial p = (Spatial)Vegetation.vegetationList.get(i);

// camNode.findCollisions(p, results);

try{

// camNode.calculateCollisions(p, results);

camNode.findCollisions(p, results);

System.out.println(results.getNumber() + "hinnnnnn");

}

catch(NullPointerException e){

e.printStackTrace();

}



which must be detecting something as the game crashes when the player enters the bounding box for the tree, this is in our render() method in the main class

i tried to put a screenshot in but not sure how to do this either :confused:



any help at all would be great…

it crashes? no exceptions/stacktrace?

did you try using a debugger?