val pose = TransformBuilder().move(1f, 2f, 3f).then(TransformBuilder().rotateX(90f)).build()
class TransformBuilder
TransformBuilder
()
|
Signature
constructor() Returns TransformBuilder |
build
()
|
Builds the final Transform from the configured transformation steps.
Signature
fun build(): Transform Throws NullPointerException
if no transformation steps have been added
|
cosDegrees
(
angleInDegrees
)
|
Helper function that calculates the cosine of an angle specified in degrees.
Signature
fun cosDegrees(angleInDegrees: Float): Float Parameters angleInDegrees: Float
The angle in degrees
Returns Float
The cosine value of the angle
|
degreesToRadians
(
angleInDegrees
)
|
Helper function that converts an angle from degrees to radians.
Signature
fun degreesToRadians(angleInDegrees: Float): Float Parameters angleInDegrees: Float
The angle in degrees
Returns Float
The equivalent angle in radians
|
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
The translation distance along the X axis
y: Float
The translation distance along the Y axis
z: Float
The translation distance along the Z axis
Returns TransformBuilder.TransformStepBuilder
A TransformStepBuilder that can be used to chain additional transformations
|
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
The rotation angle in degrees
|
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
The rotation angle in degrees
|
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
The rotation angle in degrees
|
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
The rotation angle in degrees
Returns TransformBuilder.TransformStepBuilder
A TransformStepBuilder that can be used to chain additional transformations
|
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
The rotation angle in degrees
Returns TransformBuilder.TransformStepBuilder
A TransformStepBuilder that can be used to chain additional transformations
|
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
The rotation angle in degrees
Returns TransformBuilder.TransformStepBuilder
A TransformStepBuilder that can be used to chain additional transformations
|
sinDegrees
(
angleInDegrees
)
|
Helper function that calculates the sine of an angle specified in degrees.
Signature
fun sinDegrees(angleInDegrees: Float): Float Parameters angleInDegrees: Float
The angle in degrees
Returns Float
The sine value of the angle
|
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: TransformBuilderleft: 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
The next transformation step to apply
Returns TransformBuilder.TransformStepBuilder
A new TransformStepBuilder representing the combined transformation
|