us.ihmc.graphics3DAdapter.jme
Class JMEViewportAdapter
java.lang.Object
us.ihmc.graphics3DAdapter.jme.JMEViewportAdapter
- All Implemented Interfaces:
- ViewportAdapter, InputMapSetter
public class JMEViewportAdapter
- extends java.lang.Object
- implements ViewportAdapter, InputMapSetter
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JMEViewportAdapter
public JMEViewportAdapter(JMERenderer jmeRenderer,
com.jme3.scene.Node rootNode,
boolean isMainViewport,
JMEViewportAdapter.ViewportType viewportType)
setupViewport
public void setupViewport(double left,
double right,
double bottom,
double top)
getCanvas
public java.awt.Canvas getCanvas()
- Specified by:
getCanvas
in interface ViewportAdapter
setupOffscreenView
public void setupOffscreenView(int width,
int height)
- Specified by:
setupOffscreenView
in interface ViewportAdapter
closeAndDispose
public void closeAndDispose()
setDefaultInputMappings
public void setDefaultInputMappings()
- Specified by:
setDefaultInputMappings
in interface InputMapSetter
reset
public void reset()
- Specified by:
reset
in interface InputMapSetter
setClipDistances
public void setClipDistances(double near,
double far)
setFieldOfView
public void setFieldOfView(double fieldOfView)
getCameraController
public CameraController getCameraController()
- Specified by:
getCameraController
in interface ViewportAdapter
getCaptureDevice
public CaptureDevice getCaptureDevice()
- Specified by:
getCaptureDevice
in interface ViewportAdapter
getHeight
public int getHeight()
getWidth
public int getWidth()
setSize
public void setSize(int width,
int height)
getFieldOfView
public double getFieldOfView()
- Specified by:
getFieldOfView
in interface ViewportAdapter
getPhysicalWidth
public double getPhysicalWidth()
- Specified by:
getPhysicalWidth
in interface ViewportAdapter
getPhysicalHeight
public double getPhysicalHeight()
- Specified by:
getPhysicalHeight
in interface ViewportAdapter
updateCamera
public void updateCamera()
setCameraController
public void setCameraController(CameraController cameraController)
- Specified by:
setCameraController
in interface ViewportAdapter
getCamera
public JMECamera getCamera()
- Specified by:
getCamera
in interface ViewportAdapter
isMainViewport
public boolean isMainViewport()
getZBuffer
public double[][] getZBuffer()
- Specified by:
getZBuffer
in interface ViewportAdapter
getWorldCoordinatesFromScreenCoordinates
public javax.vecmath.Point3d getWorldCoordinatesFromScreenCoordinates(float x,
float y,
double z)
- Calculate real world coordinates from x and y position on the screen
- Specified by:
getWorldCoordinatesFromScreenCoordinates
in interface ViewportAdapter
- Parameters:
x
- X coordinate on screeny
- Y coordinate on screenz
- Depth as relative value between near and far frustrum
addContextSwitchedListener
public void addContextSwitchedListener(ContextSwitchedListener contextSwitchedListener)
- Specified by:
addContextSwitchedListener
in interface ViewportAdapter
getViewPort
public com.jme3.renderer.ViewPort getViewPort()
attachScene
public void attachScene(com.jme3.scene.Spatial scene)
detachScene
public void detachScene(com.jme3.scene.Spatial scene)