Class ALspCameraConstraint<T extends ALspViewXYZWorldTransformation>
- Direct Known Subclasses:
TLspAboveTerrainCameraConstraint3D,TLspLookAtTrackingCameraConstraint2D,TLspLookAtTrackingCameraConstraint3D,TLspLookFromTrackingCameraConstraint3D
Constraint for a view world transformation.
This abstract class makes it possible to constrain the transformation before it is
applied. An example could be a constraint which limits the scale, or which keeps the camera
above the terrain.
This abstract class can be implemented by overriding constrain.
fireConstraintChangeEvent can be called to
notify that this constraint has changed, and that the constrain method
should be evaluated again.
- Since:
- 2012.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstraintChangeListener(ILcdChangeListener aListener) Adds the givenConstraintChangeListener.abstract voidConstrains the given view world transformation.protected voidFires a constraint change to all listeners registered usingaddConstraintChangeListener.voidremoveConstraintChangeListener(ILcdChangeListener aListener) Removes the givenConstraintChangeListener.
-
Constructor Details
-
ALspCameraConstraint
public ALspCameraConstraint()
-
-
Method Details
-
addConstraintChangeListener
Adds the givenConstraintChangeListener.- Parameters:
aListener- a listener.
-
removeConstraintChangeListener
Removes the givenConstraintChangeListener.- Parameters:
aListener- a listener.
-
fireConstraintChangeEvent
protected void fireConstraintChangeEvent()Fires a constraint change to all listeners registered usingaddConstraintChangeListener. This method can be used to notify that theconstrainmethod should be evaluated again. -
constrain
Constrains the given view world transformation. This method can be implemented by modifying
aTargetSFCT.When the original view world transformation is modified, the changes are first applied on a copy of the transformation (
aTargetSFCT). This copy is passed to the constraints, which can also modify it. After all constraints are evaluated, all changes are applied on the original transformation.aSourceis the original transformation. It is given as context information.- Parameters:
aSource- the original transformation, on which all changes will be applied after all constraints are evaluated. It is given as context information.aTargetSFCT- the view transformation copy which contains the modifications. Constraints should be applied on this transformation.
-