Skip to content

Commit

Permalink
Merge pull request #214 from ctrlaltdavid/fix/skeleton-data
Browse files Browse the repository at this point in the history
Fix avatar skeleton data handling
  • Loading branch information
ctrlaltdavid authored Sep 26, 2022
2 parents 2650612 + 57f7ada commit b76ee0f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/domain/avatars/AvatarData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class AvatarData extends SpatiallyNestable {

// Need to call markTraitUpdated() here because there is no equivalent of C++'s Rig and sendSkeletonData().
if (this._clientTraitsHandler) {
this._clientTraitsHandler.markTraitUpdated(AvatarTraits.SkeletonModelURL);
this._clientTraitsHandler.markTraitUpdated(AvatarTraits.SkeletonData);
}

this.#_avatarSkeletonData = skeletonData;
Expand Down
2 changes: 1 addition & 1 deletion src/domain/avatars/AvatarTraits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const AvatarTraits = new class {
* An avatar trait.
* @typedef {object} AvatarTraits.AvatarTraitValue
* @property {AvatarTraits.TraitType} type - The type of trait.
* @property {number} version - The version number of the trait value for the avatar's connection to the avcatar mixer.
* @property {number} version - The version number of the trait value for the avatar's connection to the avatar mixer.
* This is incremented each time that the trait value is changed.
* @property {AvatarTraits.TraitValue} value - The trait value.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/domain/avatars/ClientTraitsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ClientTraitsHandler {
// C++ void markTraitUpdated(AvatarTraits::TraitType updatedTrait)

// WEBRTC TODO: Enable other trait types.
if (updatedTrait !== AvatarTraits.SkeletonModelURL) {
if (updatedTrait !== AvatarTraits.SkeletonModelURL && updatedTrait !== AvatarTraits.SkeletonData) {
console.error("Trait not implemented for updating:", updatedTrait);
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/domain/networking/packets/SetAvatarTraits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const SetAvatarTraits = new class {
* @property {number} currentTraitVersion - Trait sending sequence number. This should be incremented for each
* <code>SetAvatarTraits</code> packet written.
* @property {string} skeletonModelURL - The URL of the avatar's FST, glTF, or FBX model file.
* @property {SkeletonJoint[]} skeletonData - The avatar's skeleton.
* @property {ClientTraitStatus[]} traitStatuses - The status of each avatar trait.
* @property {boolean} initialSend - <code>true</code> to send all traits, <code>false</code> to send only those that have
* been updated.
Expand Down

0 comments on commit b76ee0f

Please sign in to comment.