Rigid-transform schema composed from one translation vector and one orientation quaternion. The default alias Pose is the Real32 specialization.
position: translation vector.orientation: orientation quaternion.getMatrix (-- matrix): returns the rotation matrix derived from orientation.scale (factor --): scales position and leaves orientation unchanged.translate (offset --): adds one translation offset to position.SCHEMA_NAME: reports "Pose".pose (position orientation -- pose): constructs one pose from one position vector and one quaternion.identityPose (-- pose): returns zero translation with identity orientation.poseCast (pose schema -- pose): casts both the position vector and the orientation quaternion to the selected real schema.* (vector pose -- vector): rotates the vector by pose.orientation and then adds pose.position.* (pose0 pose1 -- pose): composes the transforms so that applying the result to one vector is equivalent to applying pose1 first and pose0 second.inverse (pose -- inversePose): returns the inverse rigid transform.interpolate (pose0 pose1 blend -- pose): linearly interpolates position and applies normalized linear interpolation to orientation.mirrorVertically (pose z -- mirroredPose): reflects the translation across the horizontal plane at z and mirrors the orientation accordingly."Pose.pose" use
"Quaternion.identityQuaternion" use
"control" use
{} () {} [
p: (1.0r32 2.0r32 3.0r32) Real32 identityQuaternion pose;
@p.position printStack _:;
@p.orientation printStack _:;
] "main" exportFunction
(1.0r32 2.0r32 3.0r32) Cref
{
QUATERNION: ();
entries: (0.0r32 0.0r32 0.0r32 1.0r32);
} Cref
"Pose.*" use
"Pose.identityPose" use
"control" use
{} () {} [
p: identityPose;
(1.0r32 2.0r32 3.0r32) @p * printStack _:;
] "main" exportFunction
(1.0r32 2.0r32 3.0r32)
"Pose.pose" use
"Pose.poseCast" use
"Quaternion.identityQuaternion" use
"control" use
{} () {} [
p: (1.0r32 2.0r32 3.0r32) Real32 identityQuaternion pose;
q: @p Real64 poseCast;
@q.position printStack _:;
@q.orientation printStack _:;
] "main" exportFunction
(1.0 2.0 3.0) Cref
{
QUATERNION: ();
entries: (0.0 0.0 0.0 1.0);
} Cref
"Pose.pose" use
"Pose.*" use
"Quaternion.identityQuaternion" use
"algebra" use
"String" use
"control" use
{} Int32 {} [
p: (1.0r32 2.0r32 3.0r32) Real32 identityQuaternion pose;
transformed: (1.0r32 1.0r32 1.0r32) @p *;
expected: (2.0r32 3.0r32 4.0r32);
transformed expected = print
LF print
0
] "main" exportFunction
TRUE