This is the complete 2.8 documentation for Scene.ray_cast
ray_cast (view_layer, origin, direction, distance=1.70141e+38)
Cast a ray onto in object space
Parameters:
view_layer (ViewLayer, (never None)) – Scene Layer
distance (float in [0, inf], (optional)) – Maximum distance
Return: (result, location, normal, index, object, matrix):
result, boolean
location, The hit location of this ray cast, float array of 3 items in [-inf, inf]
normal, The face normal at the ray cast hit location, float array of 3 items in [-inf, inf]
index, The face index, -1 when original data isn’t available, int in [-inf, inf]
object, Ray cast object, Object
matrix, Matrix, float multi-dimensional array of 4 * 4 items in [-inf, inf]
Can someone flesh this out for me?
- "Cast a ray into object space": which object?
- Which object's space are
origin
anddirection
in? And the returnedlocation
? - What is the
matrix
?
Do these all belong to the 'target' object? How would I know what that was before hitting it?