Class TransformationMatrixCameraController
- java.lang.Object
-
- com.esri.arcgisruntime.mapping.view.CameraController
-
- com.esri.arcgisruntime.mapping.view.TransformationMatrixCameraController
-
public final class TransformationMatrixCameraController extends CameraController
Support camera navigation by using TransformationMatrix. Provides navigation by using TransformationMatrix to control the camera's location and rotation. This can be used with transformation matrices produced by Augmented Reality APIs like ARCore.- Since:
- 100.6.0
-
-
Constructor Summary
Constructors Constructor Description TransformationMatrixCameraController()
Creates an instance of TransformationMatrixCameraController.TransformationMatrixCameraController(Camera originCamera)
Creates an instance of TransformationMatrixCameraController from an origin Camera.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOriginCameraChangedListener(OriginCameraChangedListener listener)
Adds a listener for when the origin camera has changed.void
addTranslationFactorChangedListener(TranslationFactorChangedListener listener)
Adds a listener for when the translation factor has changed.double
getClippingDistance()
Gets the clipping distance from the originCamera in metres.Camera
getOriginCamera()
Returns Camera that describes the origin location.TransformationMatrix
getTransformationMatrix()
Gets the TransformationMatrix describing the current Camera's location relative to the origin camera.double
getTranslationFactor()
Gets the translation factor which will be multiplied into the TransformationMatrix.boolean
removeOriginCameraChangedListener(OriginCameraChangedListener listener)
Removes an origin camera changed listener.boolean
removeTranslationFactorChangedListener(TranslationFactorChangedListener listener)
Removes a translation factor changed listener.void
setClippingDistance(double clippingDistance)
Determines the clipping distance around the originCamera in metres.void
setOriginCamera(Camera originCamera)
Sets Camera that describes the origin location.void
setTransformationMatrix(TransformationMatrix transformationMatrix)
Sets the TransformationMatrix.void
setTranslationFactor(double translationFactor)
Sets the translation factor which will be multiplied into the TransformationMatrix.
-
-
-
Constructor Detail
-
TransformationMatrixCameraController
public TransformationMatrixCameraController()
Creates an instance of TransformationMatrixCameraController.When the controller is set on the scene view using
SceneView.setCameraController(CameraController)
, the interaction mode will change for the active navigation model and be located at the origin camera's location and point along its rotation. The default camera has no rotation and is located at 0,0,15e6 meters.- Since:
- 100.6.0
-
TransformationMatrixCameraController
public TransformationMatrixCameraController(Camera originCamera)
Creates an instance of TransformationMatrixCameraController from an origin Camera.When the controller is set on the scene view using
SceneView.setCameraController(CameraController)
, the interaction mode will change for the active navigation model and be located at theTransformationMatrix
's location and point along its rotation.- Parameters:
originCamera
- the origin camera describing the original location- Throws:
java.lang.IllegalArgumentException
- if originCamera is null- Since:
- 100.6.0
-
-
Method Detail
-
getOriginCamera
public Camera getOriginCamera()
Returns Camera that describes the origin location.- Returns:
- the origin camera describing the origin location
- Since:
- 100.6.0
-
setOriginCamera
public void setOriginCamera(Camera originCamera)
Sets Camera that describes the origin location.- Parameters:
originCamera
- the origin camera describing the origin location- Throws:
java.lang.IllegalArgumentException
- if the originCamera is null- Since:
- 100.6.0
-
getTransformationMatrix
public TransformationMatrix getTransformationMatrix()
Gets the TransformationMatrix describing the current Camera's location relative to the origin camera.- Returns:
- the TransformationMatrix describing the current Camera's location relative to the origin camera
- Since:
- 100.6.0
-
setTransformationMatrix
public void setTransformationMatrix(TransformationMatrix transformationMatrix)
Sets the TransformationMatrix. This moves the camera relative to the origin camera's location and orientation.- Parameters:
transformationMatrix
- the TransformationMatrix describing the Camera's location relative to the origin camera- Throws:
java.lang.IllegalArgumentException
- if the transformationMatrix is null- Since:
- 100.6.0
-
getTranslationFactor
public double getTranslationFactor()
Gets the translation factor which will be multiplied into the TransformationMatrix. Defaults to 1.0. Note this does not affect Camera rotation.- Returns:
- the translation factor affecting the Camera translation
- Since:
- 100.6.0
-
setTranslationFactor
public void setTranslationFactor(double translationFactor)
Sets the translation factor which will be multiplied into the TransformationMatrix. Setting the value to 3, for example, will cause position changes indicated by the TransformationMatrix property to be multiplied by 3. Note this does not affect Camera rotation.- Parameters:
translationFactor
- the translation factor to affect the Camera translation- Since:
- 100.6.0
-
getClippingDistance
public double getClippingDistance()
Gets the clipping distance from the originCamera in metres. The clipping distance determines the rendering distance from the originCamera. The default value is 0.0.- Returns:
- the clipping distance from the originCamera in metres.
- Since:
- 100.7.0
-
setClippingDistance
public void setClippingDistance(double clippingDistance)
Determines the clipping distance around the originCamera in metres. When the value is set to 0.0 there is no enforced clipping distance. Setting the value to 10.0 will only render things 10 metres around the originCamera.- Parameters:
clippingDistance
- the clipping distance around the originCamera in metres.- Since:
- 100.7.0
-
addOriginCameraChangedListener
public void addOriginCameraChangedListener(OriginCameraChangedListener listener)
Adds a listener for when the origin camera has changed.- Parameters:
listener
- the listener- Throws:
java.lang.IllegalArgumentException
- if the listener is null- Since:
- 100.6.0
-
removeOriginCameraChangedListener
public boolean removeOriginCameraChangedListener(OriginCameraChangedListener listener)
Removes an origin camera changed listener.- Parameters:
listener
- to remove- Returns:
- true if successful, otherwise false
- Since:
- 100.6.0
-
addTranslationFactorChangedListener
public void addTranslationFactorChangedListener(TranslationFactorChangedListener listener)
Adds a listener for when the translation factor has changed.- Parameters:
listener
- the listener- Throws:
java.lang.IllegalArgumentException
- if the listener is null- Since:
- 100.6.0
-
removeTranslationFactorChangedListener
public boolean removeTranslationFactorChangedListener(TranslationFactorChangedListener listener)
Removes a translation factor changed listener.- Parameters:
listener
- to remove- Returns:
- true if successful, otherwise false
- Since:
- 100.6.0
-
-