val pose = TransformBuilder().move(1f, 2f, 3f).then(TransformBuilder().rotateX(90f)).build()
class TransformBuilder
TransformBuilder
()
|
Signature
constructor() Returns |
build
()
|
Builds the final Transform from the configured transformation steps.
Signature
fun build(): Transform Throws
NullPointerException
|
cosDegrees
(
angleInDegrees
)
|
Helper function that calculates the cosine of an angle specified in degrees.
Signature
fun cosDegrees(angleInDegrees: Float): Float Parameters
angleInDegrees:
Float
Returns
Float
|
degreesToRadians
(
angleInDegrees
)
|
Helper function that converts an angle from degrees to radians.
Signature
fun degreesToRadians(angleInDegrees: Float): Float Parameters
angleInDegrees:
Float
Returns
Float
|
move
(
x
, y
, z
)
|
Creates a translation transformation.
It is important to note that the translation is applied as if looking from the rotation of the previous TransformBuilder transformation, not from the world graph. For example, if you had rotated 180 degrees around the y-axis, the applied this transformation to move with z=1, the resulting world position will be (0, 0, -1) instead of (0, 0, 1).
Signature
fun move(x: Float = 0.0f, y: Float = 0.0f, z: Float = 0.0f): TransformBuilder.TransformStepBuilder Parameters
x:
Float
y:
Float
z:
Float
Returns
TransformBuilder.TransformStepBuilder
|
rotate_x
(
angleInDegrees
)
|
Helper function that creates a quaternion representing a rotation around the X axis.
Signature
fun rotate_x(angleInDegrees: Float): Quaternion Parameters
angleInDegrees:
Float
|
rotate_y
(
angleInDegrees
)
|
Helper function that creates a quaternion representing a rotation around the Y axis.
Signature
fun rotate_y(angleInDegrees: Float): Quaternion Parameters
angleInDegrees:
Float
|
rotate_z
(
angleInDegrees
)
|
Helper function that creates a quaternion representing a rotation around the Z axis.
Signature
fun rotate_z(angleInDegrees: Float): Quaternion Parameters
angleInDegrees:
Float
|
rotateX
(
angleInDegrees
)
|
Creates a rotation transformation around the X axis.
Note that the rotation is applied as if looking from the rotation of the previous transformation, so if you rotated 180 degrees around the x-axis, then applied this transformation to rotate 90 degrees around the x-axis, the resulting world rotation will be 270 degrees around the x-axis
Signature
fun rotateX(angleInDegrees: Float): TransformBuilder.TransformStepBuilder Parameters
angleInDegrees:
Float
Returns
TransformBuilder.TransformStepBuilder
|
rotateY
(
angleInDegrees
)
|
Creates a rotation transformation around the Y axis.
Note that the rotation is applied as if looking from the rotation of the previous transformation, so if you rotated 180 degrees around the y-axis, then applied this transformation to rotate 90 degrees around the y-axis, the resulting world rotation will be 270 degrees around the y-axis
Signature
fun rotateY(angleInDegrees: Float): TransformBuilder.TransformStepBuilder Parameters
angleInDegrees:
Float
Returns
TransformBuilder.TransformStepBuilder
|
rotateZ
(
angleInDegrees
)
|
Creates a rotation transformation around the Z axis.
Note that the rotation is applied as if looking from the rotation of the previous transformation, so if you rotated 180 degrees around the z-axis, then applied this transformation to rotate 90 degrees around the z-axis, the resulting world rotation will be 270 degrees around the z-axis
Signature
fun rotateZ(angleInDegrees: Float): TransformBuilder.TransformStepBuilder Parameters
angleInDegrees:
Float
Returns
TransformBuilder.TransformStepBuilder
|
sinDegrees
(
angleInDegrees
)
|
Helper function that calculates the sine of an angle specified in degrees.
Signature
fun sinDegrees(angleInDegrees: Float): Float Parameters
angleInDegrees:
Float
Returns
Float
|
class TransformStepBuilder(var value: Pose? = null, var root: TransformBuilder, var left: TransformBuilder.TransformStepBuilder? = null, var right: TransformBuilder.TransformStepBuilder? = null)
TransformStepBuilder
(
value
, root
, left
, right
)
|
Signature
constructor(value: Pose? = null, root: TransformBuilder, left: TransformBuilder.TransformStepBuilder? = null, right: TransformBuilder.TransformStepBuilder? = null) Parameters
value:
Pose?
root:
TransformBuilder
left:
TransformBuilder.TransformStepBuilder?
right:
TransformBuilder.TransformStepBuilder?
Returns
TransformBuilder.TransformStepBuilder
|
left
: TransformBuilder.TransformStepBuilder?
[Get][Set] |
Signature
var left: TransformBuilder.TransformStepBuilder? |
right
: TransformBuilder.TransformStepBuilder?
[Get][Set] |
Signature
var right: TransformBuilder.TransformStepBuilder? |
root
: TransformBuilder
[Get][Set] |
Signature
var root: TransformBuilder |
value
: Pose?
[Get][Set] |
Signature
var value: Pose? |
build
()
|
Builds the final Pose from the transformation steps.
Signature
fun build(): Pose |
then
(
nextStep
)
|
Chains this transformation step with another transformation step.
Signature
infix fun then(nextStep: TransformBuilder.TransformStepBuilder): TransformBuilder.TransformStepBuilder Parameters
nextStep:
TransformBuilder.TransformStepBuilder
Returns
TransformBuilder.TransformStepBuilder
|