Class VRCameraRig
java.lang.Object
com.codename1.vr.VRCameraRig
Computes per-eye cameras for stereo rendering: a head position and
orientation plus a
VRSettings interpupillary distance yield a
com.codename1.gpu.Camera per VREye. Pure math over the existing gpu
camera; usable from any thread that owns the target camera.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfiguresoutas the camera for the supplied eye: positioned at the head center offset by half the interpupillary distance along the head's right vector, looking along the head's forward vector.The settings this rig was created with.voidsetOrientation(float[] quat4) Sets the head orientation as an{x, y, z, w}quaternion rotating head-local vectors into world space.voidsetPosition(float x, float y, float z) Sets the head center position in world space.
-
Constructor Details
-
VRCameraRig
Creates a rig with the supplied settings.
Parameters
settings: the eye separation and lens parameters
-
-
Method Details
-
getSettings
The settings this rig was created with. -
setPosition
public void setPosition(float x, float y, float z) Sets the head center position in world space. -
setOrientation
public void setOrientation(float[] quat4) Sets the head orientation as an{x, y, z, w}quaternion rotating head-local vectors into world space. -
apply
Configures
outas the camera for the supplied eye: positioned at the head center offset by half the interpupillary distance along the head's right vector, looking along the head's forward vector.Parameters
-
out: the camera to configure -
eye: which eye to compute -
aspect: the per-eye viewport aspect ratio (width / height)
-
-