hi,
I try to pick some geometry, but it didn't work, nothing is picked. Can anyone tell me why?
The method should test where the camera is looking at and just return the name of this Geometry.
public String getLookAt(Camera cam){
String res="";
Ray ray=new Ray(cam.getLocation(), cam.getDirection());
PickResults pr=new BoundingPickResults();
all.findPick(ray, pr);
System.out.print(pr.getNumber()); //prints 0 ever
for(int i=0;pr.getNumber()>i;i++){
Geometry geom=pr.getPickData(i).getTargetMesh();
String name=geom.getName();
System.out.println("n: "+name); //never done
res=name;
}
return res;
}
I invoke updateCollisionTree() on all Objects which are in the node "all", but I think this doesn't matter cause it use the Object bounds when i do it like this, don't it? It doesn't work when I change it to triangle picking also.
All the geometry in my Node are Boxes.
Thanks for help,
campino