An entity used to animate a virtual character in an AR scene by tracking a real person.


class BodyTrackedEntity : Entity


Like a ModelEntity, a BodyTrackedEntity has a ModelComponent that defines its physical appearance. Unlike a model entity, a body-tracked entity lacks the components required to participate in collisions or physics simulations. Instead, a BodyTrackingComponent drives the positioning and arrangement of the entity based on tracking information from the AR session.

Diagram showing the components present in the body-tracked entity.

For an example of how to use a body-tracked entity, see Capturing Body Motion in 3D.


Creating an Entity

func clone(recursive: Bool) -> Self

Duplicates a body-tracked entity to create a new entity.

Identifying a Body-Tracked Entity

var id: ObjectIdentifier

The stable identity of the entity associated with self.

var id: UInt64

The stable identity of the body-tracked entity.

typealias BodyTrackedEntity.ID

A type of unique identifier used for a body-tracked entity.

Configuring Body Tracking

var bodyTracking: BodyTrackingComponent

The body-tracking component for the body-tracked entity.

struct BodyTrackingComponent

A component for tracking people in an AR session.

protocol HasBodyTracking

An interface that enables the animation of a virtual character by tracking a real person in AR.

Configuring the Model

var model: ModelComponent?

The model component for the entity.

struct ModelComponent

A collection of resources that create the visual appearance of an entity.

var jointNames: [String]

The names of all the joints in the model.

var jointTransforms: [Transform]

The relative joint transforms of the model.

Loading a Stored Entity

Stored Entities

Manage entities stored as assets on disk.

Positioning Entities in Space

Finding the Nearest Anchor

Calculating the Collision Shape

Describing the Entity

See Also

Scene Elements

class AnchorEntity

An anchor that tethers virtual content to a real-world object in an AR session.

class ModelEntity

A representation of a physical object that RealityKit renders and optionally simulates.

class TriggerVolume

An invisible 3D shape that detects when objects enter or exit a given region of space.