TSR (translation, scale, rotation} utility routines.
Summary
Methods
- copy(tsr, tsr2)
- create() → {TSR}
- from_mat4(mat, dest) → {TSR}
- from_values(x, y, z, s, qx, qy, qz, qw) → {TSR}
- get_quat_view() → {Quat}
- get_scale() → {number}
- get_trans_view(tsr) → {Vec3}
- identity(tsr)
- interpolate(tsr, tsr2, factor, dest) → {TSR}
- invert(tsr, dest) → {TSR}
- multiply(tsr, tsr2, dest) → {TSR}
- set_quat(quat, dest)
- set_scale(scale, dest)
- set_sep(trans, scale, quat, destopt) → {TSR}
- set_trans(trans, dest)
- set_transcale(transcale, dest)
- to_mat4(tsr, destopt, nullable) → {Mat4}
- transform_dir_vec3(trans, tsr, dest)
- transform_dir_vectors(vectors, tsr, new_vectors, dest_offsetopt) → {Float32Array}
- transform_tangents(vectors, tsr, new_vectors, dest_offsetopt) → {Float32Array}
- transform_vec3(trans, tsr, dest)
- transform_vec3_inv(trans, tsr, dest)
- transform_vectors(vectors, tsr, new_vectors, dest_offsetopt) → {Float32Array}
- translate(tsr, trans, dest) → {TSR}
Detailed Description
Methods
copy(tsr, tsr2)
create() → {TSR}
from_mat4(mat, dest) → {TSR}
from_values(x, y, z, s, qx, qy, qz, qw) → {TSR}
Create a new TSR vector from given values.
Parameters:
Name | Type | Description |
---|---|---|
x |
number | X translation. |
y |
number | Y translation. |
z |
number | Z translation. |
s |
number | Scale. |
qx |
number | X quaternion rotation. |
qy |
number | Y quaternion rotation. |
qz |
number | Z quaternion rotation. |
qw |
number | W quaternion rotation. |
Returns:
New TSR vector
- Type
- TSR
- Source:
get_quat_view() → {Quat}
get_scale() → {number}
get_trans_view(tsr) → {Vec3}
identity(tsr)
interpolate(tsr, tsr2, factor, dest) → {TSR}
invert(tsr, dest) → {TSR}
multiply(tsr, tsr2, dest) → {TSR}
set_quat(quat, dest)
set_scale(scale, dest)
Set TSR scale.
Parameters:
Name | Type | Description |
---|---|---|
scale |
number | Scale |
dest |
TSR | Destination TSR vector |
- Source:
set_sep(trans, scale, quat, destopt) → {TSR}
set_trans(trans, dest)
set_transcale(transcale, dest)
to_mat4(tsr, destopt, nullable) → {Mat4}
transform_dir_vec3(trans, tsr, dest)
transform_dir_vectors(vectors, tsr, new_vectors, dest_offsetopt) → {Float32Array}
Transform directional vec3 vectors by TSR.
optional destination offset in values (not vectors, not bytes)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
vectors |
Float32Array | Array of vectors to transform | ||
tsr |
TSR | TSR vector | ||
new_vectors |
Float32Array | Destination array of vectors | ||
dest_offset |
number |
<optional> |
0 | Offset in new_vectors array |
Returns:
Destination array of vectors
- Type
- Float32Array
- Source:
transform_tangents(vectors, tsr, new_vectors, dest_offsetopt) → {Float32Array}
Transform 4 comp tangent vectors by matrix.
optional destination offset in values (not vectors, not bytes)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
vectors |
Float32Array | Array of vectors to transform | ||
tsr |
TSR | TSR vector | ||
new_vectors |
Float32Array | Destination array of vectors | ||
dest_offset |
number |
<optional> |
0 | Offset in new_vectors array |
Returns:
Destination array of vectors
- Type
- Float32Array
- Source:
transform_vec3(trans, tsr, dest)
transform_vec3_inv(trans, tsr, dest)
transform_vectors(vectors, tsr, new_vectors, dest_offsetopt) → {Float32Array}
Transform vec3 vectors by TSR.
optional destination offset in values (not vectors, not bytes)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
vectors |
Float32Array | Array of vectors to transform | ||
tsr |
TSR | TSR vector | ||
new_vectors |
Float32Array | Destination array of vectors | ||
dest_offset |
number |
<optional> |
0 | Offset in new_vectors array |
Returns:
Destination array of vectors
- Type
- Float32Array
- Source: