It is possible to constrain the navigation in a view, so that limitations are imposed on the boundaries of the view as displayed on screen. You can achieve this by installing a camera constraint on the view-to-world transformation. The main constraint class is ALspCameraConstraint.'

The main camera constraint implementations are:

Program: Adding a camera constraint to the view to world transformation demonstrates how to install a camera constraint on a view to world transformation.

Program: Adding a camera constraint to the view to world transformation (from samples/lightspeed/trackingcamera/MainPanel)
TLspViewXYZWorldTransformation3D transformation = new TLspViewXYZWorldTransformation3D(aView);
transformation.addConstraint(new TLspAboveTerrainCameraConstraint3D());

The samples.lightspeed.limitnavigation.MainPanel sample shows how you can create a custom camera constraint to limit navigation in the view. It contains a 2D and 3D constraint that:

  • Limits the scale

  • Makes sure that the camera always looks inside an area of interest

  • Makes sure that he camera is oriented in such a way that North is always up