Skip to main content

Class: TransformPerspective

A perspective transformation.

Constructors

constructor

new TransformPerspective(): TransformPerspective

Returns

TransformPerspective

Methods

_setCameraRotation

_setCameraRotation(cameraRotation): void

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

Parameters

NameTypeDescription
cameraRotationReadonlyTransform3DA transformation representing the rotation of the camera.

Returns

void

Defined in

src/sdk/math/TransformPerspective.ts:108


apply

apply(vec, out): Float64Array

Applies this transformation to a 3D vector.

Parameters

NameTypeDescription
vecReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>A 3D vector, in world coordinates.
outFloat64ArrayThe 2D vector to which to write the result.

Returns

Float64Array

The result of applying this transformation to vec.

Defined in

src/sdk/math/TransformPerspective.ts:162


copy

copy(): TransformPerspective

Copies this transformation.

Returns

TransformPerspective

A copy of this transformation.

Defined in

src/sdk/math/TransformPerspective.ts:152


getCameraPosition

getCameraPosition(): Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

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

Returns

Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

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

Defined in

src/sdk/math/TransformPerspective.ts:29


getCameraRotation

getCameraRotation(): ReadonlyTransform3D

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

Returns

ReadonlyTransform3D

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

Defined in

src/sdk/math/TransformPerspective.ts:37


getSurfacePosition

getSurfacePosition(): Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

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

Returns

Readonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>

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

Defined in

src/sdk/math/TransformPerspective.ts:47


set

set(cameraPos, cameraRotation, surfacePos): this

Sets the parameters of this transformation.

Parameters

NameTypeDescription
cameraPosReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the camera, as [x, y, z] in world coordinates.
cameraRotationReadonlyTransform3DA transformation representing the rotation of the camera.
surfacePosReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The 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.

Defined in

src/sdk/math/TransformPerspective.ts:59

set(transform): this

Sets the parameters of this transformation from another transformation.

Parameters

NameTypeDescription
transformReadonlyTransformPerspectiveThe transformation from which to take parameters.

Returns

this

Defined in

src/sdk/math/TransformPerspective.ts:68


setCameraPosition

setCameraPosition(cameraPos): this

Sets the position of this projection's camera.

Parameters

NameTypeDescription
cameraPosReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The position of the camera, as [x, y, z] in world coordinates.

Returns

this

This transformation, after it has been changed.

Defined in

src/sdk/math/TransformPerspective.ts:118


setCameraRotation

setCameraRotation(cameraRotation): this

Sets the rotation of this projection's camera.

Parameters

NameTypeDescription
cameraRotationReadonlyTransform3DA transformation representing the rotation of the camera.

Returns

this

This transformation, after it has been changed.

Defined in

src/sdk/math/TransformPerspective.ts:130


setSurfacePosition

setSurfacePosition(surfacePos): this

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

Parameters

NameTypeDescription
surfacePosReadonly<Omit<Float64Array, "set" | "sort" | "copyWithin">>The 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.

Defined in

src/sdk/math/TransformPerspective.ts:143