mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:44:01 +02:00
Avoid colliding with gravityless environments.
This commit is contained in:
parent
34b526f15c
commit
672f4de496
1 changed files with 3 additions and 0 deletions
|
@ -114,6 +114,9 @@ bool Environment::findCapsulePenetration(const glm::vec3& start, const glm::vec3
|
|||
|
||||
foreach (const ServerData& serverData, _data) {
|
||||
foreach (const EnvironmentData& environmentData, serverData) {
|
||||
if (environmentData.getGravity() == 0.0f) {
|
||||
continue; // don't bother colliding with gravity-less environments
|
||||
}
|
||||
glm::vec3 vector = computeVectorFromPointToSegment(environmentData.getAtmosphereCenter(), start, end);
|
||||
float vectorLength = glm::length(vector);
|
||||
float distance = vectorLength - environmentData.getAtmosphereInnerRadius() - radius;
|
||||
|
|
Loading…
Reference in a new issue