Class TLspModelElementTrackingPointProvider

java.lang.Object
com.luciad.view.lightspeed.camera.tracking.ALspTrackingPointProvider
com.luciad.view.lightspeed.camera.tracking.TLspModelElementTrackingPointProvider

public class TLspModelElementTrackingPointProvider extends ALspTrackingPointProvider

This ALspTrackingPointProvider follows a given set of model elements.

The target world point is chosen at the center point of the bounds of the group of tracked objects.

The target world orientation corresponds to the orientation (in world coordinates) of the first ILcdOriented element found in the list of objects tracked by this camera.

The tracked objects can be set using setTrackedObjects. Tracking can be disabled by calling stopTracking.

Note: This tracking point provider only tracks the given model elements. It doesn't check if the used model element and respective models are actually in the view. This should be checked externally if needed.

Since:
2012.0
  • Constructor Details

    • TLspModelElementTrackingPointProvider

      public TLspModelElementTrackingPointProvider()
  • Method Details

    • getTrackedObjects

      public Object[] getTrackedObjects()
      Returns the array of objects tracked by this camera.
      Returns:
      the array of objects tracked by this camera.
    • getModels

      public ILcdModel[] getModels()
      Returns the models containing the objects tracked by this camera.
      Returns:
      the models containing the objects tracked by this camera.
    • getView

      public ILspView getView()
      Description copied from class: ALspTrackingPointProvider
      Returns the view in which tracking is done.
      Specified by:
      getView in class ALspTrackingPointProvider
      Returns:
      the view in which tracking is done.
    • setTrackedObjects

      public void setTrackedObjects(ILspView aView, Object[] aTrackedObjects, ILcdModel[] aModels)

      Sets the target objects that the camera must track.

      In order to stop tracking the objects and models passed in this method, stopTracking() should be called.

      Parameters:
      aView - the view for which this camera is used.
      aTrackedObjects - the tracked objects that the camera has to follow.
      aModels - the models the tracked objects belong to. This array must have the same size as aTrackedObjects.
      Throws:
      IllegalArgumentException - when one of the arguments is null or when the arrays have different sizes.
    • stopTracking

      public void stopTracking()
      Stops tracking the objects and models set in setTrackedObjects.
    • getTargetPoint

      public ILcdPoint getTargetPoint()
      Description copied from class: ALspTrackingPointProvider
      Selects a target point that is to be followed by the camera, in world coordinates. By implementing this method, users of this class can easily customize the selected target point.
      Specified by:
      getTargetPoint in class ALspTrackingPointProvider
      Returns:
      the selected target point, in world coordinates, or null if none was found.
    • getTargetYaw

      public double getTargetYaw()
      Description copied from class: ALspTrackingPointProvider
      Provides the world rotation (yaw) angle (in degrees) to be used for orienting the camera. If no orientation can be calculated, Double.NaN should be returned. This method can be used for 2D as well as 3D cameras.
      Specified by:
      getTargetYaw in class ALspTrackingPointProvider
      Returns:
      the world rotation (yaw) angle (in degrees) to be used for orienting the camera or Double.NaN if no orientation could be calculated.
    • getTargetPitch

      public double getTargetPitch()
      Description copied from class: ALspTrackingPointProvider
      Provides the pitch angle (in degrees) to be used for orienting the camera, or Double.Nan if no pitch could be calculated. This method should only be used for 3D cameras.
      Specified by:
      getTargetPitch in class ALspTrackingPointProvider
      Returns:
      the pitch angle (in degrees) to be used for orienting the camera.
    • getTargetRoll

      public double getTargetRoll()
      Description copied from class: ALspTrackingPointProvider
      Provides the roll angle (in degrees) to be used for orienting the camera, or Double.NaN if no roll could be calculated. This method should only be used for 3D camera.
      Specified by:
      getTargetRoll in class ALspTrackingPointProvider
      Returns:
      the roll angle (in degrees) to be used for orienting the camera.