mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
removed more cruft
This commit is contained in:
parent
c80ade98ec
commit
a8d7b0503d
2 changed files with 8 additions and 19 deletions
|
@ -35,12 +35,9 @@ AnimSkeleton::AnimSkeleton(const HFMModel& hfmModel) {
|
|||
// AJT: mutate bind pose! this allows us to oreint the skeleton back into the authored orientaiton before
|
||||
// rendering, with no runtime overhead.
|
||||
if (hfmModel.jointRotationOffsets.contains(cluster.jointIndex)) {
|
||||
qCDebug(animation) << "found a cluster " << cluster.jointIndex;
|
||||
AnimPose localOffset(hfmModel.jointRotationOffsets[cluster.jointIndex], glm::vec3());
|
||||
cluster.inverseBindMatrix = (glm::mat4)localOffset.inverse() * hfmModel.clusterBindMatrixOriginalValues[i][j];
|
||||
qCDebug(animation) << "the new bind matrix num: " << cluster.jointIndex << cluster.inverseBindMatrix;
|
||||
if ((hfmModel.clusterBindMatrixOriginalValues.size() > i) && (hfmModel.clusterBindMatrixOriginalValues[i].size() > cluster.jointIndex)) {
|
||||
qCDebug(animation) << "the saved orig matrix num: " << cluster.jointIndex << hfmModel.clusterBindMatrixOriginalValues[i][j];
|
||||
if ((hfmModel.clusterBindMatrixOriginalValues.size() > i) && (hfmModel.clusterBindMatrixOriginalValues[i].size() > j)) {
|
||||
cluster.inverseBindMatrix = (glm::mat4)localOffset.inverse() * hfmModel.clusterBindMatrixOriginalValues[i][j];
|
||||
}
|
||||
cluster.inverseBindTransform.evalFromRawMatrix(cluster.inverseBindMatrix);
|
||||
}
|
||||
|
@ -215,30 +212,22 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<HFMJoint>& joints,
|
|||
qCDebug(animation) << "relative default pose for joint " << i << " " << relDefaultPose.trans() << " " << relDefaultPose.rot();
|
||||
|
||||
int parentIndex = getParentIndex(i);
|
||||
AnimPose newAbsPose;
|
||||
if (parentIndex >= 0) {
|
||||
newAbsPose = _absoluteDefaultPoses[parentIndex] * relDefaultPose;
|
||||
_absoluteDefaultPoses.push_back(newAbsPose);
|
||||
_absoluteDefaultPoses.push_back(_absoluteDefaultPoses[parentIndex] * relDefaultPose);
|
||||
} else {
|
||||
_absoluteDefaultPoses.push_back(relDefaultPose);
|
||||
}
|
||||
}
|
||||
|
||||
for (int k = 0; k < _jointsSize; k++) {
|
||||
int parentIndex2 = getParentIndex(k);
|
||||
if (jointOffsets.contains(k)) {
|
||||
AnimPose localOffset(jointOffsets[k], glm::vec3());
|
||||
_absoluteDefaultPoses[k] = _absoluteDefaultPoses[k] * localOffset;
|
||||
}
|
||||
if (parentIndex2 >= 0) {
|
||||
_relativeDefaultPoses.push_back(_absoluteDefaultPoses[parentIndex2].inverse() * _absoluteDefaultPoses[k]);
|
||||
} else {
|
||||
_relativeDefaultPoses.push_back(_absoluteDefaultPoses[k]);
|
||||
}
|
||||
}
|
||||
// re-compute relative poses
|
||||
//_relativeDefaultPoses = _absoluteDefaultPoses;
|
||||
//convertAbsolutePosesToRelative(_relativeDefaultPoses);
|
||||
_relativeDefaultPoses = _absoluteDefaultPoses;
|
||||
convertAbsolutePosesToRelative(_relativeDefaultPoses);
|
||||
|
||||
for (int i = 0; i < _jointsSize; i++) {
|
||||
_jointIndicesByName[_joints[i].name] = i;
|
||||
|
|
|
@ -2032,12 +2032,12 @@ HFMModel* FBXReader::extractHFMModel(const QVariantHash& mapping, const QString&
|
|||
// these are needed when we recompute the bindpose offsets on reset.
|
||||
for (int i = 0; i < (int)hfmModel.meshes.size(); i++) {
|
||||
const HFMMesh& mesh = hfmModel.meshes.at(i);
|
||||
vector<glm::mat4> tempBindMat;
|
||||
vector<glm::mat4> meshBindMatrices;
|
||||
for (int j = 0; j < mesh.clusters.size(); j++) {
|
||||
const HFMCluster& cluster = mesh.clusters.at(j);
|
||||
tempBindMat.push_back(cluster.inverseBindMatrix);
|
||||
meshBindMatrices.push_back(cluster.inverseBindMatrix);
|
||||
}
|
||||
hfmModel.clusterBindMatrixOriginalValues.push_back(tempBindMat);
|
||||
hfmModel.clusterBindMatrixOriginalValues.push_back(meshBindMatrices);
|
||||
}
|
||||
return hfmModelPtr;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue