Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

AvatarControllerViewer

  • Last UpdatedOct 22, 2025
  • 6 minute read

The AvatarControllerViewer node provides a simplified interface for scene navigation for projects where the avatar does not need to show a human body.

The Avatar node enables a user to move inside a 3D scene. It has a large set of predefined functionalities, mostly related to its human body counterpart. Sometimes, when creating custom navigation functionalities, you do not need the complexity that results by directly using the Avatar node.

Platform support

This node is fully supported on XR-Windows platform.

It is partially supported on XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P WASM platforms.

The only functionality that works just on XR-Windows is the collision with CMeshes.

XR-WIN

XR-P-WIN

XR-P-IOS

XR-P-AND

XR-P-WASM

Full support

Partial support

Partial support

Partial support

Partial support

Full support

Limited support

Limited support

Limited support

Limited support

Configuring the avatar for being controlled

In order to let an AvatarControllerViewer node take control of an avatar, the Avatar requires the following settings:

  • Avatar.mode must be set to controller.

  • Avatar.controllerNode must be set to the name of the AvatarControllerViewer node.

When controlled by a controller, the avatar position and orientation shows actual camera posture.

Navigation modes

AvatarControllerViewer supports these behaviors.

Behavior

Description

fly

The avatar can be moved freely in any direction.

walk

The avatar can be moved freely on the XZ plane but cannot go up and down.

target

The avatar can rotate and zoom around a target point that is set at the center of the screen.

orbit

The avatar can rotate around the selected target point, but this remains at the same position on the screen. The avatar can also zoom on the camera at vector.

cvp3dvs

This mode recreates 3DVS navigation and can be considered a mix of target and orbit.

cad

The cad mode is the only mode that allows fly and target/orbit at the same time, which enables a cad-style navigation with few lines of script

Controlling movements

The AvatarControllerViewer offers a set of input fields that can trigger movements of the avatar:

  • flyX, flyY, flyZ: To move on the 3 axis.

  • yaw, pitch: To rotate.

  • zoom: To zoom in and out.

These parameters must receive values in the [-1 1] range. Their values represent movement intensity and are multiplied by a corresponding speed to define the actual movement.

Depending on the selected mode, the effect of the input fields on the Avatar will be different.

You can link movements to any type of input control.

The controller can only receive movements and apply them to the avatar. Therefore, in order to instantly position the avatar into a different position or rotation, you will need to use corresponding avatar node fields.

3DVS navigation

This navigation is composed of three types of movement:

  • Rotation around a target

    • In front of camera at default distance when the mouse is not picking any mesh.

    • Around the pick point when the mouse is hovering a mesh. The camera rotation is interpolated so that the pick point ends up in the middle of the screen after 1.5 seconds of actively rotating in any direction.

  • Moving toward a target at a speed proportional to distance from target (zoom)

    • Along camera forward axis when the mouse is not picking any mesh (default distance is used to calculate the speed).

    • Toward the pick point when the mouse is hovering a mesh (pick point distance is used to calculate the speed).

  • Moving in camera space on local XY plane (pan)

    • Speed of the movement is calculated based on the distance in the camera frustum of the picked point, if not picking anything, default distance is used.

When the AvatarControllerViewer mode is set to cvp3dvs, all the means to make a 3DVS-like navigation are provided to the script layer through the existing fields. In detail, to reproduce this type of navigation, the script will need to:

  • target: This field needs to be populated with the mesh picked under the mouse cursor at the beginning of each mouse drag.

  • yaw and pitch: Used to rotate the avatar. Depending on cvp3dvsConvergeEnable, the center of rotation will be target position or a point in front of the camera at cvp3dvsStandardDistance.

  • flyX and flyY: Used for the pan movement. Depending on cvp3dvsConvergeEnable, the pan speed will be based on distance from target position or cvp3dvsStandardDistance.

  • zoom: Used for moving along the camera to target vector. Depending on cvp3dvsConvergeEnable, the zoom direction will be toward target position or toward camera forward. Zoom speed is proportional to the distance between camera and target, so depending on cvp3dvsConvergeEnable, distance will be calculated from the distance from target or cvp3dvsStandardDistance.

