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

NameTypeDescription
viewnumberThe index of the view to update.
xnumberThe x position of the viewer, in meters.
ynumberThe y position of the viewer, in meters.
znumberThe z position of the viewer, in meters.
anglenumberThe number of radians the viewer is rotated around its axis of rotation.
axnumberThe x component of the axis of rotation.
aynumberThe y component of the axis of rotation.
aznumberThe z component of the axis of rotation.

Returns

Nothing


lovr.graphics.setViewPose(view, matrix, inverted)

Arguments

NameTypeDescription
viewnumberThe index of the view to update.
matrixMat4A matrix containing the viewer pose.
invertedbooleanWhether 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