Skip to content

Using The API

Alpha notice: this SDK API is prone to change while the public surface stabilizes.

These examples use the ViziverseAI SDK API.

ViziverseVision

ViziverseVision is the static entry point.

Initialize And Shutdown

csharp
ViziverseVision.Initialize();
ViziverseVision.Shutdown();

Initialize() starts public SDK event delivery. It is safe to call more than once.

Shutdown() removes SDK event subscriptions and clears cached people.

Read SDK State

csharp
bool running = ViziverseVision.IsRunning;
int count = ViziverseVision.PeopleCount;
IReadOnlyList<Person> people = ViziverseVision.People;

People returns the current tracked people as a read-only list.

Get One Person

csharp
Person? first = ViziverseVision.GetPerson(0);
Person? byId = ViziverseVision.GetPersonById(personId);
bool active = ViziverseVision.IsPersonActive(personId);

Use GetPerson(index) for simple loops. Use GetPersonById(id) when you need to follow the same person across frames.

Background Removal

csharp
ViziverseVision.EnableBackgroundRemoval();
ViziverseVision.DisableBackgroundRemoval();

ViziverseVision.SetBackgroundRemoval(person.Id, true);
bool enabled = ViziverseVision.IsBackgroundRemovalEnabled(person.Id);

Use the all-person methods for broad state changes and the per-person methods when only one tracked person should change.

Person

Person represents one tracked person. Instances are created and managed by the SDK.

Identity And Status

csharp
int id = person.Id;
bool active = person.IsActive;
float confidence = person.Confidence;
int frame = person.LastUpdatedFrame;

Id remains stable while the person is tracked.

2D Points

csharp
Vector2 wrist = person.GetPoint(BodyPoint.RightWrist);
float confidence = person.GetPointConfidence(BodyPoint.RightWrist);
bool visible = person.IsPointVisible(BodyPoint.RightWrist, 0.6f);

Use IsPointVisible() before treating a point as reliable.

3D Points

csharp
Vector3 wrist = person.GetPoint3D(BodyPoint.RightWrist);

GetPoint3D() does not return Unity world-space coordinates. Do not assign it directly to transform.position.

Distances And Measurements

csharp
float handDistance = person.GetDistanceBetween(BodyPoint.LeftWrist, BodyPoint.RightWrist);
float handDistance3D = person.GetDistance3DBetween(BodyPoint.LeftWrist, BodyPoint.RightWrist);

float shoulderWidth = person.ShoulderWidth;
float hipWidth = person.HipWidth;
float torsoHeight = person.TorsoHeight;

Distances are useful for gestures and relative measurements.

Simple State Checks

csharp
bool standing = person.IsStanding;
bool leftRaised = person.IsLeftArmRaised;
bool rightRaised = person.IsRightArmRaised;
Vector2 headDirection = person.HeadDirection;

These helpers provide common person-tracking states without exposing the underlying implementation.

BodyPoint

BodyPoint identifies the tracked point you want to read from a Person.

Common interaction points:

PointCommon Use
LeftWristLeft-hand interactions
RightWristRight-hand interactions
LeftIndexLeft pointer interactions
RightIndexRight pointer interactions
LeftShoulderUpper-body measurements
RightShoulderUpper-body measurements
LeftHipPerson-center checks
RightHipPerson-center checks

Use BodyPoint.RightWrist and the other named constants directly. Do not write code against numeric point IDs.

ViziverseAI SDK API reference.