working on imporving soft-entities

This commit is contained in:
Dante Ruiz 2018-01-03 08:47:11 -08:00
parent 6fa3446c57
commit e1a7f9bfb8
2 changed files with 9 additions and 5 deletions

View file

@ -359,21 +359,26 @@ void Avatar::relayJointDataToChildren() {
index++;
if (modelEntity->getRelayParentJoints()) {
QVector<glm::quat> jointRotations;
QVector<bool> jointRotationsSet;
QVector<glm::vec3> jointTranslations;
QVector<bool> jointSet;
QStringList modelJointNames = modelEntity->getJointNames();
QStringList avatarJointNames = getJointNames();
foreach (const QString& jointName, modelJointNames) {
bool containsJoint = avatarJointNames.contains(jointName);
if (!containsJoint) {
return;
qDebug() << "Warning: Parent does not have joint -" << jointName;
continue;
}
int jointIndex = getJointIndex(jointName);
int modelJointIndex = modelEntity->getJointIndex(jointName);
jointRotationsSet.append(true);
jointSet.append(true);
jointRotations.append(getJointRotation(jointIndex));
jointTranslations.append(getJointTranslation(jointIndex));
}
modelEntity->setJointRotationsSet(jointRotationsSet);
modelEntity->setJointRotationsSet(jointSet);
//modelEntity->setJointTranslationsSet(jointSet);
modelEntity->setJointRotations(jointRotations);
//modelEntity->setJointTranslations(jointTranslations);
}
}
}

View file

@ -1205,7 +1205,6 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
if (entity->_relayParentJoints) {
ModelPointer model = entity->getModel();
if (model && model->isLoaded()) {
qDebug() << "relaying joints";
entity->copyAnimationJointDataToModel();
model->simulate(0.0f);
}