Skip to main content

Adapters

C++ interfaces + template factory C++ only

The adapter layer is how a platform/device integration feeds hand-tracking and play-area data into the SDK, and how game code reads it back. There are two pure-C++ interfaces — IHandsAdapter and IBoundaryAdapter — and a template registry, AdapterFactory<TAdapter>, with two concrete factories, HandsAdapterFactory and BoundaryAdapterFactory.

Everything on this page is C++ only. None of these types is a UE UINTERFACE and none is Blueprint-exposed. An integration subclasses an interface and registers an instance with the matching factory; game code calls the factory's GetAdapter() to obtain the active adapter for the current platform.

Units & space

Unreal Engine uses centimeters for position and degrees for rotation; the AR 51 native domain uses meters. Positions returned by these adapters are documented as UE centimeters. ⚠️ Confirm whether the SDK converts AR 51 meters → UE cm at the adapter boundary, or whether the caller receives raw native units. For IBoundaryAdapter::GetPoints the exact space (world vs tracking) and whether points are 2D-on-floor or full 3D is also unverified.

IHandsAdapter

pure C++ interface C++ only AR51SDK_API
class AR51SDK_API IHandsAdapter

An abstract interface a platform/device integration implements to feed hand-tracking data into the SDK. Not a UE UINTERFACE — no Blueprint exposure. Game code consumes it (typically via HandsAdapterFactory::GetAdapter()) and reads the per-hand joint sets. Joints are returned as HandJointInfo — empty or zero-confidence entries indicate no tracking.

IHandsAdapter method summary

MethodReturns
GetSourceDeviceFStringC++ only · virtual, has default
GetRightJointInfosTArray<HandJointInfo>C++ only · pure virtual
GetLeftJointInfosTArray<HandJointInfo>C++ only · pure virtual

IBoundaryAdapter

pure C++ interface C++ only AR51SDK_API
class AR51SDK_API IBoundaryAdapter

An abstract interface that supplies the play-area / guardian boundary polygon. Not a UE UINTERFACE. Game code consumes it via BoundaryAdapterFactory::GetAdapter(); an integration implements it to provide the boundary geometry for its platform.

IBoundaryAdapter method summary

MethodReturns
GetBoundaryNameFStringC++ only · virtual, has default
GetPointsTArray<FVector>C++ only · pure virtual · ⚠️ UE cm

IHandsAdapter / IBoundaryAdapter method details

GetSourceDevice

methodC++ onlyvirtual
virtual FString GetSourceDevice() const;

Name of the tracking source. The default implementation returns "NoSource"; override it to identify the device/backend providing hand data.

ReturnsFStringthe source device/backend name, or "NoSource" if not overridden

GetRightJointInfos / GetLeftJointInfos

methodC++ onlypure virtual
virtual TArray<HandJointInfo> GetRightJointInfos() = 0;
virtual TArray<HandJointInfo> GetLeftJointInfos() = 0;

The current right-hand and left-hand joint sets. Both are pure virtual — an implementation must provide them. Empty arrays or zero-confidence HandJointInfo entries indicate the hand is not currently tracked.

ReturnsTArray<HandJointInfo>the joint set for that hand; empty / zero-confidence when untracked. Positions are UE cm ⚠️
Exampleinferred
if (IHandsAdapter* Hands = HandsAdapterFactory::GetAdapter())
{
const TArray<HandJointInfo> Right = Hands->GetRightJointInfos();
// Gate on whole-hand confidence, then read positions (UE cm):
const TArray<FVector> Pts = HandJointInfo::GetConfidentPositions(Right, 0.5f);
if (Pts.Num() == 0)
UE_LOG(LogTemp, Verbose, TEXT("Right hand not confidently tracked"));
}

GetBoundaryName

methodC++ onlyvirtual
virtual FString GetBoundaryName() const;

Boundary identifier. The default implementation returns "Native Default Boundary"; override to name the boundary source.

ReturnsFStringthe boundary name, or "Native Default Boundary" if not overridden

GetPoints

methodC++ onlypure virtual
virtual TArray<FVector> GetPoints() const = 0;

The boundary polygon as an ordered list of points — typically a floor-plane loop. Pure virtual.

