Skip to main content

Class: TransformPerspective

Defined in: src/sdk/math/TransformPerspective.ts:12

A perspective transformation.

Constructors

Constructor

new TransformPerspective(): TransformPerspective

Returns

TransformPerspective

Methods

_setCameraRotation()

_setCameraRotation(cameraRotation): void

Defined in: src/sdk/math/TransformPerspective.ts:108

Sets the rotation of this projection's camera. Does not update the full camera transformation.

Parameters

ParameterTypeDescription
cameraRotationReadonlyTransform3DA transformation representing the rotation of the camera.

Returns

void


apply()

apply(vec, out): Float64Array

Defined in: src/sdk/math/TransformPerspective.ts:162

Applies this transformation to a 3D vector.

Parameters

ParameterTypeDescription
vecReadonlyFloat64ArrayA 3D vector, in world coordinates.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The result of applying this transformation to vec.


copy()

copy(): TransformPerspective

Defined in: src/sdk/math/TransformPerspective.ts:152

Copies this transformation.

Returns

TransformPerspective

A copy of this transformation.


getCameraPosition()

getCameraPosition(): ReadonlyFloat64Array

Defined in: src/sdk/math/TransformPerspective.ts:29

Gets the position of this transformation's camera, as [x, y, z] in world coordinates.

Returns

ReadonlyFloat64Array

The position of this transformation's camera, as [x, y, z] in world coordinates.


getCameraRotation()

getCameraRotation(): ReadonlyTransform3D

Defined in: src/sdk/math/TransformPerspective.ts:37

Gets the transformation representing the rotation of this transformation's camera.

Returns

ReadonlyTransform3D

The transformation representing the rotation of this transformation's camera.


getSurfacePosition()

getSurfacePosition(): ReadonlyFloat64Array

Defined in: src/sdk/math/TransformPerspective.ts:47

Gets the position of this transformation's projection surface relative to the camera, as [x, y, z] in camera coordinates.

Returns

ReadonlyFloat64Array

The position of this transformation's projection surface relative to the camera, as [x, y, z] in camera coordinates.


set()

Call Signature

set(cameraPos, cameraRotation, surfacePos): this

Defined in: src/sdk/math/TransformPerspective.ts:59

Sets the parameters of this transformation.

Parameters
ParameterTypeDescription
cameraPosReadonlyFloat64ArrayThe position of the camera, as [x, y, z] in world coordinates.
cameraRotationReadonlyTransform3DA transformation representing the rotation of the camera.
surfacePosReadonlyFloat64ArrayThe position of the projection surface relative to the camera, as [x, y, z] in camera coordinates.
Returns

this

This transformation, after it has been changed.

Call Signature

set(transform): this

Defined in: src/sdk/math/TransformPerspective.ts:68

Sets the parameters of this transformation from another transformation.

Parameters
ParameterTypeDescription
transformReadonlyTransformPerspectiveThe transformation from which to take parameters.
Returns

this


setCameraPosition()

setCameraPosition(cameraPos): this

Defined in: src/sdk/math/TransformPerspective.ts:118

Sets the position of this projection's camera.

Parameters

ParameterTypeDescription
cameraPosReadonlyFloat64ArrayThe position of the camera, as [x, y, z] in world coordinates.

Returns

this

This transformation, after it has been changed.


setCameraRotation()

setCameraRotation(cameraRotation): this

Defined in: src/sdk/math/TransformPerspective.ts:130

Sets the rotation of this projection's camera.

Parameters

ParameterTypeDescription
cameraRotationReadonlyTransform3DA transformation representing the rotation of the camera.

Returns

this

This transformation, after it has been changed.


setSurfacePosition()

setSurfacePosition(surfacePos): this

Defined in: src/sdk/math/TransformPerspective.ts:143

Sets the position of this transformation's projection surface relative to the camera.

Parameters

ParameterTypeDescription
surfacePosReadonlyFloat64ArrayThe position of the projection surface relative to the camera, as [x, y, z] in camera coordinates.

Returns

this

This transformation, after it has been changed.