Camera
Models the extrinsic (position/orientation) and intrinsic (projection) parameters of a camera.
See
Extends
Properties
| Property | Type | Description |
|---|---|---|
fovY | number | Camera vertical field of view in degrees. Setting this also updates the horizontal FOV with respect to the aspect ratio. |
mode | CameraMode | The intrinsic camera mode. |
position | vec3 | The camera location in the world coordinate system. |
upVector | vec3 | The camera's up direction vector in the world coordinate system. |
lookVector | vec3 | The camera's look direction vector in the world coordinate system. |
Methods
| Method | Description |
|---|---|
| setVectors() | Set position, look vector and up vector at once. |
| setLookAt() | Set eye position, look center and up vector at once. |
| glViewMatrix() | Get the GlView view matrix describing the camera's parameters. |
Inherited from ClassHandle
| Method | Description |
|---|---|
| isAliasOf() | Returns true if this handle and other alias the same underlying C++ object. |
| delete() | Releases this JavaScript handle. |
| deleteLater() | Schedules this handle for deferred deletion and returns this handle. |
| isDeleted() | Returns true if this handle has already been deleted. |
| [dispose]() | Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually. |
| clone() | Returns a new JavaScript handle aliasing the same underlying C++ object. |
setVectors()
ts
setVectors(
position: vec3,
lookVector: vec3,
upVector: vec3): void;Set position, look vector and up vector at once.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vec3 | World coordinates of the camera location. |
lookVector | vec3 | World coordinates of the camera viewing direction. |
upVector | vec3 | Camera's up direction vector. |
Returns
void
setLookAt()
ts
setLookAt(
position: vec3,
center: vec3,
upVector: vec3): void;Set eye position, look center and up vector at once.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | vec3 | World coordinates of the camera location. |
center | vec3 | World coordinates of the point to look at. |
upVector | vec3 | Camera's up direction vector. |
Returns
void
glViewMatrix()
ts
glViewMatrix(): mat4;Get the GlView view matrix describing the camera's parameters. View matrix is from OpenGL camera coordinate system to world.