Skip to main content

IPersonBase

UINTERFACE · BlueprintType BlueprintCallable BlueprintNativeEvent
UINTERFACE(BlueprintType)
class UPersonBase : public UInterface { GENERATED_BODY() };

class AR51SDK_API IPersonBase
{
GENERATED_BODY()
// methods: BlueprintCallable, BlueprintNativeEvent
};

Implements: UInterface (Unreal Engine)

One tracked person. This is what the USkeletonConsumer lookup methods return, as TScriptInterface<IPersonBase>. It is implementable in both C++ and Blueprint; every method is a BlueprintNativeEvent, so from C++ you call it through the generated Execute_ thunk (see Calling convention).

Id semantics
  • PersonId (GetId) — the mocap system's per-person id. The key for GetPersonByPersonId and PersonIdToCharacterBPMap.
  • DeviceId (GetDeviceId) — the associated headset/device id.
  • EntityId / EntityDisplayName come from an external system and are not on IPersonBase directly — they live on the USkeletonConsumer mapping APIs (GetPersonByEntityId, EntityIdToCharacterBPMap, …) and are used to choose which character Blueprint to spawn.
  • The active person is the one whose headset/camera is currently in use (USkeletonConsumer::GetActivePerson). The OnActivePersonChanged event passes an empty string ("") when no skeleton is associated with the headset.

Method summary

All methods are BlueprintCallable, BlueprintNativeEvent and const.

MethodReturns
GetIdFStringBlueprintNativeEvent
GetDeviceIdFStringBlueprintNativeEvent
GetCharacterUAR51Character*BlueprintNativeEvent
GetModelAActor*BlueprintNativeEvent
GetLastUpdateTimefloatBlueprintNativeEvent
GetTimeFromLastUpdatefloatBlueprintNativeEvent
IsTrackedboolBlueprintNativeEvent

→ Full descriptions in Method details below.

Calling convention

Because every method is a BlueprintNativeEvent, do not call Obj->GetCharacter() directly from C++. Call the static Execute_ thunk the interface generates, passing the underlying UObject*:

Exampleinferred
// A TScriptInterface<IPersonBase> comes back from the consumer.
TScriptInterface<IPersonBase> Person = Consumer->GetActivePerson();

if (UObject* Obj = Person.GetObject()) // null when no active person
{
// BlueprintNativeEvent → call through Execute_:
UAR51Character* Char = IPersonBase::Execute_GetCharacter(Obj);
const FString Id = IPersonBase::Execute_GetId(Obj);

if (Char && IPersonBase::Execute_IsTracked(Obj))
{
const FVector Head = Char->GetHeadPosition(); // UE world space, cm
}
}

In Blueprint the same methods appear as ordinary nodes off a TScriptInterface<IPersonBase> (or Person Base reference) pin — no Execute_ wrapper needed.

Method details

GetId

methodBlueprintCallableBlueprintNativeEvent
FString GetId() const; // IPersonBase::Execute_GetId(Obj)

The unique PersonId — the mocap system's per-person id. Stable for the life of the tracked person; the key used by GetPersonByPersonId and PersonIdToCharacterBPMap. See Id semantics above.

ReturnsFStringthe mocap PersonId

GetDeviceId

methodBlueprintCallableBlueprintNativeEvent
FString GetDeviceId() const; // IPersonBase::Execute_GetDeviceId(Obj)

The associated device/headset id. Distinct from PersonId — the device this person is wearing/using, when one is associated.

ReturnsFStringthe device/headset id, or empty if none is associated

GetCharacter

methodBlueprintCallableBlueprintNativeEvent
UAR51Character* GetCharacter() const; // IPersonBase::Execute_GetCharacter(Obj)

The mocap-driven UAR51Character component for this person — the usual hop to read joint state (head, wrists, hand joints). The consumer drives this component every frame; you read from it.

ReturnsUAR51Character*the driven character component for this person
Exampleinferred
if (UObject* Obj = Person.GetObject())
{
if (UAR51Character* Char = IPersonBase::Execute_GetCharacter(Obj))
{
const FVector L = Char->GetLeftWristPosition(); // UE cm
const FVector R = Char->GetRightWristPosition();
}
}

GetModel

methodBlueprintCallableBlueprintNativeEvent
AActor* GetModel() const; // IPersonBase::Execute_GetModel(Obj)

The spawned actor representing the person in the level (the AAR51CharacterActor that hosts the character component). Use it for actor-level operations — attachment, visibility, world transform.

ReturnsAActor*the spawned model actor for this person

GetLastUpdateTime

methodBlueprintCallableBlueprintNativeEvent
float GetLastUpdateTime() const; // IPersonBase::Execute_GetLastUpdateTime(Obj)

The timestamp (seconds) at which this person's skeleton was last updated. Pair with GetTimeFromLastUpdate to detect staleness.

Returnsfloatseconds-stamp of the last update

GetTimeFromLastUpdate

methodBlueprintCallableBlueprintNativeEvent
float GetTimeFromLastUpdate(float currentTime) const; // IPersonBase::Execute_GetTimeFromLastUpdate(Obj, Now)

Elapsed time since the last update — effectively currentTime - GetLastUpdateTime(). Use it to gate logic on stale persons (e.g. mirror the consumer's InactivePersonMaxSeconds / HidePersonMaxSeconds thresholds).

Parameters
currentTimefloatthe current time, in seconds, on the same clock as GetLastUpdateTime
Returnsfloatelapsed seconds since this person was last updated

IsTracked

methodBlueprintCallableBlueprintNativeEvent
bool IsTracked() const; // IPersonBase::Execute_IsTracked(Obj)

Whether this person is currently tracked. A person can persist briefly while tracking is lost (until the consumer's removal thresholds elapse), so check this before trusting positional reads.

Returnsbooltrue while the person is actively tracked
Exampleinferred
if (UObject* Obj = Person.GetObject(); Obj && IPersonBase::Execute_IsTracked(Obj))
{
UE_LOG(LogTemp, Log, TEXT("Tracking %s"), *IPersonBase::Execute_GetId(Obj));
}

See also

Was this page helpful?