Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Native client library avatar mixer APIs. #1655

Closed
wants to merge 40 commits into from

Conversation

namark
Copy link
Contributor

@namark namark commented May 9, 2022

  • New library strictly for handling avatar network packets.
  • API functions based on the new library.
  • API unit tests.
  • API documentation.
  • Existing client and server code reworked to make use of the new library.

This does not include APIs for avatar entities, since those require serialization code from entities library that will be included in a separate PR.

Most of the code is copied from the libraries/avatars to libraries/avatars-core, with some changes to allow reuse in client library, mainly using CRTP. There are a number of FIXME: CRTP comments left with code snippets to aid the reintegration of the new templates into the existing codebase as the final step of refactoring.

To summarize:

  • avatars-core/src/AssociatedTraitValues is identical to avatars/src/AssociatedTraitValues and is meant to replace it.

  • avatars-core/src/AvatarLogging is identical to avatars/src/AvatarLogging and is meant to replace it.

  • avatars-core/src/AvatarDataStream is meant to become a base class of avatars/src/AvatarData, handling de/serialization of network packets and sending of client's avatar packets. It is a base of vircadia-client/src/internal/avatars/AvatarData.
    AvatarData.h moved to AvatarDataStream.h stripped down and turned into a template.
    AvatarData.cpp moved to AvatarDataStream.hpp for the template implementation with modifications and to AvatarDataStream.cpp for a few non template functions without modifications.

  • avatars-core/src/AvatarPackedHandler is meant to become a base class of avatars/src/AvatarHashMap handling the reception of network packets. It is a base of vircadia-client/src/internal/avatars/AvatarManager.
    AvatarHashMap.h moved to AvatarPacketHandler.h and turned into a template.
    AvatarHashMap.cpp moved to AvatarPacketHandler.hpp with modifications.

  • avatars-core/src/ClientTraitsHandler is meant to become a base of avatars/src/ClientTraitsHandler. The code is identical just templated on avatar pointer type. It is a base of vircadia-client/src/internal/avatars/ClientTraitsHandler.
    ClientTraitsHandler.h moved and turned into a template.
    ClientTraitsHandler.cpp moved to ClientTraitsHandler.hpp with template definitions, the actual implementation code is unchanged.

  • avatars-core/src/AvatarTraits is a replacement for avatars/src/AvatarTraits.
    AvatarTraits.h moved and turned some function turned into templates.
    AvatarTraits.cpp moved to AvatarTraits.hpp for the templated parts and AvatarTraits.cpp for non templated parts, without modification to the actual implementation.

The unit tests are not comprehensive, but they cover the basic functionality (name, model URL, bounds, position, rotation, scale and joints) and can be extended further as other use cases come up.

Instructions for building the client library and running it's tests: https://github.com/vircadia/vircadia/tree/unity-sdk/libraries/vircadia-client. For full test coverage there should be a server running on localhost. Also the avatar tests consist of two parts, sender and receiver that should ran in parallel with ctest -j4.

@namark namark marked this pull request as draft May 9, 2022 16:47
namark added 2 commits May 18, 2022 17:03
since it's not working on windows and mac automated builds.
since automated build environments for mac and windows don't seem to
have it in the standard library.
specifically orientation, bounding box and scale.
specifically look at position, audio loudness, sensor to world matrix
additional flags, parent info and local position.
specifically hand controllers, face tracker info and joint data.
namark added 2 commits May 26, 2022 02:25
specifically far grab joints, skeleton data and grab data.
@vircadia-build-notifier
Copy link

@namark namark added the rebuild rebuild through the GithubActions label Jun 6, 2022
@vircadia-build-notifier
Copy link

@digisomni digisomni requested review from ctrlaltdavid and a team and removed request for ctrlaltdavid June 7, 2022 01:07
@digisomni digisomni added the needs testing (QA) The PR is ready for testing label Jun 7, 2022
@digisomni
Copy link
Member

QA consists of running the new unit tests and also testing avatars on a Domain with the native Interface.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
needs testing (QA) The PR is ready for testing rebuild rebuild through the GithubActions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants