Fix crash: don't simulate until geometry exists

This commit is contained in:
Andrew Meadows 2014-04-03 09:06:49 -07:00
parent 4a1687c023
commit 7a602aedd1

View file

@ -34,15 +34,14 @@ void FaceModel::simulate(float deltaTime) {
const float MODEL_SCALE = 0.0006f;
setScale(glm::vec3(1.0f, 1.0f, 1.0f) * _owningHead->getScale() * MODEL_SCALE);
if (isActive()) {
setOffset(-_geometry->getFBXGeometry().neckPivot);
}
setPupilDilation(_owningHead->getPupilDilation());
setBlendshapeCoefficients(_owningHead->getBlendshapeCoefficients());
if (isActive()) {
setOffset(-_geometry->getFBXGeometry().neckPivot);
Model::simulateInternal(deltaTime);
}
}
void FaceModel::maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) {
// get the rotation axes in joint space and use them to adjust the rotation