Class: TransformPerspective
A perspective transformation.
Constructors
constructor
• new TransformPerspective(): TransformPerspective
Returns
Methods
_setCameraRotation
▸ _setCameraRotation(cameraRotation
): void
Sets the rotation of this projection's camera. Does not update the full camera transformation.
Parameters
Name | Type | Description |
---|---|---|
cameraRotation | ReadonlyTransform3D | A 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
Name | Type | Description |
---|---|---|
vec | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | 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
.
Defined in
src/sdk/math/TransformPerspective.ts:162
copy
▸ copy(): TransformPerspective
Copies this transformation.
Returns
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
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
Name | Type | Description |
---|---|---|
cameraPos | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | The position of the camera, as [x, y, z] in world coordinates. |
cameraRotation | ReadonlyTransform3D | A transformation representing the rotation of the camera. |
surfacePos | Readonly <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
Name | Type | Description |
---|---|---|
transform | ReadonlyTransformPerspective | The 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
Name | Type | Description |
---|---|---|
cameraPos | Readonly <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
Name | Type | Description |
---|---|---|
cameraRotation | ReadonlyTransform3D | A 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
Name | Type | Description |
---|---|---|
surfacePos | Readonly <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