cache indeces to toe joints

This commit is contained in:
Andrew Meadows 2014-11-19 09:13:03 -08:00
parent e1085a6cbb
commit 7f4e0c206c
2 changed files with 14 additions and 2 deletions

View file

@ -1067,6 +1067,8 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
QString jointHeadID;
QString jointLeftHandID;
QString jointRightHandID;
QString jointLeftToeID;
QString jointRightToeID;
QVector<QString> humanIKJointNames;
for (int i = 0;; i++) {
@ -1166,11 +1168,17 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
} else if (name == jointHeadName) {
jointHeadID = getID(object.properties);
} else if (name == jointLeftHandName) {
} else if (name == jointLeftHandName || name == "LeftHand" || name == "joint_L_hand") {
jointLeftHandID = getID(object.properties);
} else if (name == jointRightHandName) {
} else if (name == jointRightHandName || name == "RightHand" || name == "joint_R_hand") {
jointRightHandID = getID(object.properties);
} else if (name == "LeftToe" || name == "joint_L_toe" || name == "LeftToe_End") {
jointLeftToeID = getID(object.properties);
} else if (name == "RightToe" || name == "joint_R_toe" || name == "RightToe_End") {
jointRightToeID = getID(object.properties);
}
int humanIKJointIndex = humanIKJointNames.indexOf(name);
if (humanIKJointIndex != -1) {
@ -1595,6 +1603,8 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
geometry.headJointIndex = modelIDs.indexOf(jointHeadID);
geometry.leftHandJointIndex = modelIDs.indexOf(jointLeftHandID);
geometry.rightHandJointIndex = modelIDs.indexOf(jointRightHandID);
geometry.leftToeJointIndex = modelIDs.indexOf(jointLeftToeID);
geometry.rightToeJointIndex = modelIDs.indexOf(jointRightToeID);
foreach (const QString& id, humanIKJointIDs) {
geometry.humanIKJointIndices.append(modelIDs.indexOf(id));

View file

@ -201,6 +201,8 @@ public:
int headJointIndex;
int leftHandJointIndex;
int rightHandJointIndex;
int leftToeJointIndex;
int rightToeJointIndex;
QVector<int> humanIKJointIndices;