Developer Documentation

OdinRoom.updatePosition

public updatePosition(x: number, y: number, z: number): void

Updates the three-dimensional position of the current peer in this room. The server utilizes the provided coordinates to perform automatic culling among peers in the same room, based on unit circles with a radius of 1.0. This feature is particularly beneficial in scenarios involving a large number of peers within the same room, enabling peers to interact or ‘see’ each other only when in close proximity. To modify the distance sensitivity for position updates, use setPositionScale.

Note: Use this before calling join to set the initial peer position upon connect.

Parameters

NameTypeDescription
xnumberThe new x position of the peer.
ynumberThe new y position of the peer.
znumberThe new z position of the peer.

Returns

TypeDescription
void