• Csaba Pinter's avatar
    ENH: Add functions to set VR physical geometry with matrix · ed74f20d
    Csaba Pinter authored
    - Get/SetPhysicalToWorldMatrix functions added to vtkOpenVRRenderWindow to handle the PhysicalTranslation etc. camera related geometry changes as a matrix
    - Refactored UpdateHMDMatrixPose code so that it is more understandable what happens under the hood when the camera is set. It works the very same way, but it is now better formalized and readable.
    Here's how setting the camera works:
    Scaling is applied through moving the camera closer to the focal point, because scaling of all actors is not feasible, and vtkCamera::ModelTransformMatrix is not supported throughout VTK (clipping issues etc.). To achieve this, a new coordinate system called NonScaledWorld is introduced. The relationship between Physical (in which the HMD pose is given by OpenVR) and NonScaledWorld is described by the PhysicalViewUp etc. member variables. After getting the HMD pose in Physical, those coordinates and axes are converted to the NonScaledWorld coordinate system, on which the PhysicalScaling trick of modifying the camera position is applied, resulting the World coordinate system.
    - Renamed incorrect distance variable to physical scale
vtkOpenVRRenderer.cxx 10.5 KB