CAD Navigation

CAD navigation is composed of three types of movement:

  • Rotation around a target or self

    • In front of camera at defaultTargetDistance field distance when rotationMode is set to front.

    • In front of camera at target field position when rotationMode is set to target. If target position is not in front of the camera, the camera is rotated instantly to have it in the middle of the screen.

    • Orbiting around target field position when rotationMode is set to orbit.

    • Around self when rotationMode is set to self.

  • Zooming in and out

    • Along camera forward axis when rotationMode is not orbit.

    • Toward target field position when rotationMode is orbit.

  • Moving in camera space on local XYZ

    • If rotationMode is not target, it is possible to move along all three local axes.

    • If rotationMode is target, it is possible to move along local Z axis only, which corresponds to the zoom movement.

Collision checks, when enabled work for any kind of movement, even though on rotations they are not taking into account the curvature of the movement, but only the starting position and the final position it produces.

AvatarControllerViewer fields

These are the fields for AvatarControllerViewer node. Only the node-specific fields are indicated, not fields obtained by inheritance.

Field inheritance: NodeBase > AvatarControllerViewer

Fields

Type

Use

Default value

Description

collisionCmesh

sstring

Optional

|cmesh_fly

Specifies with what the avatar can collide. It’s a string that must be part of a collision name unique name to let the avatar collide with.

collisionEnable

sfloat

Optional

true

Specifies whether collision is supported.

collisionRay

sfloat

Optional

5

Avatar collision ray in meters.

cvp3dvsConvergeEnable

sbool

Optional

false

Enables/disable the usage of Target to perform movements when in cvp3dvs mode. See 3DVS Navigation section on this page for more details.

defaultTargetDistance

sfloat

Optional

1

The default distance used in cvp3dvs and cad mode.

flyRunSpeed

sfloat

Optional

20

The speed multiplier when flying fast (running), expressed in meters/second.

flySpeed

sfloat

Optional

5

The speed multiplier when flying/walking, expressed in meters/second.

flyX

sfloat

Optional

0

The intensity of movement on the X axis (in avatar local space).

flyY

sfloat

Optional

0

The intensity of movement on the Y axis (in avatar local space).

flyZ

sfloat

Optional

0

The intensity of movement on the Z axis (in avatar local space).

mode

senum

Optional

fly

Specifies the selected navigation mode. The possible values are fly, walk, target, orbit, cad, or cvp3dvs.

pitch

sfloat

Optional

0

The Pitch movement intensity (related to avatar local space).

pitchSpeed

sfloat

Optional

2

The Pitch rotation multiplier, expressed in radiants/second.

rotationMode

senum

Optional

self

Used in cad mode to determine the type of rotation.

run

sbool

Otional

false

When set to true, the avatar is moved using the flyRunSpeed multiplier.

target

svec3

Optional

0 0 0

The position of the target to move around when in orbit mode. When in cvp3dvs mode, this value is used to represent the mouse collision point.

useDeltaTime

sbool

Optional

true

Enables or disables the use of frame delta time as a multiplier of all movements. Disable this if you want to control the movements from script passing exact deltas in meters for fly/zoom and in radians for yaw/pitch.

yaw

sfloat

Optional

0

The Yaw movement intensity (related to avatar local space).

yawSpeed

sfloat

Optional

2

The Yaw rotation multiplier, expressed in radiants/second.

zoom

sfloat

Optional

0

The zoom movement intensity.

zoomRange

svec2

Optional

0 -1

Specifies the minimum and maximum to target distance when in orbit mode, expressed in meters. Setting the maximum distance to -1 enables infinity distance.

zoomSpeed

sfloat

Optional

1

The speed of the zoom movement.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in