lovr.graphics.setViewPose
Sets the pose for a single view. Objects rendered in this view will appear as though the camera is positioned using the given pose.
Two views are supported, one for each eye. When rendering to the headset, both views are changed to match the estimated eye positions. These view poses are also available using lovr.headset.getViewPose
.
lovr.graphics.setViewPose(view, x, y, z, angle, ax, ay, az)
Arguments
Name | Type | Description |
view | number | The index of the view to update. |
x | number | The x position of the viewer, in meters. |
y | number | The y position of the viewer, in meters. |
z | number | The z position of the viewer, in meters. |
angle | number | The number of radians the viewer is rotated around its axis of rotation. |
ax | number | The x component of the axis of rotation. |
ay | number | The y component of the axis of rotation. |
az | number | The z component of the axis of rotation. |
Returns
Nothing
lovr.graphics.setViewPose(view, matrix, inverted)
Arguments
Name | Type | Description |
view | number | The index of the view to update. |
matrix | Mat4 | A matrix containing the viewer pose. |
inverted | boolean | Whether the matrix is an inverted pose (a view matrix). |
Returns
Nothing
Notes
Non-stereo rendering will only use the first view.
The inverted view poses (view matrices) are available as the mat4 lovrViews[2]
variable in shaders. The current view matrix is available as lovrView
.
See also
lovr.headset.getViewPose
lovr.headset.getViewCount
lovr.graphics.getProjection
lovr.graphics.setProjection
lovr.graphics.getViewPose
lovr.graphics