* No longer normalizing scale in AnimSkeleton and AnimClip This means graph is animating in 'geometry' coordinates before unit scale is even applied. This is necessary to properly work with both Avatar based models and ModelEntity based models Many things are broken. * debug rendering (translations are x100) * IK hand targets * follow cam * I did not even dare to try HMD mode
Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 9 files). Show all
Unified · Split
| @@ -43,7 +43,8 @@ SkeletonModel::~SkeletonModel() { · 42 unmodified lines | ||
| 43 | 43 | |
| 44 | 44 | void SkeletonModel::initJointStates() { |
| 45 | 45 | const FBXGeometry& geometry = _geometry->getFBXGeometry(); |
| 46 | − glm::mat4 modelOffset = glm::scale(_scale) * glm::translate(_offset) * geometry.offset; | |
| 46 | + glm::mat4 geometryOffset = geometry.offset; | |
| 47 | + glm::mat4 modelOffset = glm::scale(_scale) * glm::translate(_offset); | |
| 47 | 48 | |
| 48 | 49 | int rootJointIndex = geometry.rootJointIndex; |
| 49 | 50 | int leftHandJointIndex = geometry.leftHandJointIndex; |
| @@ -241,9 +242,9 @@ void SkeletonModel::simulate(float deltaTime, bool fullUpdate) { · 191 unmodified lines | ||
| 241 | 242 | Model::simulate(deltaTime, fullUpdate); |
| 242 | 243 | |
| 243 | 244 | // let rig compute the model offset |
| 244 | − glm::vec3 modelOffset; | |
| 245 | − if (_rig->getModelOffset(modelOffset)) { | |
| 246 | − setOffset(modelOffset); | |
| 245 | + glm::vec3 registrationPoint; | |
| 246 | + if (_rig->getModelRegistrationPoint(registrationPoint)) { | |
| 247 | + setOffset(registrationPoint); | |
| 247 | 248 | } |
| 248 | 249 | |
| 249 | 250 | if (!isActive() || !_owningAvatar->isMyAvatar()) { |