Topic: rayHit (In layman's terms)
Here is the example in the wiki:
Example2, test the intersection with an object :
object = getObject("object")
function onSceneUpdate()
start = {0, 0, 0}
end = {100, 0, 0}
point = rayHit(start, end, object)
if point then
print(point)
end
end
Here is my understanding of what the rayHit() function does, and how it can be used:
The rayHit() function shoots out a beam from a start position to an end position.
If the beam collides with something it returns the location of the object. If it doesn't it returns "nil"
Here is where my understanding breaks down. Is the "point" variable a point in 3d space or is it a boolean?
For instance, if there IS a collision then does the rayHit() function return TRUE and therefore make the point variable equale to TRUE?
How can it be both if it is?
And what is the "object" variable really doing? Is it making the rayHit() function detect a specific object? If so, what does it do with that object? give it's location? If it does give it's location, is it making the "point" variable equal to it's location (a 3d point in space)?
I need to understand this in layman's terms (as dumb as you can make it, yet clear).