Skip to content

Commit

Permalink
updated javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
codex128 committed Jan 20, 2024
1 parent 9c9c2d8 commit 83c95e5
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions jme3-core/src/main/java/com/jme3/anim/AlertArmatureMask.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@
import com.jme3.scene.Spatial;

/**
* Extension of {@link ArmatureMask}.
*
* <p>Provides a feature which checks higher layers for joint use before it
* approves the layer to use a joint.
* Mask that excludes joints from participating in the layer
* if a higher layer is using those joints in an animation.
*
* @author codex
*/
Expand All @@ -49,7 +47,7 @@ public class AlertArmatureMask extends ArmatureMask {
private boolean checkUpperLayers = true;

/**
* @param layer The layer this mask is targeted for. It is extremely important
* @param layer The layer this mask is targeted for. It is important
* that this match the name of the layer this mask is (or will be) part of. You
* can use {@link makeLayer} to ensure this.
* @param spatial Spatial containing necessary controls ({@link AnimComposer} and {@link SkinningControl})
Expand All @@ -60,6 +58,13 @@ public AlertArmatureMask(String layer, Spatial spatial) {
anim = spatial.getControl(AnimComposer.class);
skin = spatial.getControl(SkinningControl.class);
}
/**
* @param layer The layer this mask is targeted for. It is important
* that this match the name of the layer this mask is (or will be) part of. You
* can use {@link makeLayer} to ensure this.
* @param anim anim composer this mask is assigned to
* @param skin skinning control complimenting the anim composer.
*/
public AlertArmatureMask(String layer, AnimComposer anim, SkinningControl skin) {
super();
this.layer = layer;
Expand All @@ -68,15 +73,15 @@ public AlertArmatureMask(String layer, AnimComposer anim, SkinningControl skin)
}

/**
* Makes a layer for this mask.
* Makes a layer from this mask.
*/
public void makeLayer() {
anim.makeLayer(layer, this);
}

/**
* Adds all joints to this mask.
* @return
* @return this.instance
*/
public AlertArmatureMask addAll() {
for (Joint j : skin.getArmature().getJointList()) {
Expand All @@ -88,7 +93,7 @@ public AlertArmatureMask addAll() {
/**
* Adds the given joint and all its children to this mask.
* @param joint
* @return
* @return this instance
*/
public AlertArmatureMask addFromJoint(String joint) {
super.addFromJoint(skin.getArmature(), joint);
Expand All @@ -98,7 +103,7 @@ public AlertArmatureMask addFromJoint(String joint) {
/**
* Adds the given joints to this mask.
* @param joints
* @return
* @return this instance
*/
public AlertArmatureMask addJoints(String... joints) {
super.addBones(skin.getArmature(), joints);
Expand All @@ -111,7 +116,7 @@ public AlertArmatureMask addJoints(String... joints) {
* <p>Not checking is more efficient, but checking can avoid some
* interpolation issues between layers. Default=true
* @param check
* @return
* @return this instance
*/
public AlertArmatureMask setCheckUpperLayers(boolean check) {
checkUpperLayers = check;
Expand All @@ -131,15 +136,15 @@ public String getTargetLayer() {

/**
* Get the {@link AnimComposer} this mask is for.
* @return
* @return anim composer
*/
public AnimComposer getAnimComposer() {
return anim;
}

/**
* Get the {@link SkinningControl} this mask is for.
* @return
* @return skinning control
*/
public SkinningControl getSkinningControl() {
return skin;
Expand Down Expand Up @@ -190,20 +195,20 @@ else if (lyr.getMask().contains(target)) {

/**
* Creates an {@code AlertArmatureMask} for all joints.
* @param layer
* @param spatial
* @return
* @param layer layer the returned mask is, or will be, be assigned to
* @param spatial spatial containing anim composer and skinning control
* @return new mask
*/
public static AlertArmatureMask all(String layer, Spatial spatial) {
return new AlertArmatureMask(layer, spatial).addAll();
}

/**
* Creates an {@code AlertArmatureMask} for all joints.
* @param layer
* @param anim
* @param skin
* @return
* @param layer layer the returned mask is, or will be, assigned to
* @param anim anim composer
* @param skin skinning control
* @return new mask
*/
public static AlertArmatureMask all(String layer, AnimComposer anim, SkinningControl skin) {
return new AlertArmatureMask(layer, anim, skin).addAll();
Expand Down

0 comments on commit 83c95e5

Please sign in to comment.