Camera

actual class Camera

Camera represents the eye(s) through which the scene is viewed.

A Camera has a position and orientation and controls projection and exposure. For stereoscopic rendering, a Camera maintains two separate "eyes" (Eye 0 and Eye 1).

Coordinate system: Camera points towards its -Z axis; +Y is up, +X is right. Near/far planes are at -distance(near) and -distance(far) in view space.

Depth-buffer precision: Near plane distance greatly affects depth precision. Use the largest possible near distance; typical ratios: 1:100 to 1:100000 (near:far).

Exposure: Camera exposure (aperture, shutter speed, sensitivity) controls overall scene brightness, interacting with light intensities just like a real camera.

Stereoscopic rendering: The Camera's transform defines "head" space. Each eye's transform relative to head space is set via setEyeModelMatrix, and each eye can have its own projection matrix via setCustomEyeProjection.

expect class Camera

Camera represents the eye(s) through which the scene is viewed.

A Camera has a position and orientation and controls projection and exposure. For stereoscopic rendering, a Camera maintains two separate "eyes" (Eye 0 and Eye 1).

Coordinate system: Camera points towards its -Z axis; +Y is up, +X is right. Near/far planes are at -distance(near) and -distance(far) in view space.

Depth-buffer precision: Near plane distance greatly affects depth precision. Use the largest possible near distance; typical ratios: 1:100 to 1:100000 (near:far).

Exposure: Camera exposure (aperture, shutter speed, sensitivity) controls overall scene brightness, interacting with light intensities just like a real camera.

Stereoscopic rendering: The Camera's transform defines "head" space. Each eye's transform relative to head space is set via setEyeModelMatrix, and each eye can have its own projection matrix via setCustomEyeProjection.

actual class Camera(jsCamera: Camera, _entity: Entity = 0)

Camera represents the eye(s) through which the scene is viewed.

A Camera has a position and orientation and controls projection and exposure. For stereoscopic rendering, a Camera maintains two separate "eyes" (Eye 0 and Eye 1).

Coordinate system: Camera points towards its -Z axis; +Y is up, +X is right. Near/far planes are at -distance(near) and -distance(far) in view space.

Depth-buffer precision: Near plane distance greatly affects depth precision. Use the largest possible near distance; typical ratios: 1:100 to 1:100000 (near:far).

Exposure: Camera exposure (aperture, shutter speed, sensitivity) controls overall scene brightness, interacting with light intensities just like a real camera.

Stereoscopic rendering: The Camera's transform defines "head" space. Each eye's transform relative to head space is set via setEyeModelMatrix, and each eye can have its own projection matrix via setCustomEyeProjection.

actual class Camera

Camera represents the eye(s) through which the scene is viewed.

A Camera has a position and orientation and controls projection and exposure. For stereoscopic rendering, a Camera maintains two separate "eyes" (Eye 0 and Eye 1).

Coordinate system: Camera points towards its -Z axis; +Y is up, +X is right. Near/far planes are at -distance(near) and -distance(far) in view space.

Depth-buffer precision: Near plane distance greatly affects depth precision. Use the largest possible near distance; typical ratios: 1:100 to 1:100000 (near:far).

Exposure: Camera exposure (aperture, shutter speed, sensitivity) controls overall scene brightness, interacting with light intensities just like a real camera.

Stereoscopic rendering: The Camera's transform defines "head" space. Each eye's transform relative to head space is set via setEyeModelMatrix, and each eye can have its own projection matrix via setCustomEyeProjection.

actual class Camera

Camera represents the eye(s) through which the scene is viewed.

A Camera has a position and orientation and controls projection and exposure. For stereoscopic rendering, a Camera maintains two separate "eyes" (Eye 0 and Eye 1).

Coordinate system: Camera points towards its -Z axis; +Y is up, +X is right. Near/far planes are at -distance(near) and -distance(far) in view space.

Depth-buffer precision: Near plane distance greatly affects depth precision. Use the largest possible near distance; typical ratios: 1:100 to 1:100000 (near:far).

