Package com.simsilica.lemur.effect
Class EffectControl<T extends Spatial>
java.lang.Object
com.jme3.scene.control.AbstractControl
com.simsilica.lemur.effect.EffectControl<T>
- All Implemented Interfaces:
Savable
,Control
,JmeCloneable
,Cloneable
Manages the available named Effects for a Spatial and keeps track of
the existing effects run for a particular channel. Callers can run
any of the configured effects by name.
-
Field Summary
Fields inherited from class com.jme3.scene.control.AbstractControl
enabled, spatial
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an effect control that will run animations using the default animation state returned by AnimationState.getDefaultInstance().EffectControl
(AnimationState anim) Creates an effect control that will use the specified AnimationState for running its effects. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected AnimationState
anim()
protected void
controlRender
(RenderManager rm, ViewPort vp) To be implemented in subclass.protected void
controlUpdate
(float tpf) To be implemented in subclass.Type-parameter safe version of getSpatial().boolean
removeEffect
(String name) Methods inherited from class com.jme3.scene.control.AbstractControl
cloneFields, cloneForSpatial, isEnabled, jmeClone, read, render, setEnabled, setSpatial, update, write
-
Constructor Details
-
EffectControl
Creates an effect control that will use the specified AnimationState for running its effects. Normally an application will only have one AnimationState but it's possible to have multiple states depending on need. For example, the UI might be run by one AnimationState while certain in-game controls run by a different AnimationState so that they can be paused without affecting the UI. -
EffectControl
public EffectControl()Creates an effect control that will run animations using the default animation state returned by AnimationState.getDefaultInstance().
-
-
Method Details
-
getSpatial
Type-parameter safe version of getSpatial().- Overrides:
getSpatial
in classAbstractControl
-
anim
-
addEffect
-
hasEffect
-
removeEffect
-
getEffects
-
runEffect
-
runEffect
-
controlUpdate
protected void controlUpdate(float tpf) Description copied from class:AbstractControl
To be implemented in subclass.- Specified by:
controlUpdate
in classAbstractControl
- Parameters:
tpf
- time per frame (in seconds)
-
controlRender
Description copied from class:AbstractControl
To be implemented in subclass.- Specified by:
controlRender
in classAbstractControl
- Parameters:
rm
- the RenderManager rendering the controlled Spatial (not null)vp
- the ViewPort being rendered (not null)
-