R3d.World:raycast

From GiderosMobile
Revision as of 00:35, 22 January 2020 by MoKaLux (talk | contribs) (Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.World<br/> === Description === You can use ReactPhysics3D to test intersection between a ray and the bodies o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2019.10
Class: R3d.World

Description

You can use ReactPhysics3D to test intersection between a ray and the bodies of the world you have created.

Ray casting can be performed against multiple bodies, a single body or any proxy shape of a given body.

r3d.World:raycast(sx, sy, sz, ex, ey, ez, callback, category)

Parameters

sx: (number) the starting position of the raycast in the world x axis
sy: (number) the starting position of the raycast in the world y axis
sz: (number) the starting position of the raycast in the world z axis
ex: (number) the ending position of the raycast in the world x axis
ey: (number) the ending position of the raycast in the world y axis
ez: (number) the ending position of the raycast in the world z axis
callback: (function) the callback function
category: (number) bit mask for collision filtering optional

Example