Exposure: Camera exposure (aperture, shutter speed, sensitivity) controls overall scene brightness, interacting with light intensities just like a real camera.

Stereoscopic rendering: The Camera's transform defines "head" space. Each eye's transform relative to head space is set via setEyeModelMatrix, and each eye can have its own projection matrix via setCustomEyeProjection.

Constructors

Link copied to clipboard
constructor(jsCamera: Camera, _entity: Entity = 0)

Types

Link copied to clipboard
actual enum Fov : Enum<Camera.Fov>

Field-of-view axis direction.

expect enum Fov : Enum<Camera.Fov>

Field-of-view axis direction.

actual enum Fov : Enum<Camera.Fov>

Field-of-view axis direction.

actual enum Fov : Enum<Camera.Fov>

Field-of-view axis direction.

actual enum Fov : Enum<Camera.Fov>

Field-of-view axis direction.

Link copied to clipboard

Projection type for the camera frustum.

Projection type for the camera frustum.

Projection type for the camera frustum.

Projection type for the camera frustum.

Projection type for the camera frustum.

Properties

Link copied to clipboard
actual val aperture: Float

Get the camera's aperture in f-stops.

expect val aperture: Float

Get the camera's aperture in f-stops.

actual val aperture: Float

Get the camera's aperture in f-stops.

actual val aperture: Float

Get the camera's aperture in f-stops.

actual val aperture: Float

Get the camera's aperture in f-stops.

Link copied to clipboard
actual val cullingFar: Float

Get the camera's far plane distance used for culling. Note: for rendering, the far plane is set to infinity internally for depth precision.

expect val cullingFar: Float

Get the camera's far plane distance used for culling. Note: for rendering, the far plane is set to infinity internally for depth precision.

actual val cullingFar: Float

Get the camera's far plane distance used for culling. Note: for rendering, the far plane is set to infinity internally for depth precision.

actual val cullingFar: Float

Get the camera's far plane distance used for culling. Note: for rendering, the far plane is set to infinity internally for depth precision.

actual val cullingFar: Float

Get the camera's far plane distance used for culling. Note: for rendering, the far plane is set to infinity internally for depth precision.

Link copied to clipboard
actual val entity: Entity

Get the entity representing this camera.

expect val entity: Entity

Get the entity representing this camera.

actual val entity: Entity

Get the entity representing this camera.

actual val entity: Entity

Get the entity representing this camera.

actual val entity: Entity

Get the entity representing this camera.

Link copied to clipboard
actual val focalLength: Double

Get the camera's focal length in meters for a 35mm reference sensor. Computed from Eye 0's projection matrix.

expect val focalLength: Double

Get the camera's focal length in meters for a 35mm reference sensor. Computed from Eye 0's projection matrix.

actual val focalLength: Double

Get the camera's focal length in meters for a 35mm reference sensor. Computed from Eye 0's projection matrix.

actual val focalLength: Double

Get the camera's focal length in meters for a 35mm reference sensor. Computed from Eye 0's projection matrix.

actual val focalLength: Double

Get the camera's focal length in meters for a 35mm reference sensor. Computed from Eye 0's projection matrix.

Link copied to clipboard
actual var focusDistance: Float

Set the focus distance for depth-of-field post-processing.

expect var focusDistance: Float

Set the focus distance for depth-of-field post-processing.

actual var focusDistance: Float

Set the focus distance for depth-of-field post-processing.

actual var focusDistance: Float

Set the focus distance for depth-of-field post-processing.

actual var focusDistance: Float

Set the focus distance for depth-of-field post-processing.

Link copied to clipboard
val nativeCamera: Camera
Link copied to clipboard
actual val near: Float

Get the camera's near plane distance. Affects depth-buffer precision significantly; use the largest value possible.

expect val near: Float

Get the camera's near plane distance. Affects depth-buffer precision significantly; use the largest value possible.

actual val near: Float

Get the camera's near plane distance. Affects depth-buffer precision significantly; use the largest value possible.

actual val near: Float

Get the camera's near plane distance. Affects depth-buffer precision significantly; use the largest value possible.

actual val near: Float

Get the camera's near plane distance. Affects depth-buffer precision significantly; use the largest value possible.

Link copied to clipboard
actual val sensitivity: Float

Get the camera's sensitivity in ISO.

expect val sensitivity: Float

Get the camera's sensitivity in ISO.

actual val sensitivity: Float

Get the camera's sensitivity in ISO.

actual val sensitivity: Float

Get the camera's sensitivity in ISO.

actual val sensitivity: Float

Get the camera's sensitivity in ISO.

Link copied to clipboard
actual val shutterSpeed: Float

Get the camera's shutter speed in seconds.

expect val shutterSpeed: Float

Get the camera's shutter speed in seconds.

actual val shutterSpeed: Float

Get the camera's shutter speed in seconds.

actual val shutterSpeed: Float

Get the camera's shutter speed in seconds.

actual val shutterSpeed: Float

Get the camera's shutter speed in seconds.

Functions

Link copied to clipboard

Get the projection matrix used for culling (far plane is finite).

Get the projection matrix used for culling (far plane is finite).

Get the projection matrix used for culling (far plane is finite).

Get the projection matrix used for culling (far plane is finite).

Get the projection matrix used for culling (far plane is finite).

Link copied to clipboard
actual fun getFieldOfViewInDegrees(direction: Camera.Fov): Double

Get the camera's field of view in degrees.

expect fun getFieldOfViewInDegrees(direction: Camera.Fov): Double

Get the camera's field of view in degrees.

actual fun getFieldOfViewInDegrees(direction: Camera.Fov): Double

Get the camera's field of view in degrees.

actual fun getFieldOfViewInDegrees(direction: Camera.Fov): Double

Get the camera's field of view in degrees.

actual fun getFieldOfViewInDegrees(direction: Camera.Fov): Double

Get the camera's field of view in degrees.

Link copied to clipboard

Get the camera's forward vector (direction opposite to -Z, i.e., camera looking direction).

expect fun getForwardVector(out: FloatArray? = null): FloatArray

Get the camera's forward vector (direction opposite to -Z, i.e., camera looking direction).

Get the camera's forward vector (direction opposite to -Z, i.e., camera looking direction).

Get the camera's forward vector (direction opposite to -Z, i.e., camera looking direction).

Get the camera's forward vector (direction opposite to -Z, i.e., camera looking direction).

Link copied to clipboard

Get the camera's normalized left vector (basis vector for +X in world space).

expect fun getLeftVector(out: FloatArray? = null): FloatArray

Get the camera's normalized left vector (basis vector for +X in world space).

Get the camera's normalized left vector (basis vector for +X in world space).

Get the camera's normalized left vector (basis vector for +X in world space).

Get the camera's normalized left vector (basis vector for +X in world space).

Link copied to clipboard

Get the camera's model matrix (position and orientation in world space).

expect fun getModelMatrix(out: DoubleArray? = null): DoubleArray
expect fun getModelMatrix(out: FloatArray? = null): FloatArray

Get the camera's model matrix (position and orientation in world space).

Get the camera's model matrix (position and orientation in world space).

Get the camera's model matrix (position and orientation in world space).

Get the camera's model matrix (position and orientation in world space).

Link copied to clipboard
actual fun getPosition(out: FloatArray?): FloatArray

Get the camera's position in world space.

expect fun getPosition(out: FloatArray? = null): FloatArray

Get the camera's position in world space.

actual fun getPosition(out: FloatArray?): FloatArray

Get the camera's position in world space.

actual fun getPosition(out: FloatArray?): FloatArray

Get the camera's position in world space.

actual fun getPosition(out: FloatArray?): FloatArray

Get the camera's position in world space.

Link copied to clipboard

Get the projection matrix used for rendering (far plane set to infinity).

expect fun getProjectionMatrix(out: DoubleArray? = null): DoubleArray

Get the projection matrix used for rendering (far plane set to infinity).

Get the projection matrix used for rendering (far plane set to infinity).

Get the projection matrix used for rendering (far plane set to infinity).

Get the projection matrix used for rendering (far plane set to infinity).

Link copied to clipboard

Get the 2D scaling factors applied to the projection matrix.

expect fun getScaling(out: DoubleArray? = null): DoubleArray

Get the 2D scaling factors applied to the projection matrix.

Get the 2D scaling factors applied to the projection matrix.

Get the 2D scaling factors applied to the projection matrix.

Get the 2D scaling factors applied to the projection matrix.

Link copied to clipboard
actual fun getShift(out: DoubleArray?): DoubleArray

Get the 2D translation shift applied to the projection matrix.

expect fun getShift(out: DoubleArray? = null): DoubleArray

Get the 2D translation shift applied to the projection matrix.

actual fun getShift(out: DoubleArray?): DoubleArray

Get the 2D translation shift applied to the projection matrix.

actual fun getShift(out: DoubleArray?): DoubleArray

Get the 2D translation shift applied to the projection matrix.

actual fun getShift(out: DoubleArray?): DoubleArray

Get the 2D translation shift applied to the projection matrix.

Link copied to clipboard
actual fun getUpVector(out: FloatArray?): FloatArray

Get the camera's normalized up vector (basis vector for +Y in world space).

expect fun getUpVector(out: FloatArray? = null): FloatArray

Get the camera's normalized up vector (basis vector for +Y in world space).

actual fun getUpVector(out: FloatArray?): FloatArray

Get the camera's normalized up vector (basis vector for +Y in world space).

actual fun getUpVector(out: FloatArray?): FloatArray

Get the camera's normalized up vector (basis vector for +Y in world space).

actual fun getUpVector(out: FloatArray?): FloatArray

Get the camera's normalized up vector (basis vector for +Y in world space).

Link copied to clipboard

Get the camera's view matrix (inverse of the model matrix).

expect fun getViewMatrix(out: DoubleArray? = null): DoubleArray
expect fun getViewMatrix(out: FloatArray? = null): FloatArray

Get the camera's view matrix (inverse of the model matrix).

Get the camera's view matrix (inverse of the model matrix).

Get the camera's view matrix (inverse of the model matrix).

Get the camera's view matrix (inverse of the model matrix).

Link copied to clipboard
actual fun lookAt(eyeX: Double, eyeY: Double, eyeZ: Double, centerX: Double, centerY: Double, centerZ: Double, upX: Double, upY: Double, upZ: Double)

Set the camera's model matrix (position and orientation) using lookAt semantics.

expect fun lookAt(eyeX: Double, eyeY: Double, eyeZ: Double, centerX: Double, centerY: Double, centerZ: Double, upX: Double, upY: Double, upZ: Double)

Set the camera's model matrix (position and orientation) using lookAt semantics.

actual fun lookAt(eyeX: Double, eyeY: Double, eyeZ: Double, centerX: Double, centerY: Double, centerZ: Double, upX: Double, upY: Double, upZ: Double)

Set the camera's model matrix (position and orientation) using lookAt semantics.

actual fun lookAt(eyeX: Double, eyeY: Double, eyeZ: Double, centerX: Double, centerY: Double, centerZ: Double, upX: Double, upY: Double, upZ: Double)

Set the camera's model matrix (position and orientation) using lookAt semantics.

actual fun lookAt(eyeX: Double, eyeY: Double, eyeZ: Double, centerX: Double, centerY: Double, centerZ: Double, upX: Double, upY: Double, upZ: Double)

Set the camera's model matrix (position and orientation) using lookAt semantics.

Link copied to clipboard
actual fun setCustomEyeProjection(projection: DoubleArray, count: Int, projectionForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for stereoscopic rendering (each eye can have different projection).

expect fun setCustomEyeProjection(projection: DoubleArray, count: Int, projectionForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for stereoscopic rendering (each eye can have different projection).

actual fun setCustomEyeProjection(projection: DoubleArray, count: Int, projectionForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for stereoscopic rendering (each eye can have different projection).

actual fun setCustomEyeProjection(projection: DoubleArray, count: Int, projectionForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for stereoscopic rendering (each eye can have different projection).

actual fun setCustomEyeProjection(projection: DoubleArray, count: Int, projectionForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for stereoscopic rendering (each eye can have different projection).

Link copied to clipboard
actual fun setCustomProjection(matrix: DoubleArray, near: Double, far: Double)

Set a custom projection matrix used for both rendering and culling.

actual fun setCustomProjection(matrix: DoubleArray, matrixForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for rendering and culling separately.

expect fun setCustomProjection(matrix: DoubleArray, near: Double, far: Double)

Set a custom projection matrix used for both rendering and culling.

expect fun setCustomProjection(matrix: DoubleArray, matrixForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for rendering and culling separately.

actual fun setCustomProjection(matrix: DoubleArray, near: Double, far: Double)

Set a custom projection matrix used for both rendering and culling.

actual fun setCustomProjection(matrix: DoubleArray, matrixForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for rendering and culling separately.

actual fun setCustomProjection(matrix: DoubleArray, near: Double, far: Double)

Set a custom projection matrix used for both rendering and culling.

actual fun setCustomProjection(matrix: DoubleArray, matrixForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for rendering and culling separately.

actual fun setCustomProjection(matrix: DoubleArray, near: Double, far: Double)

Set a custom projection matrix used for both rendering and culling.

actual fun setCustomProjection(matrix: DoubleArray, matrixForCulling: DoubleArray, near: Double, far: Double)

Set custom projection matrices for rendering and culling separately.

Link copied to clipboard
actual fun setExposure(exposure: Float)

Set the camera's exposure directly (unit-less approach).

actual fun setExposure(aperture: Float, shutterSpeed: Float, sensitivity: Float)

Set the camera's exposure using physical camera parameters.

expect fun setExposure(exposure: Float)

Set the camera's exposure directly (unit-less approach).

expect fun setExposure(aperture: Float, shutterSpeed: Float, sensitivity: Float)

Set the camera's exposure using physical camera parameters.

actual fun setExposure(exposure: Float)

Set the camera's exposure directly (unit-less approach).

actual fun setExposure(aperture: Float, shutterSpeed: Float, sensitivity: Float)

Set the camera's exposure using physical camera parameters.

actual fun setExposure(exposure: Float)

Set the camera's exposure directly (unit-less approach).

actual fun setExposure(aperture: Float, shutterSpeed: Float, sensitivity: Float)

Set the camera's exposure using physical camera parameters.

actual fun setExposure(exposure: Float)

Set the camera's exposure directly (unit-less approach).

actual fun setExposure(aperture: Float, shutterSpeed: Float, sensitivity: Float)

Set the camera's exposure using physical camera parameters.

Link copied to clipboard
actual fun setEyeModelMatrix(eyeId: Int, modelMatrix: DoubleArray)

Set the position of an individual eye relative to the camera (head) space.

expect fun setEyeModelMatrix(eyeId: Int, modelMatrix: DoubleArray)

Set the position of an individual eye relative to the camera (head) space.

actual fun setEyeModelMatrix(eyeId: Int, modelMatrix: DoubleArray)

Set the position of an individual eye relative to the camera (head) space.

actual fun setEyeModelMatrix(eyeId: Int, modelMatrix: DoubleArray)

Set the position of an individual eye relative to the camera (head) space.

actual fun setEyeModelMatrix(eyeId: Int, modelMatrix: DoubleArray)

Set the position of an individual eye relative to the camera (head) space.

Link copied to clipboard
actual fun setLensProjection(focalLength: Double, aspect: Double, near: Double, far: Double)

Set the projection matrix from focal length (lens-based approach).

expect fun setLensProjection(focalLength: Double, aspect: Double, near: Double, far: Double)

Set the projection matrix from focal length (lens-based approach).

actual fun setLensProjection(focalLength: Double, aspect: Double, near: Double, far: Double)

Set the projection matrix from focal length (lens-based approach).

actual fun setLensProjection(focalLength: Double, aspect: Double, near: Double, far: Double)

Set the projection matrix from focal length (lens-based approach).

actual fun setLensProjection(focalLength: Double, aspect: Double, near: Double, far: Double)

Set the projection matrix from focal length (lens-based approach).

Link copied to clipboard
actual fun setModelMatrix(modelMatrix: DoubleArray)
actual fun setModelMatrix(modelMatrix: FloatArray)

Set the camera's model matrix (position and orientation).

expect fun setModelMatrix(modelMatrix: DoubleArray)
expect fun setModelMatrix(modelMatrix: FloatArray)

Set the camera's model matrix (position and orientation).

actual fun setModelMatrix(modelMatrix: DoubleArray)
actual fun setModelMatrix(modelMatrix: FloatArray)

Set the camera's model matrix (position and orientation).

actual fun setModelMatrix(modelMatrix: DoubleArray)
actual fun setModelMatrix(modelMatrix: FloatArray)

Set the camera's model matrix (position and orientation).

actual fun setModelMatrix(modelMatrix: DoubleArray)
actual fun setModelMatrix(modelMatrix: FloatArray)

Set the camera's model matrix (position and orientation).

Link copied to clipboard
actual fun setProjection(fovInDegrees: Double, aspect: Double, near: Double, far: Double, direction: Camera.Fov)

Set the projection matrix from field-of-view and aspect ratio.

actual fun setProjection(projection: Camera.Projection, left: Double, right: Double, bottom: Double, top: Double, near: Double, far: Double)

Set the projection matrix from six frustum planes.

expect fun setProjection(fovInDegrees: Double, aspect: Double, near: Double, far: Double, direction: Camera.Fov)

Set the projection matrix from field-of-view and aspect ratio.

expect fun setProjection(projection: Camera.Projection, left: Double, right: Double, bottom: Double, top: Double, near: Double, far: Double)

Set the projection matrix from six frustum planes.

actual fun setProjection(fovInDegrees: Double, aspect: Double, near: Double, far: Double, direction: Camera.Fov)

Set the projection matrix from field-of-view and aspect ratio.

actual fun setProjection(projection: Camera.Projection, left: Double, right: Double, bottom: Double, top: Double, near: Double, far: Double)

Set the projection matrix from six frustum planes.

actual fun setProjection(fovInDegrees: Double, aspect: Double, near: Double, far: Double, direction: Camera.Fov)

Set the projection matrix from field-of-view and aspect ratio.

actual fun setProjection(projection: Camera.Projection, left: Double, right: Double, bottom: Double, top: Double, near: Double, far: Double)

Set the projection matrix from six frustum planes.

actual fun setProjection(fovInDegrees: Double, aspect: Double, near: Double, far: Double, direction: Camera.Fov)

Set the projection matrix from field-of-view and aspect ratio.

actual fun setProjection(projection: Camera.Projection, left: Double, right: Double, bottom: Double, top: Double, near: Double, far: Double)

Set the projection matrix from six frustum planes.

Link copied to clipboard
actual fun setScaling(x: Double, y: Double)

Apply a 2D scaling to the projection matrix after projection.

expect fun setScaling(x: Double, y: Double)

Apply a 2D scaling to the projection matrix after projection.

actual fun setScaling(x: Double, y: Double)

Apply a 2D scaling to the projection matrix after projection.

actual fun setScaling(x: Double, y: Double)

Apply a 2D scaling to the projection matrix after projection.

actual fun setScaling(x: Double, y: Double)

Apply a 2D scaling to the projection matrix after projection.

Link copied to clipboard
actual fun setShift(x: Double, y: Double)

Apply a 2D translation shift to the projection matrix after projection.

expect fun setShift(x: Double, y: Double)

Apply a 2D translation shift to the projection matrix after projection.

actual fun setShift(x: Double, y: Double)

Apply a 2D translation shift to the projection matrix after projection.

actual fun setShift(x: Double, y: Double)

Apply a 2D translation shift to the projection matrix after projection.

actual fun setShift(x: Double, y: Double)

Apply a 2D translation shift to the projection matrix after projection.