CameraComponent

Inheritors

Properties

Link copied to clipboard
open val aperture: Float

Gets the aperture in f-stops

Link copied to clipboard
Link copied to clipboard
open val cullingFar: Float

Gets the distance to the far plane

Link copied to clipboard

Retrieves the camera's culling matrix. The culling matrix is the same as the projection matrix, except the far plane is finite.

Link copied to clipboard
abstract val engine: Engine
Link copied to clipboard
abstract val entity: Entity
Link copied to clipboard
open val far: Float
Link copied to clipboard

Gets the focal length in meters

Link copied to clipboard

The distance from the camera to the focus plane in world units

Link copied to clipboard

Retrieves the camera forward unit vector in world space, that is a unit vector that points in the direction the camera is looking at.

Link copied to clipboard

Retrieves the camera left unit vector in world space, that is a unit vector that points to the left of the camera.

Link copied to clipboard

The camera's model matrix.

Link copied to clipboard
open val near: Float

Gets the distance to the near plane

Link copied to clipboard
open var projectionTransform: Mat4

Retrieves the camera's projection matrix. The projection matrix used for rendering always has its far plane set to infinity. This is why it may differ from the matrix set through setProjection() or setLensProjection().

Link copied to clipboard
open val scaling: Float4

Returns the scaling amount used to scale the projection matrix.

Link copied to clipboard
open val sensitivity: Float

Gets the sensitivity in ISO

Link copied to clipboard

Gets the shutter speed in seconds

Link copied to clipboard

Retrieves the camera up unit vector in world space, that is a unit vector that points up with respect to the camera.

Link copied to clipboard

Retrieves the camera's view matrix. The view matrix is the inverse of the model matrix.

Functions

Link copied to clipboard
open fun lookAt(eye: Position, center: Position, up: Direction)

Sets the camera's model matrix.

Link copied to clipboard
open fun setCustomProjection(inProjection: Transform, near: Double = camera.near.toDouble(), far: Double = camera.cullingFar.toDouble(), inProjectionForCulling: Transform = inProjection)

Sets a custom projection matrix.

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

Sets this camera's exposure directly. Calling this method will set the aperture to 1.0, the shutter speed to 1.2 and the sensitivity will be computed to match the requested exposure (for a desired exposure of 1.0, the sensitivity will be set to 100 ISO).

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

Sets this camera's exposure (default is f/16, 1/125s, 100 ISO)

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

Sets the projection matrix from the focal length.

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

Sets the projection matrix from the field-of-view.

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

Sets the projection matrix from a frustum defined by six planes.

Link copied to clipboard
open fun setScaling(scaling: Float2)

Sets an additional matrix that scales the projection matrix.

Link copied to clipboard
open fun setShift(xShift: Double, yShift: Double)

Sets an additional matrix that shifts (translates) the projection matrix.

Link copied to clipboard
open fun viewToRay(viewPosition: Float2): Ray

Calculates a ray in world space going from the near-plane of the camera and through a point in view space.

Link copied to clipboard
open fun viewToWorld(viewPosition: Float2, z: Float = 1.0f): Float3

Get a world space position from a view space position.

Link copied to clipboard
open fun worldToView(worldPosition: Position): Float2

Get a view space position from a world position.