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
Parameter | Type | Description |
---|---|---|
cameraRotation | ReadonlyTransform3D | A 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
Parameter | Type | Description |
---|---|---|
vec | ReadonlyFloat64Array | A 3D vector, in world coordinates. |
out | Float64Array | The 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
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
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
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
Parameter | Type | Description |
---|---|---|
cameraPos | ReadonlyFloat64Array | The position of the camera, as [x, y, z] in world coordinates. |
cameraRotation | ReadonlyTransform3D | A transformation representing the rotation of the camera. |
surfacePos | ReadonlyFloat64Array | 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.
Call Signature
set(
transform
):this
Defined in: src/sdk/math/TransformPerspective.ts:68
Sets the parameters of this transformation from another transformation.
Parameters
Parameter | Type | Description |
---|---|---|
transform | ReadonlyTransformPerspective | The 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
Parameter | Type | Description |
---|---|---|
cameraPos | ReadonlyFloat64Array | The 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
Parameter | Type | Description |
---|---|---|
cameraRotation | ReadonlyTransform3D | A 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
Parameter | Type | Description |
---|---|---|
surfacePos | ReadonlyFloat64Array | 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.