Avoid colliding with gravityless environments.

This commit is contained in:
Andrzej Kapolka 2013-05-23 10:36:28 -07:00
parent 34b526f15c
commit 672f4de496

View file

@ -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;