What is the space used by Scene.ray_cast()? 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 and direction in? And the
returned location?
What is the matrix?


Do these all belong to the 'target' object? How would I know what that was before hitting it?
@ batFINGER was correct in his commentary.. All vectors are in World Space,  the matrix, the hit object's matrix_world.