|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.AbstractSceneController
gov.nasa.worldwind.BasicSceneController
gov.nasa.worldwind.StereoOptionSceneController
public class StereoOptionSceneController
TODO: This file needs to be updated to implement "correct" stereo, as described at: http://www.orthostereo.com/geometryopengl.html
This scene controller draws in stereo, either red-blue anaglyph or device supported if the display device provides stereo directly. It can also draw without applying stereo. To select stereo, prior to calling this class' constructor set the Java VM propertygov.nasa.worldwind.stereo.mode to "device" for device supported stereo (if
provided by the device) or "redblue" for red-blue anaglyph stereo. If the property is not set or is any other value,
this class does not draw in stereo.
The WorldWindow instance must support stereo in order to use device-supported stereo. A stereo
WorldWindow is selected by specifying the Java VM property described above prior to creating it. See
WorldWindowGLCanvas for further details.
Note: The logic and much of the code here was contributed by Xander Enzmann of Mitre Corporation.
| Field Summary | |
|---|---|
protected GLCapabilitiesImmutable |
capabilities
Indicates the GL drawable capabilities. |
protected static double |
DEFAULT_FOCUS_ANGLE
The default focus angle. |
protected Angle |
focusAngle
The angle between eyes. |
protected boolean |
hardwareStereo
Indicates whether hardware device stereo is available. |
protected boolean |
inStereo
Indicates whether stereo is being applied, either because a stereo device is being used or a stereo mode is in effect. |
protected String |
stereoMode
The current stereo mode. |
protected boolean |
swapEyes
Indicates whether left and right eye positions are swapped. |
| Fields inherited from class gov.nasa.worldwind.AbstractSceneController |
|---|
clutterFilter, dc, deepPick, frame, framesPerSecond, frameTime, glRuntimeCaps, gpuResourceCache, lastObjectsInPickRect, lastPickedObjects, model, perFrameStatistics, perFrameStatisticsKeys, pickableObjects, pickPoint, pickPoints, pickRect, pickTime, renderingExceptions, screenCreditController, SURFACE_OBJECT_TILE_COUNT_NAME, surfaceObjectTileBuilder, surfaceObjectTiles, textRendererCache, timebase, verticalExaggeration, view |
| Constructor Summary | |
|---|---|
StereoOptionSceneController()
Constructs an instance and initializes its stereo mode to |
|
| Method Summary | |
|---|---|
protected void |
doDrawStereoNone(DrawContext dc)
Implement no stereo ("Mono") while using a stereo device. |
protected void |
doDrawStereoRedBlue(DrawContext dc)
Implement stereo using the red-blue anaglyph technique. |
protected void |
doDrawToStereoDevice(DrawContext dc)
Implement stereo using the stereo-enabled graphics device. |
protected void |
draw(DrawContext dc)
|
Angle |
getFocusAngle()
Returns this controller's focus angle, the angle difference between the left and right eye direction. |
String |
getStereoMode()
Indicates the current stereo mode of this controller. |
boolean |
isHardwareStereo()
Indicates whether stereo is being implemented directly by the display device rather than software. |
boolean |
isInStereo()
Indicates whether stereo is being applied, either directly by the display device or simulated via software. |
boolean |
isSwapEyes()
Indicates whether to switch the left/right stereo images. |
void |
setFocusAngle(Angle a)
Specifies the angle difference between the left and right eye direction. |
void |
setStereoMode(String mode)
Specifies the technique used to provide a stereo effect. |
void |
setSwapEyes(boolean swapEyes)
Specifies whether to draw the right eye image in the left eye's position and the left eye's image in the right eye's position. |
| Methods inherited from class gov.nasa.worldwind.BasicSceneController |
|---|
doRepaint |
| Methods inherited from class gov.nasa.worldwind.WWObjectImpl |
|---|
onMessage, propertyChange |
| Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gov.nasa.worldwind.avlist.AVList |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from interface java.beans.PropertyChangeListener |
|---|
propertyChange |
| Methods inherited from interface gov.nasa.worldwind.event.MessageListener |
|---|
onMessage |
| Methods inherited from interface gov.nasa.worldwind.Disposable |
|---|
dispose |
| Field Detail |
|---|
protected GLCapabilitiesImmutable capabilities
protected static final double DEFAULT_FOCUS_ANGLE
gov.nasa.worldwind.StereoFocusAngle property. The default if not specified in the configuration is
1.6 degrees.
protected Angle focusAngle
protected boolean hardwareStereo
protected boolean inStereo
protected String stereoMode
AVKey.STEREO_MODE_NONE instead.
protected boolean swapEyes
| Constructor Detail |
|---|
public StereoOptionSceneController()
| Method Detail |
|---|
protected void doDrawStereoNone(DrawContext dc)
dc - the current draw context.protected void doDrawStereoRedBlue(DrawContext dc)
dc - the current draw context.protected void doDrawToStereoDevice(DrawContext dc)
dc - the current draw context.protected void draw(DrawContext dc)
draw in class AbstractSceneControllerpublic Angle getFocusAngle()
StereoSceneController
getFocusAngle in interface StereoSceneControllerpublic String getStereoMode()
StereoSceneController
getStereoMode in interface StereoSceneControllerStereoSceneController.setStereoMode(String), this instance's mode was set to AVKey.STEREO_MODE_NONE.public boolean isHardwareStereo()
StereoSceneController
isHardwareStereo in interface StereoSceneControllerpublic boolean isInStereo()
isHardwareStereo() is true -- this method
returns true even if the stereo mode is AVKey.STEREO_MODE_NONE. In this case, individual stereo images
are drawn for left and right eyes in order to prevent a blurred scene.
isInStereo in interface StereoSceneControllerpublic boolean isSwapEyes()
StereoSceneController
isSwapEyes in interface StereoSceneControllerpublic void setFocusAngle(Angle a)
setFocusAngle in interface StereoSceneControllera - the left-right eye direction difference. If null, the angle is set to 0.public void setStereoMode(String mode)
StereoSceneControllerAVKey.STEREO_MODE_DEVICE to request device supported stereo, AVKey.STEREO_MODE_RED_BLUE to request red-blue anaglyph stereo implemented in
software, or AVKey.STEREO_MODE_NONE (the default) to request no stereo effect.
If STEREO_MODE_DEVICE is requested but the display device does not support stereo, stereo is not
applied.
See the implementing class to determine how it detects the initial stereo mode.
setStereoMode in interface StereoSceneControllermode - the technique used to provide the stereo effect. If null, the mode is set to AVKey.STEREO_MODE_NONE.public void setSwapEyes(boolean swapEyes)
StereoSceneController
setSwapEyes in interface StereoSceneControllerswapEyes - true to switch the left/right stereo images, otherwise false.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||