Class TLspModelElementTrackingPointProvider
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the models containing the objects tracked by this camera.doubleProvides the pitch angle (in degrees) to be used for orienting the camera, orDouble.Nanif no pitch could be calculated.Selects a target point that is to be followed by the camera, in world coordinates.doubleProvides the roll angle (in degrees) to be used for orienting the camera, orDouble.NaNif no roll could be calculated.doubleProvides the world rotation (yaw) angle (in degrees) to be used for orienting the camera.Object[]Returns the array of objects tracked by this camera.getView()Returns the view in which tracking is done.voidsetTrackedObjects(ILspView aView, Object[] aTrackedObjects, ILcdModel[] aModels) Sets the target objects that the camera must track.voidStops tracking the objects and models set insetTrackedObjects.Methods inherited from class com.luciad.view.lightspeed.camera.tracking.ALspTrackingPointProvider
addTrackingPointChangeListener, fireTrackingPointChange, removeTrackingPointChangeListener
-
Constructor Details
-
TLspModelElementTrackingPointProvider
public TLspModelElementTrackingPointProvider()
-
-
Method Details
-
getTrackedObjects
Returns the array of objects tracked by this camera.- Returns:
- the array of objects tracked by this camera.
-
getModels
Returns the models containing the objects tracked by this camera.- Returns:
- the models containing the objects tracked by this camera.
-
getView
Description copied from class:ALspTrackingPointProviderReturns the view in which tracking is done.- Specified by:
getViewin classALspTrackingPointProvider- Returns:
- the view in which tracking is done.
-
setTrackedObjects
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 asaTrackedObjects.- Throws:
IllegalArgumentException- when one of the arguments isnullor when the arrays have different sizes.
-
stopTracking
public void stopTracking()Stops tracking the objects and models set insetTrackedObjects. -
getTargetPoint
Description copied from class:ALspTrackingPointProviderSelects 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:
getTargetPointin classALspTrackingPointProvider- Returns:
- the selected target point, in world coordinates, or
nullif none was found.
-
getTargetYaw
public double getTargetYaw()Description copied from class:ALspTrackingPointProviderProvides the world rotation (yaw) angle (in degrees) to be used for orienting the camera. If no orientation can be calculated,Double.NaNshould be returned. This method can be used for 2D as well as 3D cameras.- Specified by:
getTargetYawin classALspTrackingPointProvider- Returns:
- the world rotation (yaw) angle (in degrees) to be used for orienting the camera or
Double.NaNif no orientation could be calculated.
-
getTargetPitch
public double getTargetPitch()Description copied from class:ALspTrackingPointProviderProvides the pitch angle (in degrees) to be used for orienting the camera, orDouble.Nanif no pitch could be calculated. This method should only be used for 3D cameras.- Specified by:
getTargetPitchin classALspTrackingPointProvider- Returns:
- the pitch angle (in degrees) to be used for orienting the camera.
-
getTargetRoll
public double getTargetRoll()Description copied from class:ALspTrackingPointProviderProvides the roll angle (in degrees) to be used for orienting the camera, orDouble.NaNif no roll could be calculated. This method should only be used for 3D camera.- Specified by:
getTargetRollin classALspTrackingPointProvider- Returns:
- the roll angle (in degrees) to be used for orienting the camera.
-