Package jme3utilities.debug
Class PerformanceAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
jme3utilities.NamedAppState
jme3utilities.SimpleAppState
jme3utilities.debug.PerformanceAppState
- All Implemented Interfaces:
com.jme3.app.state.AppState
App state that implements a latency-oriented performance monitor for
jMonkeyEngine3. It displays the duration of the longest update during the
preceding measurement interval.
Each instance is enabled at creation.
-
Field Summary
Fields inherited from class jme3utilities.SimpleAppState
assetManager, cam, flyCam, guiNode, guiViewPort, inputManager, renderManager, rootNode, simpleApplication, stateManager, viewPortFields inherited from class com.jme3.app.state.AbstractAppState
initialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Clean up this performance monitor after it has been detached.voidinitialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application application) Initialize this performance monitor prior to its first update.voidsetEnabled(boolean newSetting) Enable or disable this performance monitor.voidsetUpdateInterval(float newInterval) Alter the measurement interval.voidupdate(float timePerFrame) Update the performance statistics.floatRead the measurement interval.Methods inherited from class jme3utilities.SimpleAppState
refreshCachedFields, render, stateDetachedMethods inherited from class jme3utilities.NamedAppState
getInfluence, hasInfluenceOver, influence, isEnabled, isInitialized, postRender, stateAttached, stopInfluencing, toStringMethods inherited from class com.jme3.app.state.AbstractAppState
getId, setId
-
Constructor Details
-
PerformanceAppState
public PerformanceAppState()Instantiate a new enabled, uninitialized state.
-
-
Method Details
-
setUpdateInterval
public void setUpdateInterval(float newInterval) Alter the measurement interval.- Parameters:
newInterval- (in seconds, >0)
-
updateInterval
public float updateInterval()Read the measurement interval.- Returns:
- interval (in seconds, >0)
-
cleanup
public void cleanup()Clean up this performance monitor after it has been detached. Should be invoked only by a subclass or by the AppStateManager.- Specified by:
cleanupin interfacecom.jme3.app.state.AppState- Overrides:
cleanupin classNamedAppState
-
initialize
public void initialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application application) Initialize this performance monitor prior to its first update. Should be invoked only by a subclass or by the AppStateManager.- Specified by:
initializein interfacecom.jme3.app.state.AppState- Overrides:
initializein classSimpleAppState- Parameters:
stateManager- the manager for this state (not null)application- (not null)
-
setEnabled
public void setEnabled(boolean newSetting) Enable or disable this performance monitor.- Specified by:
setEnabledin interfacecom.jme3.app.state.AppState- Overrides:
setEnabledin classNamedAppState- Parameters:
newSetting- true → enable, false → disable
-
update
public void update(float timePerFrame) Update the performance statistics.- Specified by:
updatein interfacecom.jme3.app.state.AppState- Overrides:
updatein classNamedAppState- Parameters:
timePerFrame- time interval between updates (in seconds, ≥0)
-