j3d.org Code

org.j3d.device.input.vfx
Class VFXDriver

java.lang.Object
  extended by org.j3d.device.input.vfx.VFXDriver

public class VFXDriver
extends java.lang.Object

Class which implements a global driver interface for the VFX3D handling.

The code forms the interface to the native underlying libraries. When using the HMD in stereo mode the calls should be made to this library before initializing Java3D, and after you have closed everything down.

The assumption is that there is only one HMD attached to the system at a time, and that in doing so, the application has all the control over the class. A singleton is provided to avoid messy issues with needing to track how many enables and disables have been called when dealing with the native library.

Reading tracker data is a polling only operation. It is typically fast enough that it can be used within a tight render loop and does not need external asynchronous handling.

Version:
$Revision: 1.2 $
Author:
Justin Couch

Method Summary
 void disableStereo()
          Disable the stereo output now.
 void enableStereo(boolean isDirect3D)
          Enable the VFX driver for a specific type of renderer.
 void getTrackerPosition(float[] orientation)
          Fetch the current tracking position from the HMD.
static VFXDriver getVFXDriver()
          Get hold of the single global instance of this driver.
 boolean isDeviceActive()
          Check to see if the device has been previously shut down.
 void resetZeroPosition()
          Reset the zero position of the tracker to be it's current orientation.
 void shutdownDevice()
          Shut down the entire device now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getVFXDriver

public static VFXDriver getVFXDriver()
Get hold of the single global instance of this driver.


enableStereo

public void enableStereo(boolean isDirect3D)
                  throws java.lang.IllegalStateException
Enable the VFX driver for a specific type of renderer. Due to the way the VFX driver works, the flag must be set to know whether the system is using the DirectX or OpenGL version of Java3D.

Parameters:
isDirect3D - True if the application is running on the D3D version
Throws:
java.lang.IllegalStateException - The device has been shut down or the device is currently enabled

disableStereo

public void disableStereo()
                   throws java.lang.IllegalStateException
Disable the stereo output now.

Throws:
java.lang.IllegalStateException - The device has been shut down

resetZeroPosition

public void resetZeroPosition()
                       throws java.lang.IllegalStateException
Reset the zero position of the tracker to be it's current orientation.

Throws:
java.lang.IllegalStateException - The device has been shut down

getTrackerPosition

public void getTrackerPosition(float[] orientation)
                        throws java.lang.IllegalStateException
Fetch the current tracking position from the HMD. The values are given as yaw, pitch and roll in the array.

Parameters:
orientation - The array to copy the location information into
Throws:
java.lang.IllegalStateException - The device has been shut down

isDeviceActive

public boolean isDeviceActive()
Check to see if the device has been previously shut down.

Returns:
True if the device interface is still running

shutdownDevice

public void shutdownDevice()
                    throws java.lang.IllegalStateException
Shut down the entire device now. After calling this, no methods will function correctly and will issue exceptions. It is not possible to restart the device after calling this method.

Throws:
java.lang.IllegalStateException - The device has been shut down

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org