Package com.jme3.anim
Class MorphControl
java.lang.Object
com.jme3.scene.control.AbstractControl
com.jme3.anim.MorphControl
- All Implemented Interfaces:
Savable,Control,JmeCloneable,Cloneable
A control that handle morph animation for Position, Normal and Tangent buffers.
All stock shaders only support morphing these 3 buffers, but note that MorphTargets can have any type of buffers.
If you want to use other types of buffers you will need a custom MorphControl and a custom shader.
Note that if morphed children are attached to or detached from the sub graph after the MorphControl is added to
spatial, you must detach and attach the control again for the changes to get reflected.
-
Field Summary
Fields inherited from class com.jme3.scene.control.AbstractControl
enabled, spatial -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloneFields(Cloner cloner, Object original) Callback fromClonerto convert this shallow-cloned Control into a deep-cloned one, using the specified Cloner and original to resolve copied fields.protected voidcontrolRender(RenderManager rm, ViewPort vp) To be implemented in subclass.protected voidcontrolUpdate(float tpf) To be implemented in subclass.booleanTest whether this Control approximates tangents.jmeClone()Create a shallow clone for the JME cloner.voidread(JmeImporter importer) De-serialize this Control from the specified importer, for example when loading from a J3O file.voidsetApproximateTangents(boolean approximateTangents) Alter whether this Control approximates tangents.voidsetSpatial(Spatial spatial) voidwrite(JmeExporter exporter) Serialize this Control to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.scene.control.AbstractControl
cloneForSpatial, getSpatial, isEnabled, render, setEnabled, update
-
Constructor Details
-
MorphControl
public MorphControl()
-
-
Method Details
-
setSpatial
- Specified by:
setSpatialin interfaceControl- Overrides:
setSpatialin classAbstractControl- Parameters:
spatial- the spatial to be controlled. This should not be called from user code.
-
controlUpdate
protected void controlUpdate(float tpf) Description copied from class:AbstractControlTo be implemented in subclass.- Specified by:
controlUpdatein classAbstractControl- Parameters:
tpf- time per frame (in seconds)
-
controlRender
Description copied from class:AbstractControlTo be implemented in subclass.- Specified by:
controlRenderin classAbstractControl- Parameters:
rm- the RenderManager rendering the controlled Spatial (not null)vp- the ViewPort being rendered (not null)
-
setApproximateTangents
public void setApproximateTangents(boolean approximateTangents) Alter whether this Control approximates tangents.- Parameters:
approximateTangents- true to approximate tangents, false to get them from a VertexBuffer
-
isApproximateTangents
public boolean isApproximateTangents()Test whether this Control approximates tangents.- Returns:
- true if approximating tangents, false if getting them from a VertexBuffer
-
cloneFields
Callback fromClonerto convert this shallow-cloned Control into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
cloneFieldsin interfaceJmeCloneable- Overrides:
cloneFieldsin classAbstractControl- Parameters:
cloner- the Cloner that's cloning this Control (not null, modified)original- the instance from which this Control was shallow-cloned (not null, unaffected)
-
jmeClone
Create a shallow clone for the JME cloner.- Specified by:
jmeClonein interfaceJmeCloneable- Overrides:
jmeClonein classAbstractControl- Returns:
- a new instance
-
read
De-serialize this Control from the specified importer, for example when loading from a J3O file.- Specified by:
readin interfaceSavable- Overrides:
readin classAbstractControl- Parameters:
importer- (not null)- Throws:
IOException- from the importer
-
write
Serialize this Control to the specified exporter, for example when saving to a J3O file.- Specified by:
writein interfaceSavable- Overrides:
writein classAbstractControl- Parameters:
exporter- (not null)- Throws:
IOException- from the exporter
-