public final class TLspOculusDeviceBuilder extends Object
TLspStereoscopicDevice
, that represents the Oculus Rift. This can then be used to create
the necessary view, TLspViewBuilder.buildStereoscopicView(TLspStereoscopicDevice)
. It is not possible to
build a view for the Oculus Rift when one already exists, the existing view must first be destroyed ILspView.destroy()
.
When TLspViewPaintingHints.AUTOMATIC
is configured via (TLspViewBuilder.paintingHints(TLspViewPaintingHints)
),
a view with the TLspViewPaintingHints.MAX_PERFORMANCE
setting will be created.
It is advised to use the TLspViewPaintingHints.MAX_PERFORMANCE
setting, as the Oculus Rift requires a steady high frame rate.
The Oculus Rift has several sensors for head tracking. The sensor information is used to apply an orientation to the camera of the view. Thus, the camera will automatically follow the direction you are looking at.
The Oculus Rift uses Direct Display Mode, this means that it is not seen as a regular display. As a result, it is not possible to use Java GUI components in an Oculus Rift view.
Modifier and Type | Method and Description |
---|---|
TLspStereoscopicDevice |
build()
Builds the resulting stereoscopic device.
|
TLspOculusDeviceBuilder |
mirrorSize(int aWidth,
int aHeight)
Sets the size in pixels of the mirror view.
|
TLspOculusDeviceBuilder |
mirrorView(boolean aMirrorView)
Sets whether or not a mirror view is shown in a
JFrame on the desktop. |
TLspOculusDeviceBuilder |
monoscopic(boolean aMonoscopic)
Sets whether or not monoscopic rendering will be used.
|
static TLspOculusDeviceBuilder |
newBuilder()
Creates a new Oculus device builder.
|
TLspOculusDeviceBuilder |
resolutionFactor(float aResolutionFactor)
If you are experiencing performance issues you can choose to render to a lower resolution, the result will be
upscaled to match the native resolution of the Oculus device.
|
public static TLspOculusDeviceBuilder newBuilder()
public TLspOculusDeviceBuilder resolutionFactor(float aResolutionFactor)
If you are experiencing performance issues you can choose to render to a lower resolution, the result will be upscaled to match the native resolution of the Oculus device.
By using a factor of 0.5f, only one fourth of the pixels need to be rendered, since both the width and height of the native resolution are halved. By default a factor of 1.0f is used, indicating that the native resolution is used.
aResolutionFactor
- the factor by which the native resolution will be downscaled (0 < factor <=1).this
public TLspOculusDeviceBuilder mirrorView(boolean aMirrorView)
JFrame
on the desktop. This mirror view will show exactly
what is being displayed on the display of the Oculus Rift. The mirror view is shown by default.
The size of the JFrame can be configure with mirrorSize(int, int)
.aMirrorView
- whether or not the mirror view is shown.this
public TLspOculusDeviceBuilder mirrorSize(int aWidth, int aHeight)
aWidth
- the width of the mirror viewaHeight
- the height of the mirror viewthis
public TLspOculusDeviceBuilder monoscopic(boolean aMonoscopic)
Sets whether or not monoscopic rendering will be used. When enabled the view is rendered only once per frame. The result is used for both eyes in the Oculus device. This functionality is disabled by default.
Stereo rendering has a significant cost, since the view has to be rendered twice, once for each eye. For some applications the stereo effect might not be necessary and a monocular view might be acceptable in return for increased performance. Mono rendering can also be a solution for users who experience eye strain from a stereo view.
aMonoscopic
- whether or not monoscopic rendering should be used.this
public TLspStereoscopicDevice build()