Class SpatialTweens

java.lang.Object
com.simsilica.lemur.anim.SpatialTweens

public class SpatialTweens extends Object
Static utility methods for creating common Spatial-related Tween objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Tween
    attach(Spatial target, Spatial parent)
    Creates a Tween that will attach the specified spatial to the specified parent when executed with any value of t greater than or equal to 0.
    static Tween
    detach(Spatial target)
    Creates a Tween that will detach the specified spatial when executed with any value of t greater than or equal to 0.
    static Tween
    focusOn(Spatial target)
    Sets the focus to the specified spatial.
    static Tween
    move(Spatial target, Vector3f from, Vector3f to)
    Creates a tween that will interpolate the location of the specified target from one location to another.
    static Tween
    move(Spatial target, Vector3f from, Vector3f to, double length)
    Creates a tween that will interpolate the location of the specified target from one location to another.
    static Tween
    rotate(Spatial target, Quaternion from, Quaternion to, double length)
    Creates a tween that will interpolate the rotation of the specified target from one rotation to another.
    static Tween
    scale(Spatial target, float from, float to, double length)
    Creates a tween that will interpolate the overall scale of the specified target from one scale to another.
    static Tween
    scale(Spatial target, Vector3f from, Vector3f to, double length)
    Creates a tween that will interpolate the scale of the specified target from one scale to another.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpatialTweens

      public SpatialTweens()
  • Method Details

    • move

      public static Tween move(Spatial target, Vector3f from, Vector3f to)
      Creates a tween that will interpolate the location of the specified target from one location to another. If either location is null then they will be substituted with the Spatial's current local translation AT THE TIME OF THIS CALL. This method will use the distance between the two locations as the tween length. This makes it easier to create a sequence of movements that all move at the same speed. The overall sequence can always be rescaled to fit whatever outer time constraints required.
    • move

      public static Tween move(Spatial target, Vector3f from, Vector3f to, double length)
      Creates a tween that will interpolate the location of the specified target from one location to another. If either location is null then they will be substituted with the Spatial's current local translation AT THE TIME OF THIS CALL.
    • rotate

      public static Tween rotate(Spatial target, Quaternion from, Quaternion to, double length)
      Creates a tween that will interpolate the rotation of the specified target from one rotation to another. If either rotation is null then they will be substituted with the Spatial's current local rotation AT THE TIME OF THIS CALL.
    • scale

      public static Tween scale(Spatial target, float from, float to, double length)
      Creates a tween that will interpolate the overall scale of the specified target from one scale to another.
    • scale

      public static Tween scale(Spatial target, Vector3f from, Vector3f to, double length)
      Creates a tween that will interpolate the scale of the specified target from one scale to another. If either scale is null then they will be substituted with the Spatial's current local scale AT THE TIME OF THIS CALL.
    • detach

      public static Tween detach(Spatial target)
      Creates a Tween that will detach the specified spatial when executed with any value of t greater than or equal to 0. (Note: internally this just calls Tweens.callMethod().)
    • attach

      public static Tween attach(Spatial target, Spatial parent)
      Creates a Tween that will attach the specified spatial to the specified parent when executed with any value of t greater than or equal to 0. (Note: internally this just calls Tweens.callMethod().)
    • focusOn

      public static Tween focusOn(Spatial target)
      Sets the focus to the specified spatial.