Class CurveLookAtController

java.lang.Object
com.ardor3d.scenegraph.controller.interpolation.CurveLookAtController
All Implemented Interfaces:
SpatialController<Spatial>, Serializable

public class CurveLookAtController extends Object implements SpatialController<Spatial>, Serializable
CurveLookAtController class rotates a spatial to 'look at' a curve.

This class assumes the given delegate curve interpolation controller is already added to a spatial and is getting automatically updated as part of the main loop. Therefore this class doesn't call update on the delegate controller.

See Also:
  • Constructor Details

    • CurveLookAtController

      public CurveLookAtController(CurveInterpolationController curveController)
      Creates a new instance of CurveLookAtController, with Vector3.UNIT_Y as the world up vector.
      Parameters:
      curveController - The curve interpolation controller that does the work of finding the correct position to look at, can not be null.
    • CurveLookAtController

      public CurveLookAtController(CurveInterpolationController curveController, ReadOnlyVector3 worldUp)
      Creates a new instance of CurveLookAtController.
      Parameters:
      curveController - The curve interpolation controller that does the work of finding the correct position to look at, can not be null.
      worldUp - The world up vector, can not be null.
  • Method Details

    • update

      public void update(double time, Spatial caller)
      Specified by:
      update in interface SpatialController<Spatial>
      Parameters:
      time - The time in seconds between the last call to update and the current one
      caller - The spatial currently executing this controller.
    • setWorldUp

      public void setWorldUp(ReadOnlyVector3 worldUp)
      Parameters:
      worldUp - The world up vector, can not be null.
    • setLocalRotation

      public void setLocalRotation(boolean localRotation)
      Parameters:
      localRotation - true to update local rotation, false to update world rotation.
      See Also:
    • isLocalRotation

      public boolean isLocalRotation()
      Returns:
      true if the local rotation is being updated, false if the world rotation is.
      See Also: