Skip to main content

odin_room_update_position

Updates the three-dimensional position of the current peer within the specified

OdinRoomHandle

. 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

odin_room_set_position_scale

.

Declaration
OdinReturnCode odin_room_update_position(OdinRoomHandle room, float x, float y, float z);

Parameters

room

Handle of the room where the position will be updated. See

OdinRoomHandle

for more information.

Declaration
OdinRoomHandle room;

x, y, z

Coordinates representing the new position of the local peer in 3D space.

info

Use

odin_room_set_position_scale

to adjust the scaling factor for spatial audio positions. You should provide coordinates in your games unique coordinate system, i.e. in Unity or Unreal units. Use the scaling factor you can set with

odin_room_set_position_scale

to adapt the coordinates to the unit circle with a radius of 1.0.

I.e. if your Unity game is on an island which is 1000 units wide in each direction, you can set the scaling factor to 0.001 to adapt the coordinates to the unit circle with a radius of 1.0. This way, you can just set the coordinates in Unity units and the SDK will adapt them to the unit circle with a radius of 1.0.

Declaration
float x, float y, float z;

Returns

A return code indicating success or failure.

Return Type
OdinReturnCode