Camera
-
class
Camera() Object representing a viewpoint from which the scene can be rendered. More information about using Camera can be found here.
Methods
-
Camera.copy() - copy():
CameraCreates a copy of the camera.
Returns:
Cameranew object initialized with the current values of this camera
-
Camera.dolly() - dolly(delta:
Point3): voidMove the camera along a delta
Parameters
delta:Point3Returns: void
-
Camera.equals() - equals(cam:
Camera): booleanReturns checks for equality with another camera
Parameters
cam:
Camerathe camera to compare againstReturns: boolean
-
Camera.equalsWithTolerance() - equalsWithTolerance(cam:
Camera, tolerance: number): booleanReturns checks for equality with another camera with tolerance
Parameters
Returns: boolean
-
Camera.getCameraPlaneIntersectionPoint() -
Finds the intersection point with the camera plane
Parameters
Returns: (None |
Point3)
-
Camera.getFullMatrix() Returns the camera’s projection matrix multiplied by its view matrix.
Parameters
viewer:
IWebViewerThe [[WebViewer]] for which the matrix should be valid.view:
IViewthe [[View]] to use when calculating projection effects. Uses default view if undefinedReturns:
Matrix
-
Camera.getHeight() - getHeight(): number
gets the camera height
Returns: number
the camera width
-
Camera.getNearLimit() - getNearLimit(): number
gets the camera near clipping limit
Returns: number
the camera near clipping limit
-
Camera.getPosition() - getPosition():
Point3gets the camera position
Returns:
Point3the camera position
-
Camera.getProjection() - getProjection():
Projectiongets the camera projection
Returns:
Projectionthe camera projection
-
Camera.getProjectionMatrix() Returns the camera’s projection matrix.
Parameters
viewer:
IWebViewerThe [[WebViewer]] for which the matrix should be valid.view:
IViewthe [[View]] to use when calculating projection effects. Uses default view if undefinedReturns:
Matrix
-
Camera.getViewMatrix() - getViewMatrix(viewer:
IWebViewer):MatrixReturns the camera’s view matrix. This matrix places the camera at
<0,0,0>, with the negative z-axis pointing toward the camera’s target and the y-axis in the direction of the camera’s up-vector.Parameters
viewer:
IWebViewerThe [[WebViewer]] for which the matrix should be valid.Returns:
Matrix
-
Camera.getWidth() - getWidth(): number
gets the camera width
Returns: number
the camera width
-
Camera.setHeight() - setHeight(height: number): void
Sets the camera height
Parameters
height: number
the new camera heightReturns: void
-
Camera.setNearLimit() - setNearLimit(nearLimit: number): void
Sets the camera near clipping limit
Parameters
nearLimit: number
the new camera near clipping limitReturns: void
-
Camera.setPosition() - setPosition(position:
Point3): voidSets the camera position
Parameters
position:
Point3the new camera positionReturns: void
-
Camera.setProjection() - setProjection(projection:
Projection): voidSets the camera projection
Parameters
projection:
Projectionthe new camera ProjectionReturns: void
-
Camera.setTarget() - setTarget(target:
Point3): voidSets the camera target
Parameters
target:
Point3the new camera targetReturns: void
-
Camera.setUp() - setUp(up:
Point3): voidSets the camera up vector
Parameters
up:
Point3the new camera up vectorReturns: void
-
Camera.setWidth() - setWidth(width: number): void
Sets the camera width
Parameters
width: number
the new camera widthReturns: void
-
Camera.toJson() - toJson(): object
Creates an object ready for JSON serialization.
Returns: object
The prepared object.
-
static Camera.create() static
create(pos:Point3, tar:Point3, up:Point3, projection:Projection, width: number, height: number, nearLimit: number):CameraCreates a new camera object with the given parameters.
Parameters
pos:
Point3the camera position.tar:
Point3the camera target.up:
Point3the camera up vector.projection:
Projectionthe camera projection mode.width: number
camera view width.height: number
camera view height.nearLimit: number
the camera near limit.Returns:
Cameraa new camera object.