Skip to main content

BoneTransform

C++ class C++ only
class AR51SDK_API BoneTransform;

A handle to a single bone of a UPoseableMeshComponent, carrying a cached bind-pose (init) transform. The IK solver and the character's finger-joint accessors (UAR51Character::GetLeftHandJoints() / GetRightHandJoints()) hand these out so you can read or override a bone's pose, then push the result back onto the mesh with Apply().

C++ only

BoneTransform is not Blueprint-exposed (no UFUNCTION/UPROPERTY reflection). It is callable from C++ only.

Units & space

All positions are in centimetres, all rotations in degrees, and world reads/writes are in UE world space (per EBoneSpaces::WorldSpace). AR 51 mocap data is metres — convert at the boundary if you mix the two.

Identity

MemberTypeDescription
BoneIndexintthe bone's index within the UPoseableMeshComponent
BoneNameFNamethe bone's skeleton name

Method summary

Bind-pose reads (the cached init transform)

MethodReturns
initLocalPosition / initLocalRotation / initLocalScaleFVector / FQuatC++ only
initPosition / initRotation / initScaleFVector / FQuatC++ only

World read/write

MethodReturns
position / rotation / lossyScaleFVector / FQuatC++ only
localToWorldMatrix / worldToLocalMatrixFMatrixC++ only
SetPosition / SetRotation / SetLossyScalevoidC++ only

Local read/write

MethodReturns
localPosition / localRotation / localScaleFVector / FQuatC++ only
SetLocalPosition / SetLocalRotation / SetLocalScalevoidC++ only

Hierarchy & commit

MethodReturns
ApplyvoidC++ only
GetParnet (sic)BoneTransformC++ only
SetParentvoidstatic · C++ only
GetChildren / GetChild / GetChildOrNullC++ only

→ Full descriptions in Method details below.

Method details

Bind-pose reads

methodC++ only
FVector initLocalPosition() const;
FQuat initLocalRotation() const;
FVector initLocalScale() const;

FVector initPosition() const; // world
FQuat initRotation() const; // world
FVector initScale() const; // world

The bone's bind-pose (rest) transform, captured when the handle was created — both in the bone's local space (initLocal…) and in UE world space (init…). Use these as the reference pose to compute offsets against the live pose.

ReturnsFVector / FQuatthe cached init position (cm), rotation (degrees, as a quaternion), or scale

World read/write

methodC++ only
FVector position() const; // UE world space, cm
FQuat rotation() const; // UE world space
FVector lossyScale() const; // accumulated world scale

FMatrix localToWorldMatrix() const;
FMatrix worldToLocalMatrix() const;

void SetPosition(const FVector& WorldPosition);
void SetRotation(const FQuat& WorldRotation);
void SetLossyScale(const FVector& WorldScale);

Read or override the bone's current pose in UE world space (centimetres / degrees). lossyScale() is the non-recoverable accumulated world scale (matching Unity's Transform.lossyScale). The two matrix getters give the bone's full world transform and its inverse.

Setters stage the new value; nothing reaches the mesh until you call Apply().

Parameters
WorldPositionFVectortarget world position, cm
WorldRotationFQuattarget world rotation
WorldScaleFVectortarget world scale
Exampleinferred
// Nudge a finger joint 1 cm along world +Z, then commit
for (const TSharedPtr<BoneTransform>& Joint : Character->GetRightHandJoints())
{
Joint->SetPosition(Joint->position() + FVector(0, 0, 1.f)); // UE cm
Joint->Apply();
}

Local read/write

methodC++ only
FVector localPosition() const;
FQuat localRotation() const;
FVector localScale() const;

void SetLocalPosition(const FVector& LocalPosition);
void SetLocalRotation(const FQuat& LocalRotation);
void SetLocalScale(const FVector& LocalScale);

Same as the world accessors but relative to the bone's parent. Local rotation is the value you usually animate per-joint (e.g. finger curl). Setters stage the value; call Apply() to push it to the mesh.

Parameters
LocalPositionFVectorparent-relative position, cm
LocalRotationFQuatparent-relative rotation
LocalScaleFVectorparent-relative scale

Apply

methodC++ only
void Apply();

Finalizes the staged transform onto the underlying UPoseableMeshComponent. The Set… calls only update this handle's working state — Apply() is what makes the change visible on the mesh. Call it once per bone after staging all the position/rotation/scale you want.

