diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 6aa976966c..dbd46cbfbd 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -258,6 +258,10 @@ void AvatarManager::handleOutgoingChanges(VectorOfMotionStates& motionStates) { void AvatarManager::handleCollisionEvents(CollisionEvents& collisionEvents) { // TODO: expose avatar collision events to JS for (Collision collision : collisionEvents) { + // TODO: Current physics uses null idA or idB for non-entities. The plan is to handle MOTIONSTATE_TYPE_AVATAR, + // and then MOTIONSTATE_TYPE_MYAVATAR. As it is, this code only covers the case of my avatar (in which case one + // if the ids will be null), and the behavior for other avatars is not specified. This has to be fleshed + // out as soon as we use the new motionstates. if (collision.idA.isNull() || collision.idB.isNull()) { MyAvatar* myAvatar = getMyAvatar(); const QString& collisionSoundURL = myAvatar->getCollisionSoundURL(); @@ -267,7 +271,9 @@ void AvatarManager::handleCollisionEvents(CollisionEvents& collisionEvents) { const bool isSound = (collision.type == CONTACT_EVENT_TYPE_START) && (velocityChange > MIN_AVATAR_COLLISION_ACCELERATION); if (!isSound) { - break; + // TODO: When the new motion states are used, we'll probably break from the whole loop as soon as we hit our own avatar + // (regardless of isSound), because other users should inject for their own avatars. + continue; } // Your avatar sound is personal to you, so let's say the "mass" part of the kinetic energy is already accounted for. const float energy = velocityChange * velocityChange;