Package jme3utilities
Class SimpleControl
java.lang.Object
com.jme3.scene.control.AbstractControl
jme3utilities.SimpleControl
- All Implemented Interfaces:
com.jme3.export.Savable,com.jme3.scene.control.Control,com.jme3.util.clone.JmeCloneable,Cloneable
- Direct Known Subclasses:
SubtreeControl
public abstract class SimpleControl
extends com.jme3.scene.control.AbstractControl
A simplified AbstractControl.
Although this is an abstract class, it defines all required methods in order to simplify the development of subclasses -- unlike AbstractControl. It also validates parameters of its public methods and finalizes isEnabled().
Each instance is enabled at creation.
-
Field Summary
Fields inherited from class com.jme3.scene.control.AbstractControl
enabled, spatial -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedA no-arg constructor to avoid javadoc warnings from JDK 18. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcontrolRender(com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort viewPort) Render this Control.protected voidcontrolUpdate(float updateInterval) Update this Control.final booleanTest whether this Control is enabled.voidToggle the enabled status of this Control.Methods inherited from class com.jme3.scene.control.AbstractControl
cloneFields, cloneForSpatial, getSpatial, jmeClone, read, render, setEnabled, setSpatial, update, write
-
Constructor Details
-
SimpleControl
protected SimpleControl()A no-arg constructor to avoid javadoc warnings from JDK 18.
-
-
Method Details
-
toggleEnabled
public void toggleEnabled()Toggle the enabled status of this Control. -
controlRender
protected void controlRender(com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort viewPort) Render this Control. Invoked when the controlled spatial is about to be rendered to a ViewPort.This implementation only performs checks and is meant to be overridden.
- Specified by:
controlRenderin classcom.jme3.scene.control.AbstractControl- Parameters:
renderManager- the renderer which is rendering the controlled spatial (not null)viewPort- the ViewPort where the controlled spatial will be rendered (not null)
-
controlUpdate
protected void controlUpdate(float updateInterval) Update this Control. Invoked once per frame during the logical-state update, provided the Control is enabled and added to a Spatial. Should not be invoked directly from user code.This implementation only performs checks and is meant to be overridden.
- Specified by:
controlUpdatein classcom.jme3.scene.control.AbstractControl- Parameters:
updateInterval- time interval between frames (in seconds, ≥0)
-
isEnabled
public final boolean isEnabled()Test whether this Control is enabled.- Overrides:
isEnabledin classcom.jme3.scene.control.AbstractControl- Returns:
- true if enabled, otherwise false
-