Class: ViewAngles

PD. ViewAngles

Stores highly dynamic data about the current camera angles and view axis.

This class encapsulates the data required to define the current camera position, its target look-at point, the azimuth, altitude and field of view angles, and the view distance. The values in this class are typically updated up to 60 times a second as the user interacts with the scene view, so they are stored separately from other view data in order to be updated quickly.

This data is key to the PD.CameraController and PD.ViewController classes that manage and control the current scene view. However, it is also data that must be stored within BIM.DrawingView instances so that views can be accurately replicated when the user selects them.


new ViewAngles()

Creates a new view angles instance.

Author:
  • drajmarsh

Members


:number

altitude

The altitude angle of the camera relative to the view target, in degrees (-90 to 90).

The altitude angle is measure vertically above the horizontal plane.

Type
  • number

:number

azimuth

The azimuth angle of the camera relative to the view target, in degrees (-180 to 180).

The azimuth angle is measured in an anti-clockwise direction from the positive X axis.

Type
  • number

:THREE.Vector3

cameraPos

The position of the camera in model space.

Type
  • THREE.Vector3

:number

fov

The field of view angle of the camera, in degrees (0.1 to 160).

Type
  • number

:boolean

isViewAngles <readonly>

A flag identifying this object as a view angles instance.

Type
  • boolean

:boolean

lockCamera

Maintain relative camera/target vector when moving the target position.

Type
  • boolean

:THREE.Vector3

targetPos

The position of the look-at point in model space.

Type
  • THREE.Vector3

:number

zoom

Stores the relative view zoom as a multiplier factor.

Type
  • number

Methods


copyViewAnglesFrom(data)

Copies data from the given instance to this instance.

Parameters:
Name Type Description
data PD.ViewAngles | object

The view state instance to copy data from.

Returns:

Returns this view angles instance to support method chaining.

Type
PD.ViewAngles

copyViewAnglesTo(data)

Copies data from this instance to another given instance.

Parameters:
Name Type Description
data PD.ViewAngles | object

The object instance to copy data to.

Returns:

Returns this view angles instance to support method chaining.

Type
PD.ViewAngles

fromJSON(data)

Safely copy properties from a source object.

See the PD.Base#fromJSON method for more details.

Parameters:
Name Type Description
data object

The source object containing data to copy.

Returns:

Returns this instance to support method chaining.

Type
PD.View

toJSON( [data])

Converts the object instance to a simple POJO for JSON storage.

This method is used to copy, store and save the data for ths object, so the returned object must have all the properties required be able to rebuild this instance in its entirety when passed to the class constructor.

See the PD.Base#toJSON method for more details.

Parameters:
Name Type Argument Description
data object <optional>

An optional parent object to append this data to.

Returns:

Returns a JSON object.

Type
object