Skip to main content

Presence3D

Presence3D automatically implements Avatars, Mouse Pointers and Presence Controls into a Autodesk APS viewer.

How to use

To initialize the Presence3D component, you can follow our quickstart guide.

Usage

import { Presence3D } from "@superviz/autodesk-viewer-plugin";

const autodeskPresence = new Presence3D(viewer, {
isAvatarsEnabled: true,
isLaserEnabled: true,
isNameEnabled: true,
avatarConfig: {
height: 0,
scale: 1,
laserOrigin: { x: 0, y: 0, z: 0 },
},
});

When initializing the Presence3D you must pass the Autodesk viewer instance already loaded as the first parameter. As a second parameter you can use an options object with the listed properties:

NameTypeDescription
avatarConfigAvatarConfigConfiguration for the avatar, like scale, position, and laser settings.
isAvatarsEnabledbooleanEnable or disable the need for an avatar in the room.
Default value: true
isLaserEnabledbooleanEnable or disable laser pointers. If isAvatarsEnabled is set to false, this will also be false.
Default value: true
isMouseEnabledbooleanEnable or disable Mouse presence within the 3D model.
Default value: true
isNameEnabledbooleanEnable or disable showing the participant's name on top of the avatars.
Default value: true

Methods

follow()

The follow() method, when called with a participant ID as an argument, allows other participants to follow the referenced participant on the Autodesk viewer. You can, after, call the method without parameters to stop following the participant.

Example:

// Pass a participant ID to start following it
autodeskPresence.follow("<PARTICIPANT_ID>");

// Call the method without parameters to stop following the past participant
autodeskPresence.follow();

goTo()

The goTo() method, when called with a participant ID as an argument, allows other participants to quickly jump to the referenced participant position on Autodesk, facilitating quick location of participants.

Example:

autodeskPresence.goTo("<PARTICIPANT_ID>");

Types Definition

AvatarConfig

Type: object

An object describing the configuration for the avatar, like scale, position, and laser configuration.

NameTypeDescription
heightnumberRequired. The scale you want your avatar to be rendered, in pixels.
scalenumberRequired. The height you want your avatar to be positioned from the ground, in pixels.
laserOriginPositionRequired. Represents the origin position of your laser beam in relation to your avatar model.

Example:

avatarConfig: {
height: 1.6,
scale: 1,
laserOrigin: {
x: 0,
y: 0,
z: 0
}
}

Position

Type: object

Represents the origin position of your laser beam in relation to your avatar model.

NameTypeDescription
xnumberRequired. Represents the x-axis (horizontal) position.
ynumberRequired. Represents the y-axis (vertical) position.
znumberRequired. Represents the z-axis (depth) position.

Example:

laserOrigin: {
x: 0,
y: 0,
z: 0
}