History

fix names of model-entity joint setters

Seth Alves committed 10 years ago

Commit 844cc031 parent 56b3ac88 files · +80 −82Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+13−17
@@ -1110,12 +1110,11 @@ glm::quat EntityScriptingInterface::getAbsoluteJointRotationInObjectFrame(const · 1109 unmodified lines
11101110 }
11111111 }
11121112
1113−bool EntityScriptingInterface::setAbsoluteJointTranslationInObjectFrame(const QUuid& entityID,
1114− int jointIndex, glm::vec3 translation) {
1113+bool EntityScriptingInterface::setLocalJointTranslation(const QUuid& entityID, int jointIndex, glm::vec3 translation) {
11151114 if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
11161115 auto now = usecTimestampNow();
11171116 auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
1118− bool result = modelEntity->setAbsoluteJointTranslationInObjectFrame(jointIndex, translation);
1117+ bool result = modelEntity->setLocalJointTranslation(jointIndex, translation);
11191118 if (result) {
11201119 EntityItemProperties properties;
11211120 _entityTree->withWriteLock([&] {
@@ -1132,12 +1131,11 @@ bool EntityScriptingInterface::setAbsoluteJointTranslationInObjectFrame(const QU · 10 unmodified lines
11321131 return false;
11331132 }
11341133
1135−bool EntityScriptingInterface::setAbsoluteJointRotationInObjectFrame(const QUuid& entityID,
1136− int jointIndex, glm::quat rotation) {
1134+bool EntityScriptingInterface::setLocalJointRotation(const QUuid& entityID, int jointIndex, glm::quat rotation) {
11371135 if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
11381136 auto now = usecTimestampNow();
11391137 auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
1140− bool result = modelEntity->setAbsoluteJointRotationInObjectFrame(jointIndex, rotation);
1138+ bool result = modelEntity->setLocalJointRotation(jointIndex, rotation);
11411139 if (result) {
11421140 EntityItemProperties properties;
11431141 _entityTree->withWriteLock([&] {
@@ -1156,15 +1154,14 @@ bool EntityScriptingInterface::setAbsoluteJointRotationInObjectFrame(const QUuid · 12 unmodified lines
11561154
11571155
11581156
1159−bool EntityScriptingInterface::setAbsoluteJointRotationsInObjectFrame(const QUuid& entityID,
1160− const QVector<glm::quat>& rotations) {
1157+bool EntityScriptingInterface::setLocalJointRotations(const QUuid& entityID, const QVector<glm::quat>& rotations) {
11611158 if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
11621159 auto now = usecTimestampNow();
11631160 auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
11641161
11651162 bool result = false;
11661163 for (int index = 0; index < rotations.size(); index++) {
1167− result |= modelEntity->setAbsoluteJointRotationInObjectFrame(index, rotations[index]);
1164+ result |= modelEntity->setLocalJointRotation(index, rotations[index]);
11681165 }
11691166 if (result) {
11701167 EntityItemProperties properties;
@@ -1184,15 +1181,14 @@ bool EntityScriptingInterface::setAbsoluteJointRotationsInObjectFrame(const QUui · 13 unmodified lines
11841181 }
11851182
11861183
1187−bool EntityScriptingInterface::setAbsoluteJointTranslationsInObjectFrame(const QUuid& entityID,
1188− const QVector<glm::vec3>& translations) {
1184+bool EntityScriptingInterface::setLocalJointTranslations(const QUuid& entityID, const QVector<glm::vec3>& translations) {
11891185 if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
11901186 auto now = usecTimestampNow();
11911187 auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
11921188
11931189 bool result = false;
11941190 for (int index = 0; index < translations.size(); index++) {
1195− result |= modelEntity->setAbsoluteJointTranslationInObjectFrame(index, translations[index]);
1191+ result |= modelEntity->setLocalJointTranslation(index, translations[index]);
11961192 }
11971193 if (result) {
11981194 EntityItemProperties properties;
@@ -1211,12 +1207,12 @@ bool EntityScriptingInterface::setAbsoluteJointTranslationsInObjectFrame(const Q · 12 unmodified lines
12111207 return false;
12121208 }
12131209
1214−bool EntityScriptingInterface::setAbsoluteJointsDataInObjectFrame(const QUuid& entityID,
1215− const QVector<glm::quat>& rotations,
1216− const QVector<glm::vec3>& translations) {
1210+bool EntityScriptingInterface::setLocalJointsData(const QUuid& entityID,
1211+ const QVector<glm::quat>& rotations,
1212+ const QVector<glm::vec3>& translations) {
12171213 // for a model with 80 joints, sending both these in one edit packet causes the packet to be too large.
1218− return setAbsoluteJointRotationsInObjectFrame(entityID, rotations) ||
1219− setAbsoluteJointTranslationsInObjectFrame(entityID, translations);
1214+ return setLocalJointRotations(entityID, rotations) ||
1215+ setLocalJointTranslations(entityID, translations);
12201216 }
12211217
12221218 int EntityScriptingInterface::getJointIndex(const QUuid& entityID, const QString& name) {