ray-input icon indicating copy to clipboard operation
ray-input copied to clipboard

RayInput not working for non-top level cameras ?

Open charlesfleche opened this issue 7 years ago • 0 comments

Is RayInput expecting a camera that is a direct child of a Scene ? The arm model seems to expect a camera whose local matrix is directly driven by getFrameData. That is the way THREE works at render time to get the VR cameras: https://github.com/mrdoob/three.js/blob/608fb12d7cdb7d9bdce193d9c9e63fa082b8de81/src/renderers/webvr/WebVRManager.js#L108

However, the RayRenderer directly receives a local matrix: https://github.com/borismus/ray-input/blob/65f312f8feb722cf4bc28df08771604f25a6e29e/src/ray-input.js#L130

Which means that if the camera is down a hierarchy, the RayCaster ray origin and orientation won't be set correctly: they'll be set in camera local coordinates, not world coordinates as they should be.

Is that the intended behavior or am I missing something here ?

charlesfleche avatar Feb 07 '18 14:02 charlesfleche