Hi try to undertsand collision; I used that code to know if my pointer touch a sphere.I noticed that collisionSphere is equal to TWO but my pointer touche the sphere in one point
Why that?
[java]Vector3f origin = getCamera().getWorldCoordinates(
getInputManager().getCursorPosition(), 0.0f);
Vector3f direction = getCamera().getWorldCoordinates(
getInputManager().getCursorPosition(), 0.3f);
direction.subtractLocal(origin).normalizeLocal();
Ray ray = new Ray(origin, direction);
CollisionResults results = new CollisionResults();
int collisionSphere = sphere.collideWith(ray, results);[/java]
because you have a collision result each time the ray hit a polygon, so one for the front side and one for the back side of the sphere
with a box it’s the same i think.
Or i should use other code?