env3d
Class Env

java.lang.Object
  extended by com.jme3.app.Application
      extended by env3d.EnvBasic
          extended by env3d.Env
All Implemented Interfaces:
com.jme3.system.SystemListener
Direct Known Subclasses:
BEnv, EnvAdvanced

public class Env
extends EnvBasic


Field Summary
 
Fields inherited from class env3d.EnvBasic
audioMap, flyCam, guiFont, guiNode, init, internalObjects, objectsMap, roomObject, rootNode, statusNode, statusText, tpf
 
Fields inherited from class com.jme3.app.Application
assetManager, audioRenderer, cam, context, guiViewPort, inputEnabled, inputManager, joyInput, keyInput, listener, mouseInput, paused, pauseOnFocus, renderer, renderManager, settings, speed, stateManager, timer, touchInput, viewPort
 
Constructor Summary
Env()
           
Env(boolean defaultControl)
           
 
Method Summary
 void advanceOneFrame()
          Render the current screen.
 void advanceOneFrame(int targetFrameRate)
          Render the current screen
 int getKey()
          Return the last key that was released (down and then up).
 int getKeyDown()
          Returns the last key that was held down.
 boolean getKeyDown(int keycode)
          Test to see if a key is pressed downed.
 int getMouseButtonClicked()
          Returns the last mouse button that was clicked
 boolean getMouseButtonDown(int button)
          Checks to see if a particular mouse button is being held down.
 int getMouseDX()
          Get the difference along the x-axis in mouse movement since the last call
 int getMouseDY()
          Get the difference along the y-axis in mouse movement since the last call
 int getMouseX()
          Get the X mouse coordinate
 int getMouseY()
          Get the Y mouse coordinate
 boolean isFullScreen()
          Are we in full screen mode
 boolean isMouseGrabbed()
          Get the status of mouse grab
 void setFullscreen(boolean fs)
          Allow switching to fullscreen.
 void setMouseGrab(boolean grab)
          Have the Env window gain control of the mouse pointer (hide it).
 void setResolution(int width, int height, int bpp)
           
 void start(com.jme3.system.JmeContext.Type contextType)
           
 
Methods inherited from class env3d.EnvBasic
addObject, destroy, disableLighting, enableLighting, exit, getCameraPitch, getCameraX, getCameraY, getCameraYaw, getCameraZ, getNiftyGUI, getObject, getObjects, getObjects, getPick, getPickList, getPickRay, getRootNode, getVolume, initialize, isDefaultControl, isLightingEnabled, removeObject, setCameraPitch, setCameraXYZ, setCameraYaw, setDefaultControl, setDisplayStr, setDisplayStr, setDisplayStr, setRoom, setShowStatus, setVolume, soundLoad, soundLoop, soundPlay, soundPlay, soundStop, update
 
Methods inherited from class com.jme3.app.Application
createCanvas, destroyInput, enqueue, gainFocus, getAssetManager, getAudioRenderer, getCamera, getContext, getGuiViewPort, getInputManager, getListener, getRenderer, getRenderManager, getStateManager, getTimer, getViewPort, handleError, isPauseOnLostFocus, loseFocus, requestClose, reshape, restart, runQueuedTasks, setAssetManager, setPauseOnLostFocus, setSettings, setTimer, start, startCanvas, startCanvas, stop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Env

public Env()

Env

public Env(boolean defaultControl)
Method Detail

getKey

public int getKey()
Return the last key that was released (down and then up). Note that this method only detects one key at a time -- may miss keys if 2 keys are released at the same time. Use getKeyDown(int) to detect multiple keys.

Returns:
the key that was released

getKeyDown

public int getKeyDown()
Returns the last key that was held down. Note that this method only returns the latest key down if 2 keys are down at the same time. use getKeyDown(int) if you want to detect multiple key downs.

Returns:
the key that is being held down
See Also:
getKeyDown(int)

getKeyDown

public boolean getKeyDown(int keycode)
Test to see if a key is pressed downed. This method allows testing of multiple keys being held down.

Parameters:
keycode -
Returns:
true if the keycode is being held down

getMouseX

public int getMouseX()
Get the X mouse coordinate

Returns:
x coordinate of the mouse

getMouseY

public int getMouseY()
Get the Y mouse coordinate

Returns:
y coordinate of the mouse

getMouseDX

public int getMouseDX()
Get the difference along the x-axis in mouse movement since the last call

Returns:
the difference in the mouse's x-axis movement

getMouseDY

public int getMouseDY()
Get the difference along the y-axis in mouse movement since the last call

Returns:
the difference in the mouse's y-axis movement

setMouseGrab

public void setMouseGrab(boolean grab)
Have the Env window gain control of the mouse pointer (hide it).

Parameters:
grab - true to hide mouse pointer, false to release it to the OS.

isMouseGrabbed

public boolean isMouseGrabbed()
Get the status of mouse grab

Returns:
true if mouse is grabbed, false otherwise.

getMouseButtonDown

public boolean getMouseButtonDown(int button)
Checks to see if a particular mouse button is being held down.

Parameters:
button -
Returns:

getMouseButtonClicked

public int getMouseButtonClicked()
Returns the last mouse button that was clicked

Returns:

setFullscreen

public void setFullscreen(boolean fs)
Allow switching to fullscreen.

Parameters:
fs - true to switch to fullscreen. False to switch to window mode.

setResolution

public void setResolution(int width,
                          int height,
                          int bpp)

isFullScreen

public boolean isFullScreen()
Are we in full screen mode

Returns:

advanceOneFrame

public void advanceOneFrame()
Render the current screen. Maximum of 60 frames per second

See Also:
advanceOneFrame(int)

advanceOneFrame

public void advanceOneFrame(int targetFrameRate)
Render the current screen

Parameters:
targetFrameRate - the maximum frame rate

start

public void start(com.jme3.system.JmeContext.Type contextType)
Overrides:
start in class EnvBasic