mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 00:36:47 +02:00
Add comments re upcoming physics changes.
This commit is contained in:
parent
d0675c7f22
commit
1f3a1f6ac8
1 changed files with 7 additions and 1 deletions
|
@ -258,6 +258,10 @@ void AvatarManager::handleOutgoingChanges(VectorOfMotionStates& motionStates) {
|
||||||
void AvatarManager::handleCollisionEvents(CollisionEvents& collisionEvents) {
|
void AvatarManager::handleCollisionEvents(CollisionEvents& collisionEvents) {
|
||||||
// TODO: expose avatar collision events to JS
|
// TODO: expose avatar collision events to JS
|
||||||
for (Collision collision : collisionEvents) {
|
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()) {
|
if (collision.idA.isNull() || collision.idB.isNull()) {
|
||||||
MyAvatar* myAvatar = getMyAvatar();
|
MyAvatar* myAvatar = getMyAvatar();
|
||||||
const QString& collisionSoundURL = myAvatar->getCollisionSoundURL();
|
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);
|
const bool isSound = (collision.type == CONTACT_EVENT_TYPE_START) && (velocityChange > MIN_AVATAR_COLLISION_ACCELERATION);
|
||||||
|
|
||||||
if (!isSound) {
|
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.
|
// 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;
|
const float energy = velocityChange * velocityChange;
|
||||||
|
|
Loading…
Reference in a new issue