diff --git a/avatar-mixer/src/main.cpp b/avatar-mixer/src/main.cpp index b2e28fe484..8383c992b2 100644 --- a/avatar-mixer/src/main.cpp +++ b/avatar-mixer/src/main.cpp @@ -51,6 +51,13 @@ void attachAvatarDataToNode(Node* newNode) { } } +// NOTE: some additional optimizations to consider. +// 1) use the view frustum to cull those avatars that are out of view. Since avatar data doesn't need to be present +// if the avatar is not in view or in the keyhole. +// 2) after culling for view frustum, sort order the avatars by distance, send the closest ones first. +// 3) if we need to rate limit the amount of data we send, we can use a distance weighted "semi-random" function to +// determine which avatars are included in the packet stream +// 4) we should optimize the avatar data format to be more compact (100 bytes is pretty wasteful). unsigned char broadcastPacketBuffer[MAX_PACKET_SIZE]; unsigned char avatarDataBuffer[MAX_PACKET_SIZE]; void broadcastAvatarData(NodeList* nodeList, sockaddr* nodeAddress) {