Merge pull request #3648 from RyanDowne/master

changed gravity setting on hair
This commit is contained in:
Philip Rosedale 2014-10-23 08:43:40 -07:00
commit da75073357
2 changed files with 4 additions and 4 deletions

View file

@ -92,7 +92,7 @@ Hair::Hair(int strands,
}
}
const float SOUND_THRESHOLD = 50.0f;
const float SOUND_THRESHOLD = 40.0f;
void Hair::simulate(float deltaTime) {
deltaTime = glm::clamp(deltaTime, 0.0f, 1.0f / 30.0f);
@ -121,13 +121,13 @@ void Hair::simulate(float deltaTime) {
(_radius - glm::length(_hairPosition[vertexIndex]));
}
// Add random thing driven by loudness
float loudnessFactor = (_loudness > SOUND_THRESHOLD) ? logf(_loudness - SOUND_THRESHOLD) / 8000.0f : 0.0f;
float loudnessFactor = (_loudness > SOUND_THRESHOLD) ? logf(_loudness - SOUND_THRESHOLD) / 2000.0f : 0.0f;
const float QUIESCENT_LOUDNESS = 0.0f;
_hairPosition[vertexIndex] += randVector() * (QUIESCENT_LOUDNESS + loudnessFactor) * ((float)link / (float)_links);
// Add gravity
const float SCALE_GRAVITY = 0.10f;
const float SCALE_GRAVITY = 0.13f;
_hairPosition[vertexIndex] += _gravity * deltaTime * SCALE_GRAVITY;
// Add linear acceleration

View file

@ -26,7 +26,7 @@ const int HAIR_CONSTRAINTS = 2;
const int DEFAULT_HAIR_STRANDS = 20;
const int DEFAULT_HAIR_LINKS = 10;
const float DEFAULT_HAIR_RADIUS = 0.15f;
const float DEFAULT_HAIR_LINK_LENGTH = 0.07f;
const float DEFAULT_HAIR_LINK_LENGTH = 0.06f;
const float DEFAULT_HAIR_THICKNESS = 0.025f;
class Hair {