Hierarchy

methodC++ only
BoneTransform GetParnet() const; // (sic) — spelled "GetParnet" in the SDK
static void SetParent(BoneTransform& parent, BoneTransform& child);

TArray<BoneTransform> GetChildren() const;
BoneTransform GetChild(int i) const;
BoneTransform GetChildOrNull(int i) const;

Walk or rewire the bone hierarchy. GetParnet() returns the parent bone handle (note the SDK's misspelling). SetParent is static — it reparents child under parent. GetChild(i) indexes a child directly; GetChildOrNull(i) is the bounds-safe variant that returns an invalid/empty handle instead of asserting when i is out of range.

Parameters
iintchild index
ReturnsBoneTransformthe requested parent or child bone handle

TTransform

C++ class C++ only
class AR51SDK_API TTransform;

A Unity-Transform-style wrapper over an AActor / USceneComponent. It exists to make porting Unity code to Unreal easier: it exposes the same position / localPosition / eulerAngles / parent / GetChild surface a Unity developer expects, mapped onto UE actors and scene components. It is a convenience utility — not part of the mocap data path.

C++ only

TTransform is not Blueprint-exposed. It is callable from C++ only.

Units

UE units throughout — positions in centimetres, rotations in degrees. (Unity code being ported uses metres/degrees; convert positions when bridging.)

Method summary

Transform read/write

MethodReturns
position / localPosition (+ setters)FVectorC++ only
rotation / localRotation (+ setters)FQuatC++ only
eulerAngles / localEulerAngles (+ setters)FVectorC++ only
localScale / lossyScale (+ setter)FVectorC++ only
localToWorldMatrix / worldToLocalMatrixFMatrixC++ only

Hierarchy

MethodReturns
GetParent / SetParentTTransform / voidC++ only
GetRootTTransformC++ only
GetChildren / GetChildC++ only
DFSC++ only

Utility

MethodReturns
IsValidboolC++ only
GetName / SetNameFString / voidC++ only

→ Full descriptions in Method details below.

Method details

Transform read/write

methodC++ only
// World
FVector position() const; void SetPosition(const FVector&); // cm
FQuat rotation() const; void SetRotation(const FQuat&);
FVector eulerAngles() const; void SetEulerAngles(const FVector&); // degrees
FVector lossyScale() const;

// Local
FVector localPosition() const; void SetLocalPosition(const FVector&);
FQuat localRotation() const; void SetLocalRotation(const FQuat&);
FVector localEulerAngles()const; void SetLocalEulerAngles(const FVector&);
FVector localScale() const; void SetLocalScale(const FVector&);

// Matrices
FMatrix localToWorldMatrix() const;
FMatrix worldToLocalMatrix() const;

The full Unity-style transform surface, in both world and local space, mapped onto the wrapped actor/scene component. Euler getters/setters mirror Unity's eulerAngles / localEulerAngles (degrees); lossyScale() is the accumulated world scale. Unlike BoneTransform there is no Apply() — writes go straight to the underlying USceneComponent.

Exampleinferred
// Port of a Unity snippet: face the world origin
TTransform T(MyActor);
const FVector Dir = (FVector::ZeroVector - T.position()).GetSafeNormal();
T.SetRotation(FRotationMatrix::MakeFromX(Dir).ToQuat());

Hierarchy

methodC++ only
TTransform GetParent() const;
void SetParent(const TTransform& parent);
TTransform GetRoot() const;
TArray<TTransform> GetChildren() const;
TTransform GetChild(int i) const;
TArray<TTransform> DFS() const;

Navigate or rewire the scene-graph the way Unity's Transform does. GetRoot() returns the topmost ancestor; DFS() returns the subtree flattened in depth-first order (root first), handy when porting Unity hierarchy traversals.

Parameters
iintchild index
parentTTransformthe new parent to attach under
ReturnsTTransformthe requested parent, root, or child wrapper

Utility

methodC++ only
bool IsValid() const;
FString GetName() const;
void SetName(const FString& name);

IsValid() reports whether the wrapper still points at a live actor/component — check it before dereferencing a handle you have held across frames. GetName / SetName read and set the wrapped object's name.

Returnsbooltrue while the wrapped actor/component is valid

See also

Was this page helpful?