Skip to main content
Version: 2.x

Set Room Position

Sets the position of this peer on the given channels without an encoder, e.g. for a peer without a microphone that only listens. The server forwards the audio of a channel only between peers within range of each other on it, and a peer that never sent a position is at the origin. Positions use the scale of UOdinEncoder::SetPosition: a distance of 1.0 is the hearing range. While the room is joined, a changed position is sent right away, but at most every MinPositionSendInterval seconds, so it can be set every frame; a position that is the same in a datagram (in steps of 1/16) is not sent again. The positions are sent again after every join and every PositionResendInterval seconds, as the packets can be lost.

  • Node type: Callable function. Has execution pins and runs when it is reached in the event graph.
  • Target: Odin Room
  • Menu category: Odin › Room
  • C++: UOdinRoom::SetPosition
note

The server keeps the last position of every channel and cannot forget one; move a channel elsewhere instead of clearing it.

Encoders linked to this room (UOdinSubsystem::LinkEncoder, e.g. by Create Encoder or Link Encoder To Room) get the positions too, when they are linked and when a position changes, as the server keeps the position that arrived last and their audio carries their own positions. They then also transmit their audio on these channels and keep their other ones (a new encoder transmits on channel 0 at the origin). The room still sends its positions as well, for the times without audio. To only listen on a channel while talking on others, turn bSetEncoderPositions off and set the positions of the encoder with UOdinEncoder::SetPosition; a channel both use needs the same position on both. An encoder whose datagrams are sent with SendAudio is not linked and does not get the positions.

An empty channel mask sets nothing and logs a warning. A coordinate that is not a number is sent as 0 and one out of range (the fixed point of the server holds -134217728 to 134217727) as the nearest limit, as the native library sends such a position of an encoder; the first such position in a row logs a warning. Game thread only.

The positions are sent as position-only datagrams in the grid-common wire format, the kind an encoder sends while silent. The server only updates the listed channels and forwards nothing; a room cipher leaves the datagram unencrypted, as the server needs the positions.

Inputs​

NameTypeDescription
TargetOdin RoomThe Odin Room to call this function on.
Channel MaskOdin Channel Maskchannels to set the position on
PositionOdin Positionposition on these channels

Outputs​

NameTypeDescription
Return ValueBooleantrue if the position is set