Skip to content

Entity

Generic entity within a model hierarchy (bones, groups, nested models)

Access via representation.findChild(). Allows manipulation of nested entities within loaded USDZ models.

Example:

javascript
var bone = rep.findChild("thumb_1");
bone.rotation = hand.joints.thumbKnuckle.localTransform.rotation;

// Iterate children
rep.findChild("wrist").children.forEach(function(child) {
    console.log(child.name);
});

Properties

children

  • Type: Array<any>
  • Direct child entities

isEnabled

  • Type: boolean
  • Whether this entity is enabled/visible

jointNames

  • Type: Array<any>
  • Joint names for skeletal animation (empty if not a skeletal model)

jointTransforms

  • Type: Array<any>
  • Joint transforms array (parallel to jointNames)

name

  • Type: string
  • Entity name

opacity

  • Type: number
  • Opacity (0-1)

position

  • Type: Vector3
  • Local position relative to parent

rotation

  • Type: Rotation
  • Local rotation as quaternion

scale

transform

  • Type: Transform
  • Local transform (position, rotation, scale combined)

worldPosition

worldRotation

worldTransform

Methods

clearInstances()

javascript
clearInstances(): void

Remove instancing from this node, reverting to the single base mesh.

Returns: void

findChild()

javascript
findChild(name: string, recursive?: any): Entity

Find a child entity by name

Example:

javascript
var bone = entity.findChild("thumb_1");          // recursive
var direct = entity.findChild("arm", false);     // immediate only

Parameters:

  • name (string) - Entity name to find
  • recursive (any) (optional) - Search all descendants (default: true)

Returns: Entity

setInstances()

javascript
setInstances(transforms: any): void

GPU-instance this node's mesh – draw one copy per transform. Pass Instances.transforms([...]) (or a bare array of Transform / Vector3). Rendering-only (no physics / collision / identity). Gate with environment.features.has('instancing') (iOS 26 / visionOS 26 / macOS 26+).

Parameters:

Returns: void