Package com.jme3.anim

Class SingleLayerInfluenceMask

java.lang.Object
com.jme3.anim.ArmatureMask
com.jme3.anim.SingleLayerInfluenceMask
All Implemented Interfaces:
AnimationMask

public class SingleLayerInfluenceMask extends ArmatureMask
Mask that excludes joints from participating in the layer if a higher layer is using those joints in an animation.
  • Constructor Details

    • SingleLayerInfluenceMask

      public SingleLayerInfluenceMask(String layer, Spatial spatial)
      Parameters:
      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 makeLayer() to ensure this.
      spatial - Spatial containing necessary controls (AnimComposer and SkinningControl)
    • SingleLayerInfluenceMask

      public SingleLayerInfluenceMask(String layer, AnimComposer anim, SkinningControl skin)
      Parameters:
      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 makeLayer() to ensure this.
      anim - anim composer this mask is assigned to
      skin - skinning control complimenting the anim composer.
  • Method Details

    • makeLayer

      public void makeLayer()
      Makes a layer from this mask.
    • addAll

      public SingleLayerInfluenceMask addAll()
      Adds all joints to this mask.
      Returns:
      this.instance
    • addFromJoint

      public SingleLayerInfluenceMask addFromJoint(String joint)
      Adds the given joint and all its children to this mask.
      Parameters:
      joint -
      Returns:
      this instance
    • addJoints

      public SingleLayerInfluenceMask addJoints(String... joints)
      Adds the given joints to this mask.
      Parameters:
      joints -
      Returns:
      this instance
    • setCheckUpperLayers

      public SingleLayerInfluenceMask setCheckUpperLayers(boolean check)
      Makes this mask check if each joint is being used by a higher layer before it uses them.

      Not checking is more efficient, but checking can avoid some interpolation issues between layers. Default=true

      Parameters:
      check -
      Returns:
      this instance
    • getTargetLayer

      public String getTargetLayer()
      Get the layer this mask is targeted for.

      It is extremely important that this value match the actual layer this is included in, because checking upper layers may not work if they are different.

      Returns:
      target layer
    • getAnimComposer

      public AnimComposer getAnimComposer()
      Get the AnimComposer this mask is for.
      Returns:
      anim composer
    • getSkinningControl

      public SkinningControl getSkinningControl()
      Get the SkinningControl this mask is for.
      Returns:
      skinning control
    • isCheckUpperLayers

      public boolean isCheckUpperLayers()
      Returns true if this mask is checking upper layers for joint use.
      Returns:
    • contains

      public boolean contains(Object target)
      Description copied from interface: AnimationMask
      Test whether the animation should be applied to the specified element.
      Specified by:
      contains in interface AnimationMask
      Overrides:
      contains in class ArmatureMask
      Parameters:
      target - the target element
      Returns:
      true if animation should be applied, otherwise false
    • all

      public static SingleLayerInfluenceMask all(String layer, Spatial spatial)
      Creates an SingleLayerInfluenceMask for all joints.
      Parameters:
      layer - layer the returned mask is, or will be, be assigned to
      spatial - spatial containing anim composer and skinning control
      Returns:
      new mask
    • all

      public static SingleLayerInfluenceMask all(String layer, AnimComposer anim, SkinningControl skin)
      Creates an SingleLayerInfluenceMask for all joints.
      Parameters:
      layer - layer the returned mask is, or will be, assigned to
      anim - anim composer
      skin - skinning control
      Returns:
      new mask