Module physics
Blitwizard namespace
Info:
- Copyright: 2011-2013
- License: zlib
- Author: Jonas Thiem (jonas.thiem@gmail.com)
Functions
ray2d (startx, starty, targetx, targety) | Do a ray collision test by shooting out a ray and checking where it hits in 2d realm. |
ray3d (startx, starty, startz, targetx, targety, targetz) | Do a ray collision test by shooting out a ray and checking where it hits in 3d realm. |
Functions
- ray2d (startx, starty, targetx, targety)
-
Do a ray collision test by shooting out a ray and checking where it hits
in 2d realm.
Parameters:
- startx number Ray starting point, x coordinate (please note the starting point shouldn't be inside the collision shape of an object)
- starty number Ray starting point, y coordinate
- targetx number Ray target point, x coordinate
- targety number Ray target point, y coordinate
Returns:
-
userdata
Returns a blitwizard object if an object was hit by the ray (the closest object that was hit), or otherwise it returns nil
- ray3d (startx, starty, startz, targetx, targety, targetz)
-
Do a ray collision test by shooting out a ray and checking where it hits
in 3d realm.
Parameters:
- startx number Ray starting point, x coordinate (please note the starting point shouldn't be inside the collision shape of an object)
- starty number Ray starting point, y coordinate
- startz number Ray starting point, z coordinate
- targetx number Ray target point, x coordinate
- targety number Ray target point, y coordinate
- targetz number Ray target point, z coordinate
Returns:
-
userdata
Returns a blitwizard object if an object was hit by the ray (the closest object that was hit), or otherwise it returns nil