ReturnsTArray<FVector>the ordered boundary points, in UE cm ⚠️ — space (world vs tracking) and whether the loop is 2D-on-floor (Z=0) or full 3D is unverified
Exampleinferred
if (IBoundaryAdapter* Boundary = BoundaryAdapterFactory::GetAdapter())
{
const TArray<FVector> Loop = Boundary->GetPoints(); // UE cm ⚠️
for (int32 i = 0; i < Loop.Num(); ++i)
DrawDebugLine(GetWorld(), Loop[i], Loop[(i + 1) % Loop.Num()], FColor::Green);
}

AdapterFactory<TAdapter>

template base class C++ only header-only
template<typename TAdapter>
class AdapterFactory

A per-adapter-type singleton registry keyed by platform. Game code calls the static GetAdapter() accessors to obtain the active adapter; integrations call Register / RegisterAllPlatforms to publish their implementations. Not Blueprint-exposed. The two concrete factories (HandsAdapterFactory, BoundaryAdapterFactory) inherit this full static API.

Lookup precedence: an adapter registered via RegisterAllPlatforms wins for every platform, taking precedence over per-platform entries.

Internal — not documented

A GetAdapter(AR51::PlatformType) overload also exists, but it takes the internal AR51::PlatformType (wire/proto) enum and is internal. Public callers should use the EPlatformTypes overload or the no-arg GetAdapter(). The EmptyHandsAdapter platform fallback and the AR51::PlatformTypeEPlatformTypes converters are also internal.

AdapterFactory method summary

Static

MethodReturns
ClearvoidC++ only
GetAdapter(platform)TAdapter*C++ only
GetAdapter()TAdapter*C++ only · resolves platform from AAR51SDK
RegistervoidC++ only
RegisterAllPlatformsvoidC++ only

Clear

methodstaticC++ only
static void Clear();

Drops all registered adapters — both the per-platform map and the all-platform override.

GetAdapter(platform)

methodstaticC++ only
static TAdapter* GetAdapter(EPlatformTypes platform);

Returns the adapter registered for a specific UE-facing platform, or nullptr if none is registered (an all-platform override, if present, still wins).

Parameters
platformEPlatformTypesthe target platform (see EPlatformTypes)
ReturnsTAdapter*the adapter for that platform, or nullptr

GetAdapter

methodstaticC++ only
static TAdapter* GetAdapter();

The normal game-side entry point. Resolves the current platform from the in-level SDK actor — AAR51SDK::Instance()->Platform (an EPlatformTypes) — and returns the adapter registered for it. Logs an error and returns nullptr if no AAR51SDK actor is present in the level.

ReturnsTAdapter*the adapter for the running platform, or nullptr if no SDK actor exists
Exampleinferred
// HandsAdapterFactory and BoundaryAdapterFactory inherit this:
if (IHandsAdapter* Hands = HandsAdapterFactory::GetAdapter())
UE_LOG(LogTemp, Log, TEXT("Hands source: %s"), *Hands->GetSourceDevice());

Register / RegisterAllPlatforms

methodstaticC++ only
static void Register(AR51::PlatformType platform, TAdapter* adapter);
static void RegisterAllPlatforms(TAdapter* adapter);

Publish an adapter into the registry. Register binds one adapter to a single platform — a null adapter is ignored (logged), and re-registering a platform overrides the previous entry (logged). RegisterAllPlatforms registers a single adapter that wins for every platform, taking precedence over per-platform entries during lookup.

Parameters
platformAR 51::PlatformTypethe platform key (⚠️ internal wire enum — the EPlatformTypes lookup overloads are the public read path)
adapterTAdapter*the adapter instance to register

HandsAdapterFactory

concrete factory C++ only
class HandsAdapterFactory : public AdapterFactory<IHandsAdapter>

The factory for IHandsAdapter. Inherits the full static API from AdapterFactory<TAdapter>. Call HandsAdapterFactory::GetAdapter() to obtain the active hands adapter for the running platform.

BoundaryAdapterFactory

concrete factory C++ only
class BoundaryAdapterFactory : public AdapterFactory<IBoundaryAdapter>

The factory for IBoundaryAdapter. Inherits the full static API from AdapterFactory<TAdapter>. Call BoundaryAdapterFactory::GetAdapter() to obtain the active boundary adapter for the running platform.

See also

Was this page helpful?