mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 05:56:38 +02:00
pulling latest upstream changes to local repo
This commit is contained in:
commit
6f21592ebd
1 changed files with 10 additions and 10 deletions
|
@ -79,7 +79,7 @@ void ParticleCollisionSystem::updateCollisionWithVoxels(Particle* particle) {
|
||||||
// let the particles run their collision scripts if they have them
|
// let the particles run their collision scripts if they have them
|
||||||
particle->collisionWithVoxel(voxelDetails);
|
particle->collisionWithVoxel(voxelDetails);
|
||||||
|
|
||||||
penetration /= (float)TREE_SCALE;
|
penetration /= static_cast<float>(TREE_SCALE);
|
||||||
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
||||||
applyHardCollision(particle, penetration, ELASTICITY, DAMPING);
|
applyHardCollision(particle, penetration, ELASTICITY, DAMPING);
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ void ParticleCollisionSystem::updateCollisionWithParticles(Particle* particle) {
|
||||||
particle->collisionWithParticle(penetratedParticle);
|
particle->collisionWithParticle(penetratedParticle);
|
||||||
penetratedParticle->collisionWithParticle(particle);
|
penetratedParticle->collisionWithParticle(particle);
|
||||||
|
|
||||||
penetration /= (float)TREE_SCALE;
|
penetration /= static_cast<float>(TREE_SCALE);
|
||||||
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
||||||
|
|
||||||
// apply a hard collision to both particles of half the penetration each
|
// apply a hard collision to both particles of half the penetration each
|
||||||
|
@ -156,7 +156,7 @@ void ParticleCollisionSystem::updateCollisionWithAvatars(Particle* particle) {
|
||||||
if (handData->findSpherePenetration(center, radius, penetration, collidingPalm)) {
|
if (handData->findSpherePenetration(center, radius, penetration, collidingPalm)) {
|
||||||
// TODO: dot collidingPalm and hand velocities and skip collision when they are moving apart.
|
// TODO: dot collidingPalm and hand velocities and skip collision when they are moving apart.
|
||||||
// apply a hard collision when ball collides with hand
|
// apply a hard collision when ball collides with hand
|
||||||
penetration /= (float)TREE_SCALE;
|
penetration /= static_cast<float>(TREE_SCALE);
|
||||||
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
||||||
|
|
||||||
// determine if the palm that collided was moving, if so, then we add that palm velocity as well...
|
// determine if the palm that collided was moving, if so, then we add that palm velocity as well...
|
||||||
|
@ -167,11 +167,11 @@ void ParticleCollisionSystem::updateCollisionWithAvatars(Particle* particle) {
|
||||||
addedVelocity = palmVelocity;
|
addedVelocity = palmVelocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyHardCollision(particle, penetration, VOXEL_ELASTICITY, VOXEL_DAMPING, addedVelocity);
|
applyHardCollision(particle, penetration, ELASTICITY, DAMPING, addedVelocity);
|
||||||
} else if (avatar->findSpherePenetration(center, radius, penetration)) {
|
} else if (avatar->findSpherePenetration(center, radius, penetration)) {
|
||||||
// apply hard collision when particle collides with avatar
|
// apply hard collision when particle collides with avatar
|
||||||
penetration /= (float)TREE_SCALE;
|
penetration /= static_cast<float>(TREE_SCALE);
|
||||||
updateCollisionSound(particle, penetration, VOXEL_COLLISION_FREQUENCY);
|
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
||||||
glm::vec3 addedVelocity = avatar->getVelocity();
|
glm::vec3 addedVelocity = avatar->getVelocity();
|
||||||
applyHardCollision(particle, penetration, ELASTICITY, DAMPING, addedVelocity);
|
applyHardCollision(particle, penetration, ELASTICITY, DAMPING, addedVelocity);
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ void ParticleCollisionSystem::updateCollisionWithAvatars(Particle* particle) {
|
||||||
|
|
||||||
if (handData->findSpherePenetration(center, radius, penetration, collidingPalm)) {
|
if (handData->findSpherePenetration(center, radius, penetration, collidingPalm)) {
|
||||||
// apply a hard collision when ball collides with hand
|
// apply a hard collision when ball collides with hand
|
||||||
penetration /= (float)TREE_SCALE;
|
penetration /= static_cast<float>(TREE_SCALE);
|
||||||
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
||||||
|
|
||||||
// determine if the palm that collided was moving, if so, then we add that palm velocity as well...
|
// determine if the palm that collided was moving, if so, then we add that palm velocity as well...
|
||||||
|
@ -205,10 +205,10 @@ void ParticleCollisionSystem::updateCollisionWithAvatars(Particle* particle) {
|
||||||
applyHardCollision(particle, penetration, ELASTICITY, DAMPING, addedVelocity);
|
applyHardCollision(particle, penetration, ELASTICITY, DAMPING, addedVelocity);
|
||||||
|
|
||||||
} else if (avatar->findSpherePenetration(center, radius, penetration)) {
|
} else if (avatar->findSpherePenetration(center, radius, penetration)) {
|
||||||
penetration /= (float)TREE_SCALE;
|
penetration /= static_cast<float>(TREE_SCALE);
|
||||||
updateCollisionSound(particle, penetration, VOXEL_COLLISION_FREQUENCY);
|
updateCollisionSound(particle, penetration, COLLISION_FREQUENCY);
|
||||||
glm::vec3 addedVelocity = avatar->getVelocity();
|
glm::vec3 addedVelocity = avatar->getVelocity();
|
||||||
applyHardCollision(particle, penetration, VOXEL_ELASTICITY, VOXEL_DAMPING, addedVelocity);
|
applyHardCollision(particle, penetration, ELASTICITY, DAMPING, addedVelocity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue