RayHit

From MaratisWiki
Revision as of 21:57, 5 August 2012 by Anael (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Launch a ray and returns the result of the test : the intersection point or nil
note : only detects objects with physics collision enabled


Example1, test the intersection with the full scene :

   function onSceneUpdate()
       start = {0, 0, 0}
       end = {100, 0, 0}
       point = rayHit(start, end)
       if point then
           print(point)
       end
   end

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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox