Camera
A Camera defines viewing and projection transforms for its Viewer.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public set |
|
|
public get |
center: * |
|
public set |
constrainPitch(constrainPitch: Boolean) Sets whether its currently possible to pitch the camera to look at the model upside-down. |
|
public get |
Gets whether its currently possible to pitch the camera to look at the model upside-down. |
|
public set |
eye(eye: Float32Array) Sets the position of the camera. |
|
public get |
eye: Float32Array: * Gets the position of the camera. |
|
public set |
gimbalLock(gimbalLock: Boolean) Sets whether camera rotation is gimbal locked. |
|
public get |
gimbalLock: Boolean: * Sets whether camera rotation is gimbal locked. |
|
public |
listeners: *[] |
|
public |
lowVolumeListeners: *[] |
|
public set |
|
|
public get |
orbitting: * |
|
public |
orthographic: * |
|
public |
perspective: * |
|
public get |
Gets the current projection transform matrix. |
|
public get |
Gets the component that represents the current projection type. |
|
public set |
projectionType(projectionType: String) Selects the current projection type. |
|
public get |
projectionType: String: * Gets the current projection type. |
|
public set |
target(target: Float32Array) Sets the point the camera is looking at. |
|
public get |
target: Float32Array: * Gets the point tha camera is looking at. |
|
public |
tempMat3b: * |
|
public |
tempMat4: * |
|
public |
tempVec3: * |
|
public |
tempVec3b: * |
|
public |
tempVec3c: * |
|
public |
tempVec3d: * |
|
public |
tempVec3e: * |
|
public |
tempVecBuild: * |
|
public |
|
|
public set |
up(up: Float32Array) Sets the camera's "up" direction. |
|
public get |
up: Float32Array: * Gets the camera's "up" direction. |
|
public get |
Gets the current viewing transform matrix. |
|
public get |
|
|
public get |
Gets the current viewing transform matrix for normals. |
|
public get |
Gets the current view projection matrix. |
|
public get |
Gets the current inverted view projection matrix. |
|
public |
viewer: * |
|
public set |
Indicates the up, right and forward axis of the World coordinate system. |
|
public get |
Indicates the up, right and forward axis of the World coordinate system. |
|
public get |
worldForward: * Direction of World-space "forwards". |
|
public get |
worldRight: * Direction of World-space "right". |
|
public get |
worldUp: * Direction of World-space "up". |
|
public |
yawMatrix: * |
Private Members | ||
private |
_center: * |
|
private |
|
|
private |
|
|
private |
_eye: * |
|
private |
|
|
private |
|
|
private |
_modelBounds: * |
|
private |
|
|
private |
|
|
private |
_projection: * |
|
private |
_target: * |
|
private |
_tmp_eye: * |
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
_tmp_target: * |
|
private |
_up: * |
|
private |
_viewMatrix: * |
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
_worldAxis: * |
|
private |
|
|
private |
_worldRight: * |
|
private |
_worldUp: * |
Method Summary
Public Methods | ||
public |
calcViewFit(aabb: *, fitFOV: *, eye: *, target: *) |
|
public |
|
|
public |
interpolateView(newEye: *, newTarget: *) |
|
public |
lock() |
|
public |
orbitPitch(degrees: Number) Rotates the eye position about the target position, pivoting around the right axis (orthogonal to up vector and eye->target vector). |
|
public |
Rotates the eye position about the target position, pivoting around the up vector. |
|
public |
Pans the camera along the camera's local X, Y and Z axis. |
|
public |
Rotates the target position about the eye, pivoting around the right axis (orthogonal to up vector and eye->target vector). |
|
public |
restore(params: *) |
|
public |
setModelBounds(bounds: *) |
|
public |
unlock() |
|
public |
|
|
public |
viewFit(aabb: Float32Array, fitFOV: Number) Jumps the camera to look at the given axis-aligned World-space bounding box. |
|
public |
Moves the camera along a ray through unprojected mouse coordinates |
Private Methods | ||
private |
_build() |
|
private |
|
Public Constructors
public constructor() source
Public Members
public set center source
public get center: * source
public set constrainPitch(constrainPitch: Boolean) source
Sets whether its currently possible to pitch the camera to look at the model upside-down.
When this is true, camera will ignore attempts to orbit (camera or model) about the horizontal axis that would result in the model being viewed upside-down.
public get constrainPitch: Boolean: * source
Gets whether its currently possible to pitch the camera to look at the model upside-down.
public set gimbalLock(gimbalLock: Boolean) source
Sets whether camera rotation is gimbal locked.
When true, yaw rotation will always pivot about the World-space "up" axis.
public get gimbalLock: Boolean: * source
Sets whether camera rotation is gimbal locked.
When true, yaw rotation will always pivot about the World-space "up" axis.
public listeners: *[] source
public lowVolumeListeners: *[] source
public set orbitting source
public get orbitting: * source
public orthographic: * source
public perspective: * source
public get projection: Perspective | Orthographic: * source
Gets the component that represents the current projection type.
public tempMat3b: * source
public tempMat4: * source
public tempVec3: * source
public tempVec3b: * source
public tempVec3c: * source
public tempVec3d: * source
public tempVec3e: * source
public tempVecBuild: * source
public tmp_modelBounds: * source
public get viewMatrixInverted: * source
public get viewNormalMatrix: Float32Array: * source
Gets the current viewing transform matrix for normals.
This is the transposed inverse of the view matrix.
public get viewProjMatrixInverted: Float32Array: * source
Gets the current inverted view projection matrix.
public viewer: * source
public set worldAxis: Float32Array source
Indicates the up, right and forward axis of the World coordinate system.
This is used for deriving rotation axis for yaw orbiting, and for moving camera to axis-aligned positions.
Has format: [rightX, rightY, rightZ, upX, upY, upZ, forwardX, forwardY, forwardZ]
public get worldAxis: Float32Array source
Indicates the up, right and forward axis of the World coordinate system.
This is used for deriving rotation axis for yaw orbiting, and for moving camera to axis-aligned positions.
Has format: [rightX, rightY, rightZ, upX, upY, upZ, forwardX, forwardY, forwardZ]
public yawMatrix: * source
Private Members
private _center: * source
private _eye: * source
private _modelBounds: * source
private _negatedCenter: * source
private _projection: * source
private _target: * source
private _tmp_eye: * source
private _tmp_interpolate_a: * source
private _tmp_interpolate_b: * source
private _tmp_interpolate_c: * source
private _tmp_interpolate_current_dir: * source
private _tmp_interpolate_d: * source
private _tmp_interpolate_e: * source
private _tmp_interpolate_f: * source
private _tmp_interpolate_new_dir: * source
private _tmp_target: * source
private _up: * source
private _viewMatrix: * source
private _viewMatrixInverted: * source
private _viewNormalMatrix: * source
private _viewProjMatrix: * source
private _viewProjMatrixInverted: * source
private _worldAxis: * source
private _worldForward: * source
private _worldRight: * source
private _worldUp: * source
Public Methods
public calcViewFit(aabb: *, fitFOV: *, eye: *, target: *) source
Params:
Name | Type | Attribute | Description |
aabb | * | ||
fitFOV | * | ||
eye | * | ||
target | * |
public forceBuild() source
public interpolateView(newEye: *, newTarget: *) source
Params:
Name | Type | Attribute | Description |
newEye | * | ||
newTarget | * |
public lock() source
public orbitPitch(degrees: Number) source
Rotates the eye position about the target position, pivoting around the right axis (orthogonal to up vector and eye->target vector).
Params:
Name | Type | Attribute | Description |
degrees | Number | Angle of rotation in degrees |
public orbitYaw(degrees: Number) source
Rotates the eye position about the target position, pivoting around the up vector.
Params:
Name | Type | Attribute | Description |
degrees | Number | Angle of rotation in degrees |
public pan(pan: Array) source
Pans the camera along the camera's local X, Y and Z axis.
Params:
Name | Type | Attribute | Description |
pan | Array | The pan vector |
public pitch(degrees: Number) source
Rotates the target position about the eye, pivoting around the right axis (orthogonal to up vector and eye->target vector).
Params:
Name | Type | Attribute | Description |
degrees | Number | Angle of rotation in degrees |
public restore(params: *) source
Params:
Name | Type | Attribute | Description |
params | * |
public setModelBounds(bounds: *) source
Params:
Name | Type | Attribute | Description |
bounds | * |
public unlock() source
public updateLowVolumeListeners() source
public viewFit(aabb: Float32Array, fitFOV: Number) source
Jumps the camera to look at the given axis-aligned World-space bounding box.
Params:
Name | Type | Attribute | Description |
aabb | Float32Array | The axis-aligned World-space bounding box (AABB). |
|
fitFOV | Number | Field-of-view occupied by the AABB when the camera has fitted it to view. |
public zoom(delta: Number, canvasPos: *) source
Moves the camera along a ray through unprojected mouse coordinates
Params:
Name | Type | Attribute | Description |
delta | Number | Zoom increment |
|
canvasPos | * | Mouse position relative to canvas to determine ray along which to move |