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
-
Method Summary
Modifier and TypeMethodDescriptionReturns the models containing the objects tracked by this camera.double
Provides the pitch angle (in degrees) to be used for orienting the camera, orDouble.Nan
if no pitch could be calculated.Selects a target point that is to be followed by the camera, in world coordinates.double
Provides the roll angle (in degrees) to be used for orienting the camera, orDouble.NaN
if no roll could be calculated.double
Provides 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.void
setTrackedObjects
(ILspView aView, Object[] aTrackedObjects, ILcdModel[] aModels) Sets the target objects that the camera must track.void
Stops 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:ALspTrackingPointProvider
Returns the view in which tracking is done.- Specified by:
getView
in 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 isnull
or when the arrays have different sizes.
-
stopTracking
public void stopTracking()Stops tracking the objects and models set insetTrackedObjects
. -
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 classALspTrackingPointProvider
- 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 classALspTrackingPointProvider
- 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, orDouble.Nan
if no pitch could be calculated. This method should only be used for 3D cameras.- Specified by:
getTargetPitch
in classALspTrackingPointProvider
- 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, orDouble.NaN
if no roll could be calculated. This method should only be used for 3D camera.- Specified by:
getTargetRoll
in classALspTrackingPointProvider
- Returns:
- the roll angle (in degrees) to be used for orienting the camera.
-