Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to perform ray casting on a mesh using libgdx.

I found this code sample and it misses some explanations. What do these vectors stand for? What is globalIntersection and localIntersection?

share|improve this question

closed as off topic by Laurent Couvidou, Jari Komppa, Byte56, Trevor Powell, Josh Petrie Dec 7 '12 at 16:42

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

  • globalIntersection is the nearest intersection to the origin of the ray.
  • localIntersection is the intersection of a mesh with the ray.

The simplified algorithm is:

iterating on the meshes:
    find the intersection of current mesh with ray (localIntersection)
    if intersection is near that globalIntersection:
        update globalIntersection with localIntersection
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.