@@ -65,6 +65,9 @@ public class AnimComposer extends AbstractControl {
6565 private float globalSpeed = 1f ;
6666 private Map <String , Layer > layers = new LinkedHashMap <>();
6767
68+ /**
69+ * Instantiate a composer with a single layer, no actions, and no clips.
70+ */
6871 public AnimComposer () {
6972 layers .put (DEFAULT_LAYER , new Layer (this ));
7073 }
@@ -314,6 +317,12 @@ public Action removeAction(String name) {
314317 return actions .remove (name );
315318 }
316319
320+ /**
321+ * Add a layer to this composer.
322+ *
323+ * @param name the desired name for the new layer
324+ * @param mask the desired mask for the new layer (alias created)
325+ */
317326 public void makeLayer (String name , AnimationMask mask ) {
318327 Layer l = new Layer (this );
319328 l .mask = mask ;
@@ -363,6 +372,9 @@ public BlendAction actionBlended(String name, BlendSpace blendSpace, String... c
363372 return action ;
364373 }
365374
375+ /**
376+ * Reset all layers to t=0 with no current action.
377+ */
366378 public void reset () {
367379 for (Layer layer : layers .values ()) {
368380 layer .currentAction = null ;
@@ -391,6 +403,11 @@ public Set<String> getAnimClipsNames() {
391403 return Collections .unmodifiableSet (animClipMap .keySet ());
392404 }
393405
406+ /**
407+ * used internally
408+ *
409+ * @param tpf time per frame (in seconds)
410+ */
394411 @ Override
395412 protected void controlUpdate (float tpf ) {
396413 for (Layer layer : layers .values ()) {
@@ -410,19 +427,40 @@ protected void controlUpdate(float tpf) {
410427 }
411428 }
412429
430+ /**
431+ * used internally
432+ *
433+ * @param rm the RenderManager rendering the controlled Spatial (not null)
434+ * @param vp the ViewPort being rendered (not null)
435+ */
413436 @ Override
414437 protected void controlRender (RenderManager rm , ViewPort vp ) {
415438
416439 }
417440
441+ /**
442+ * Determine the global speed applied to all layers.
443+ *
444+ * @return the speed factor (1=normal speed)
445+ */
418446 public float getGlobalSpeed () {
419447 return globalSpeed ;
420448 }
421449
450+ /**
451+ * Alter the global speed applied to all layers.
452+ *
453+ * @param globalSpeed the desired speed factor (1=normal speed, default=1)
454+ */
422455 public void setGlobalSpeed (float globalSpeed ) {
423456 this .globalSpeed = globalSpeed ;
424457 }
425458
459+ /**
460+ * Create a shallow clone for the JME cloner.
461+ *
462+ * @return a new instance
463+ */
426464 @ Override
427465 public Object jmeClone () {
428466 try {
@@ -433,6 +471,15 @@ public Object jmeClone() {
433471 }
434472 }
435473
474+ /**
475+ * Callback from {@link com.jme3.util.clone.Cloner} to convert this
476+ * shallow-cloned composer into a deep-cloned one, using the specified
477+ * Cloner and original to resolve copied fields.
478+ *
479+ * @param cloner the Cloner that's cloning this composer (not null)
480+ * @param original the instance from which this composer was shallow-cloned
481+ * (not null, unaffected)
482+ */
436483 @ Override
437484 public void cloneFields (Cloner cloner , Object original ) {
438485 super .cloneFields (cloner , original );
@@ -456,6 +503,13 @@ public void cloneFields(Cloner cloner, Object original) {
456503
457504 }
458505
506+ /**
507+ * De-serialize this composer from the specified importer, for example when
508+ * loading from a J3O file.
509+ *
510+ * @param im the importer to use (not null)
511+ * @throws IOException from the importer
512+ */
459513 @ Override
460514 @ SuppressWarnings ("unchecked" )
461515 public void read (JmeImporter im ) throws IOException {
@@ -465,6 +519,13 @@ public void read(JmeImporter im) throws IOException {
465519 globalSpeed = ic .readFloat ("globalSpeed" , 1f );
466520 }
467521
522+ /**
523+ * Serialize this composer to the specified exporter, for example when
524+ * saving to a J3O file.
525+ *
526+ * @param ex the exporter to use (not null)
527+ * @throws IOException from the exporter
528+ */
468529 @ Override
469530 public void write (JmeExporter ex ) throws IOException {
470531 super .write (ex );
0 commit comments