3D view description modeled as a virtual camera. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.0 |
Inherits: |
Properties
- distance : double
- heading : double
- location : Point
- pitch : double
- roll : double
- transformationMatrix : TransformationMatrix
Signals
- distanceChanged()
- headingChanged()
- locationChanged()
- pitchChanged()
- rollChanged()
- transformationMatrixChanged()
Methods
- Camera elevate(double deltaAltitude)
- bool equals(Camera camera)
- Camera moveForward(double distance)
- Camera moveTo(Point location)
- Camera moveToward(Point targetPoint, double distance)
- Camera rotateAround(Point targetPoint, double deltaHeading, double deltaPitch, double deltaRoll)
- Camera rotateTo(double heading, double pitch, double roll)
- Camera zoomToward(Point targetPoint, double factor)
Detailed Description
A Camera contains the spatial parameters to set a 3D view on a Scene in a SceneView: a virtual camera's location, orientation and field of view. The Viewpoint contains a camera. See the API doc for Viewpoint for details of how it uses a Camera.
You can initialize the camera in several different ways: creating from a location, heading, pitch, pitch, roll, and an optional distance, or creating from transformation matrix. Each method of initialization is mutually exclusive.
Camera orientation
- The ENU (East-North-Up) ground reference frame is used.
- Heading is expressed in degrees of rotation around its Z axis, clockwise from north. Negative headings are allowed and heading can wrap around (i.e
361
wraps to a value of1
). - Pitch is expressed in degrees of rotation around its Y axis, from
0
looking straight down to180
looking straight up towards the sky. Negative pitches are not allowed, and the values do not wrap around. If the behavior of a negative pitch is required, then the corresponding transformation with positive pitch can be set instead. For example ifheading:0 pitch:-20 roll:0
is required, thenheading:180 pitch:20 roll:180
can be used instead. - Roll is expressed in degrees of rotation around its X axis, from
0
to360
, with0
being horizontal. - Field of view is the vertical angular extent of a given scene as imaged by the virtual camera.
- Distances for moveForward and moveToward are expressed in meters.
Camera transformation
A Camera object is immutable. The Camera type includes helper methods for advanced transformations of location and orientation. The result of the transformation is a new Camera object. Each transformation is based either solely on the camera's location and orientation, or in addition incorporates a reference to another location.
Transformations are applied in this order:
- Set the camera location to (x=0, y=0, z=0) with heading, pitch, and roll all set to zero.
- Set the camera to the new location.
- Set the heading.
- Set the pitch.
- Set the roll.
Default properties
This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.
Type | Default Property |
---|---|
Point | location |
TransformationMatrix | transformationMatrix (since Esri.ArcGISRuntime 100.6) |
Example:
Create a Camera to be used for setting the viewpoint on a SceneView:
Camera { id: camera heading: 10.0 pitch: 80.0 roll: 0.0 Point { x: 83.9 y: 28.4 z: 10010.0 spatialReference: SpatialReference { wkid: 4326 } } }
Property Documentation
The distance of this Camera.
This property is only populated if explicitly set. Cameras that are created and returned from the API will return NaN
.
The heading of this Camera.
See also Camera orientation.
[default] location : Point |
The location of this Camera.
The pitch of this Camera.
See also Camera orientation.
The roll of this Camera.
See also Camera orientation.
[default] transformationMatrix : TransformationMatrix |
The transformation matrix of this Camera.
The transformation matrix describes the camera's location and the direction it is looking. Setting this property with the location provided by ARKit/ARCore is necessary for enabling augmented reality.
It does not matter if the camera was created with a TransformationMatrix, the camera's location and orientation will be converted into a TransformationMatrix.
This property was introduced in Esri.ArcGISRuntime 100.6.
Signal Documentation
Emitted when the distance property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onDistanceChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the heading property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onHeadingChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the location property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onLocationChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the pitch property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onPitchChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the roll property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onRollChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the transformationMatrix property changes.
Note: The corresponding handler is onTransformationMatrixChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.6.
Method Documentation
Camera elevate(double deltaAltitude) |
Create a new Camera object with the same orientation and x,y location as this one, with altitude (z-value) changed by deltaAltitude.
bool equals(Camera camera) |
Returns whether this Camera and another camera are equivalent.
Camera moveForward(double distance) |
Create a Camera object with the same orientation as this one, but moved along its heading by distance meters.
Create a new Camera object with the same orientation as this one, moved to a new location.
Create a new Camera object with the same orientation as this one, moved toward a given targetPoint by a given distance in meters.
Note that targetPoint indicates the direction the camera should be moved. This is not the same thing as the direction that the camera should be oriented.
Create a new Camera object that is rotated around a target point.
- targetPoint - The location to rotate around.
- deltaHeading - The change in heading.
- deltaPitch - The change in pitch.
- deltaRoll - The change in roll.
The result of this transformation is a new camera with the following characteristics.
- The orientation of the camera is changed by the specified values of heading, pitch, and roll.
- The target point remains in the same relative location in the view.
- The camera location is the same distance from the target point.
See also Camera transformation.
Camera rotateTo(double heading, double pitch, double roll) |
Create a new Camera object with the same location as this one, with rotated orientation.
- heading - The new absolute heading.
- pitch - The new absolute pitch.
- roll - The new absolute roll.
See also Camera orientation.
Create a new Camera object with the view zoomed toward a specified point.
- targetPoint - The absolute point in space to zoom toward.
- factor - The zoom factor.