Class: Camera

Camera

The camera of the current map

new Camera (cameraProperties, target)

Name Type Description
cameraProperties SystemCameraProperties The system camera properties
target MapObject The camera target
Properties:
Name Type Description
threeCamera THREE.PerspectiveCamera The three.js camera
distance number The distance between the camera and the target
height number The y distance between the camera and the target
horizontalAngle number The horizontal angle of the camera
verticalAngle number The vertical angle of the camera
verticalRight boolean Used to loop the horizontal and vertical angle
target MapObject The camera target
targetPosition THREE.Vector3 The camera target position
targetOffset THREE.Vector3 The target offset position

Methods

getMapOrientation ()Orientation

Get the map orientation according to the camera
Returns:
Type Description
Orientation

getDistance ()number

Get the distance according to vertical angle
Returns:
Type Description
number

getHeight ()number

Get the height according to vertical angle
Returns:
Type Description
number

getHorizontalAngle (p1, p2)number

Get the horizontal angle between two positions
Name Type Description
p1 THREE.Vector3 The first position
p2 THREE.Vector3 The second position
Returns:
Type Description
number

getVerticalAngle (p1, p2)number

Get the vertical angle between two positions
Name Type Description
p1 THREE.Vector3 The first position
p2 THREE.Vector3 The second position
Returns:
Type Description
number

addVerticalAngle (a)

Add an angle to the vertical angle
Name Type Description
a THREE.Vector3 The angle to add

updateTargetPosition ()

Update the target position according to target and target offset

updateCameraPosition ()

Update the three.js camera position

updateTargetOffset ()

Update target offset position

updateAngles ()

Update horizontal and vertical angles

updateDistance ()

Update the distance

updateView ()

Update the three.js camera view

update ()

Update all the parameters