reverted special property case, parentJointName is now only parsed from the JSON import

This commit is contained in:
Thijs Wenker 2017-11-20 18:29:33 +01:00
parent 3c37bf8acd
commit 84ec9890ca
12 changed files with 25 additions and 51 deletions

View file

@ -1183,6 +1183,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
_entityEditSender.setServerJurisdictions(&_entityServerJurisdictions); _entityEditSender.setServerJurisdictions(&_entityServerJurisdictions);
_entityEditSender.setMyAvatar(myAvatar.get()); _entityEditSender.setMyAvatar(myAvatar.get());
// The entity octree will have to know about MyAvatar for the parentJointName import
getEntities()->getTree()->setMyAvatar(myAvatar.get());
_entityClipboard->setMyAvatar(myAvatar.get());
// For now we're going to set the PPS for outbound packets to be super high, this is // For now we're going to set the PPS for outbound packets to be super high, this is
// probably not the right long term solution. But for now, we're going to do this to // probably not the right long term solution. But for now, we're going to do this to
// allow you to move an entity around in your hand // allow you to move an entity around in your hand

View file

@ -522,7 +522,7 @@ public:
Q_INVOKABLE virtual void clearJointsData(); Q_INVOKABLE virtual void clearJointsData();
/// Returns the index of the joint with the specified name, or -1 if not found/unknown. /// Returns the index of the joint with the specified name, or -1 if not found/unknown.
Q_INVOKABLE virtual int getJointIndex(const QString& name) const override; Q_INVOKABLE virtual int getJointIndex(const QString& name) const;
Q_INVOKABLE virtual QStringList getJointNames() const; Q_INVOKABLE virtual QStringList getJointNames() const;
@ -669,6 +669,7 @@ public slots:
emit sessionUUIDChanged(); emit sessionUUIDChanged();
} }
} }
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override; virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override; virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
virtual bool setAbsoluteJointRotationInObjectFrame(int index, const glm::quat& rotation) override { return false; } virtual bool setAbsoluteJointRotationInObjectFrame(int index, const glm::quat& rotation) override { return false; }

View file

@ -121,7 +121,6 @@ EntityPropertyFlags EntityItem::getEntityProperties(EncodeBitstreamParams& param
requestedProperties += PROP_ACTION_DATA; requestedProperties += PROP_ACTION_DATA;
requestedProperties += PROP_PARENT_ID; requestedProperties += PROP_PARENT_ID;
requestedProperties += PROP_PARENT_JOINT_INDEX; requestedProperties += PROP_PARENT_JOINT_INDEX;
requestedProperties += PROP_PARENT_JOINT_NAME;
requestedProperties += PROP_QUERY_AA_CUBE; requestedProperties += PROP_QUERY_AA_CUBE;
requestedProperties += PROP_CLIENT_ONLY; requestedProperties += PROP_CLIENT_ONLY;
@ -288,7 +287,6 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
APPEND_ENTITY_PROPERTY(PROP_PARENT_ID, actualParentID); APPEND_ENTITY_PROPERTY(PROP_PARENT_ID, actualParentID);
APPEND_ENTITY_PROPERTY(PROP_PARENT_JOINT_INDEX, getParentJointIndex()); APPEND_ENTITY_PROPERTY(PROP_PARENT_JOINT_INDEX, getParentJointIndex());
APPEND_ENTITY_PROPERTY(PROP_PARENT_JOINT_NAME, getParentJointName());
APPEND_ENTITY_PROPERTY(PROP_QUERY_AA_CUBE, getQueryAACube()); APPEND_ENTITY_PROPERTY(PROP_QUERY_AA_CUBE, getQueryAACube());
APPEND_ENTITY_PROPERTY(PROP_LAST_EDITED_BY, getLastEditedBy()); APPEND_ENTITY_PROPERTY(PROP_LAST_EDITED_BY, getLastEditedBy());
@ -833,7 +831,6 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
overwriteLocalData = overwriteLocalData && !weOwnSimulation; overwriteLocalData = overwriteLocalData && !weOwnSimulation;
READ_ENTITY_PROPERTY(PROP_PARENT_ID, QUuid, updateParentID); READ_ENTITY_PROPERTY(PROP_PARENT_ID, QUuid, updateParentID);
READ_ENTITY_PROPERTY(PROP_PARENT_JOINT_INDEX, quint16, setParentJointIndex); READ_ENTITY_PROPERTY(PROP_PARENT_JOINT_INDEX, quint16, setParentJointIndex);
READ_ENTITY_PROPERTY(PROP_PARENT_JOINT_NAME, QString, setParentJointName);
overwriteLocalData = oldOverwrite; overwriteLocalData = oldOverwrite;
} }
@ -1265,7 +1262,6 @@ EntityItemProperties EntityItem::getProperties(EntityPropertyFlags desiredProper
COPY_ENTITY_PROPERTY_TO_PROPERTIES(actionData, getDynamicData); COPY_ENTITY_PROPERTY_TO_PROPERTIES(actionData, getDynamicData);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(parentID, getParentID); COPY_ENTITY_PROPERTY_TO_PROPERTIES(parentID, getParentID);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(parentJointIndex, getParentJointIndex); COPY_ENTITY_PROPERTY_TO_PROPERTIES(parentJointIndex, getParentJointIndex);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(parentJointName, getParentJointName);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(queryAACube, getQueryAACube); COPY_ENTITY_PROPERTY_TO_PROPERTIES(queryAACube, getQueryAACube);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(localPosition, getLocalPosition); COPY_ENTITY_PROPERTY_TO_PROPERTIES(localPosition, getLocalPosition);
COPY_ENTITY_PROPERTY_TO_PROPERTIES(localRotation, getLocalOrientation); COPY_ENTITY_PROPERTY_TO_PROPERTIES(localRotation, getLocalOrientation);
@ -1373,7 +1369,6 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
SET_ENTITY_PROPERTY_FROM_PROPERTIES(actionData, setDynamicData); SET_ENTITY_PROPERTY_FROM_PROPERTIES(actionData, setDynamicData);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(parentID, updateParentID); SET_ENTITY_PROPERTY_FROM_PROPERTIES(parentID, updateParentID);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(parentJointIndex, setParentJointIndex); SET_ENTITY_PROPERTY_FROM_PROPERTIES(parentJointIndex, setParentJointIndex);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(parentJointName, setParentJointName);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(queryAACube, setQueryAACube); SET_ENTITY_PROPERTY_FROM_PROPERTIES(queryAACube, setQueryAACube);
SET_ENTITY_PROPERTY_FROM_PROPERTIES(clientOnly, setClientOnly); SET_ENTITY_PROPERTY_FROM_PROPERTIES(clientOnly, setClientOnly);

View file

@ -359,7 +359,6 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
CHECK_PROPERTY_CHANGE(PROP_Z_P_NEIGHBOR_ID, zPNeighborID); CHECK_PROPERTY_CHANGE(PROP_Z_P_NEIGHBOR_ID, zPNeighborID);
CHECK_PROPERTY_CHANGE(PROP_PARENT_ID, parentID); CHECK_PROPERTY_CHANGE(PROP_PARENT_ID, parentID);
CHECK_PROPERTY_CHANGE(PROP_PARENT_JOINT_INDEX, parentJointIndex); CHECK_PROPERTY_CHANGE(PROP_PARENT_JOINT_INDEX, parentJointIndex);
CHECK_PROPERTY_CHANGE(PROP_PARENT_JOINT_NAME, parentJointName);
CHECK_PROPERTY_CHANGE(PROP_JOINT_ROTATIONS_SET, jointRotationsSet); CHECK_PROPERTY_CHANGE(PROP_JOINT_ROTATIONS_SET, jointRotationsSet);
CHECK_PROPERTY_CHANGE(PROP_JOINT_ROTATIONS, jointRotations); CHECK_PROPERTY_CHANGE(PROP_JOINT_ROTATIONS, jointRotations);
CHECK_PROPERTY_CHANGE(PROP_JOINT_TRANSLATIONS_SET, jointTranslationsSet); CHECK_PROPERTY_CHANGE(PROP_JOINT_TRANSLATIONS_SET, jointTranslationsSet);
@ -625,7 +624,6 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_PARENT_ID, parentID); COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_PARENT_ID, parentID);
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_PARENT_JOINT_INDEX, parentJointIndex); COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_PARENT_JOINT_INDEX, parentJointIndex);
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_PARENT_JOINT_NAME, parentJointName);
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_QUERY_AA_CUBE, queryAACube); COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_QUERY_AA_CUBE, queryAACube);
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_LOCAL_POSITION, localPosition); COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_LOCAL_POSITION, localPosition);
@ -802,7 +800,6 @@ void EntityItemProperties::copyFromScriptValue(const QScriptValue& object, bool
COPY_PROPERTY_FROM_QSCRIPTVALUE(parentID, QUuid, setParentID); COPY_PROPERTY_FROM_QSCRIPTVALUE(parentID, QUuid, setParentID);
COPY_PROPERTY_FROM_QSCRIPTVALUE(parentJointIndex, quint16, setParentJointIndex); COPY_PROPERTY_FROM_QSCRIPTVALUE(parentJointIndex, quint16, setParentJointIndex);
COPY_PROPERTY_FROM_QSCRIPTVALUE(parentJointName, QString, setParentJointName);
COPY_PROPERTY_FROM_QSCRIPTVALUE(queryAACube, AACube, setQueryAACube); COPY_PROPERTY_FROM_QSCRIPTVALUE(queryAACube, AACube, setQueryAACube);
COPY_PROPERTY_FROM_QSCRIPTVALUE(localPosition, glmVec3, setLocalPosition); COPY_PROPERTY_FROM_QSCRIPTVALUE(localPosition, glmVec3, setLocalPosition);
@ -1129,7 +1126,6 @@ void EntityItemProperties::entityPropertyFlagsFromScriptValue(const QScriptValue
ADD_PROPERTY_TO_MAP(PROP_PARENT_ID, ParentID, parentID, QUuid); ADD_PROPERTY_TO_MAP(PROP_PARENT_ID, ParentID, parentID, QUuid);
ADD_PROPERTY_TO_MAP(PROP_PARENT_JOINT_INDEX, ParentJointIndex, parentJointIndex, uint16_t); ADD_PROPERTY_TO_MAP(PROP_PARENT_JOINT_INDEX, ParentJointIndex, parentJointIndex, uint16_t);
ADD_PROPERTY_TO_MAP(PROP_PARENT_JOINT_NAME, ParentJointName, parentJointName, QString);
ADD_PROPERTY_TO_MAP(PROP_LOCAL_POSITION, LocalPosition, localPosition, glm::vec3); ADD_PROPERTY_TO_MAP(PROP_LOCAL_POSITION, LocalPosition, localPosition, glm::vec3);
ADD_PROPERTY_TO_MAP(PROP_LOCAL_ROTATION, LocalRotation, localRotation, glm::quat); ADD_PROPERTY_TO_MAP(PROP_LOCAL_ROTATION, LocalRotation, localRotation, glm::quat);
@ -1339,7 +1335,6 @@ OctreeElement::AppendState EntityItemProperties::encodeEntityEditPacket(PacketTy
APPEND_ENTITY_PROPERTY(PROP_DESCRIPTION, properties.getDescription()); APPEND_ENTITY_PROPERTY(PROP_DESCRIPTION, properties.getDescription());
APPEND_ENTITY_PROPERTY(PROP_PARENT_ID, properties.getParentID()); APPEND_ENTITY_PROPERTY(PROP_PARENT_ID, properties.getParentID());
APPEND_ENTITY_PROPERTY(PROP_PARENT_JOINT_INDEX, properties.getParentJointIndex()); APPEND_ENTITY_PROPERTY(PROP_PARENT_JOINT_INDEX, properties.getParentJointIndex());
APPEND_ENTITY_PROPERTY(PROP_PARENT_JOINT_NAME, properties.getParentJointName());
APPEND_ENTITY_PROPERTY(PROP_QUERY_AA_CUBE, properties.getQueryAACube()); APPEND_ENTITY_PROPERTY(PROP_QUERY_AA_CUBE, properties.getQueryAACube());
if (properties.getType() == EntityTypes::Web) { if (properties.getType() == EntityTypes::Web) {
@ -2047,7 +2042,6 @@ void EntityItemProperties::markAllChanged() {
_parentIDChanged = true; _parentIDChanged = true;
_parentJointIndexChanged = true; _parentJointIndexChanged = true;
_parentJointNameChanged = true;
_jointRotationsSetChanged = true; _jointRotationsSetChanged = true;
_jointRotationsChanged = true; _jointRotationsChanged = true;
@ -2407,9 +2401,6 @@ QList<QString> EntityItemProperties::listChangedProperties() {
if (parentJointIndexChanged()) { if (parentJointIndexChanged()) {
out += "parentJointIndex"; out += "parentJointIndex";
} }
if (parentJointNameChanged()) {
out += "parentJointName";
}
if (jointRotationsSetChanged()) { if (jointRotationsSetChanged()) {
out += "jointRotationsSet"; out += "jointRotationsSet";
} }

View file

@ -206,7 +206,6 @@ public:
DEFINE_PROPERTY_REF(PROP_Z_P_NEIGHBOR_ID, ZPNeighborID, zPNeighborID, EntityItemID, UNKNOWN_ENTITY_ID); DEFINE_PROPERTY_REF(PROP_Z_P_NEIGHBOR_ID, ZPNeighborID, zPNeighborID, EntityItemID, UNKNOWN_ENTITY_ID);
DEFINE_PROPERTY_REF(PROP_PARENT_ID, ParentID, parentID, QUuid, UNKNOWN_ENTITY_ID); DEFINE_PROPERTY_REF(PROP_PARENT_ID, ParentID, parentID, QUuid, UNKNOWN_ENTITY_ID);
DEFINE_PROPERTY_REF(PROP_PARENT_JOINT_INDEX, ParentJointIndex, parentJointIndex, quint16, -1); DEFINE_PROPERTY_REF(PROP_PARENT_JOINT_INDEX, ParentJointIndex, parentJointIndex, quint16, -1);
DEFINE_PROPERTY_REF(PROP_PARENT_JOINT_NAME, ParentJointName, parentJointName, QString, "");
DEFINE_PROPERTY_REF(PROP_QUERY_AA_CUBE, QueryAACube, queryAACube, AACube, AACube()); DEFINE_PROPERTY_REF(PROP_QUERY_AA_CUBE, QueryAACube, queryAACube, AACube, AACube());
DEFINE_PROPERTY_REF(PROP_SHAPE, Shape, shape, QString, "Sphere"); DEFINE_PROPERTY_REF(PROP_SHAPE, Shape, shape, QString, "Sphere");
@ -496,7 +495,6 @@ inline QDebug operator<<(QDebug debug, const EntityItemProperties& properties) {
DEBUG_PROPERTY_IF_CHANGED(debug, properties, ParentID, parentID, ""); DEBUG_PROPERTY_IF_CHANGED(debug, properties, ParentID, parentID, "");
DEBUG_PROPERTY_IF_CHANGED(debug, properties, ParentJointIndex, parentJointIndex, ""); DEBUG_PROPERTY_IF_CHANGED(debug, properties, ParentJointIndex, parentJointIndex, "");
DEBUG_PROPERTY_IF_CHANGED(debug, properties, ParentJointName, parentJointName, "");
DEBUG_PROPERTY_IF_CHANGED(debug, properties, QueryAACube, queryAACube, ""); DEBUG_PROPERTY_IF_CHANGED(debug, properties, QueryAACube, queryAACube, "");
DEBUG_PROPERTY_IF_CHANGED(debug, properties, JointRotationsSet, jointRotationsSet, ""); DEBUG_PROPERTY_IF_CHANGED(debug, properties, JointRotationsSet, jointRotationsSet, "");

View file

@ -219,8 +219,6 @@ enum EntityPropertyList {
PROP_HAZE_KEYLIGHT_RANGE, PROP_HAZE_KEYLIGHT_RANGE,
PROP_HAZE_KEYLIGHT_ALTITUDE, PROP_HAZE_KEYLIGHT_ALTITUDE,
PROP_PARENT_JOINT_NAME,
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// ATTENTION: add new properties to end of list just ABOVE this line // ATTENTION: add new properties to end of list just ABOVE this line
PROP_AFTER_LAST_ITEM, PROP_AFTER_LAST_ITEM,

View file

@ -2276,6 +2276,17 @@ bool EntityTree::readFromMap(QVariantMap& map) {
foreach (QVariant entityVariant, entitiesQList) { foreach (QVariant entityVariant, entitiesQList) {
// QVariantMap --> QScriptValue --> EntityItemProperties --> Entity // QVariantMap --> QScriptValue --> EntityItemProperties --> Entity
QVariantMap entityMap = entityVariant.toMap(); QVariantMap entityMap = entityVariant.toMap();
// handle parentJointName for wearables
if (_myAvatar && entityMap.contains("parentJointName") && entityMap.contains("parentID") &&
QUuid(entityMap["parentID"].toString()) == AVATAR_SELF_ID) {
entityMap["parentJointIndex"] = _myAvatar->getJointIndex(entityMap["parentJointName"].toString());
qCDebug(entities) << "Found parentJointName " << entityMap["parentJointName"].toString() <<
" mapped it to parentJointIndex " << entityMap["parentJointIndex"].toInt();
}
QScriptValue entityScriptValue = variantMapToScriptValue(entityMap, scriptEngine); QScriptValue entityScriptValue = variantMapToScriptValue(entityMap, scriptEngine);
EntityItemProperties properties; EntityItemProperties properties;
EntityItemPropertiesFromScriptValueIgnoreReadOnly(entityScriptValue, properties); EntityItemPropertiesFromScriptValueIgnoreReadOnly(entityScriptValue, properties);

View file

@ -278,6 +278,8 @@ public:
QByteArray computeEncryptedNonce(const QString& certID, const QString ownerKey); QByteArray computeEncryptedNonce(const QString& certID, const QString ownerKey);
bool verifyDecryptedNonce(const QString& certID, const QString& decryptedNonce, EntityItemID& id); bool verifyDecryptedNonce(const QString& certID, const QString& decryptedNonce, EntityItemID& id);
void setMyAvatar(AvatarData* myAvatar) { _myAvatar = myAvatar; }
signals: signals:
void deletingEntity(const EntityItemID& entityID); void deletingEntity(const EntityItemID& entityID);
void deletingEntityPointer(EntityItem* entityID); void deletingEntityPointer(EntityItem* entityID);
@ -383,6 +385,8 @@ private:
void sendChallengeOwnershipPacket(const QString& certID, const QString& ownerKey, const EntityItemID& entityItemID, const SharedNodePointer& senderNode); void sendChallengeOwnershipPacket(const QString& certID, const QString& ownerKey, const EntityItemID& entityItemID, const SharedNodePointer& senderNode);
void sendChallengeOwnershipRequestPacket(const QByteArray& certID, const QByteArray& encryptedText, const QByteArray& nodeToChallenge, const SharedNodePointer& senderNode); void sendChallengeOwnershipRequestPacket(const QByteArray& certID, const QByteArray& encryptedText, const QByteArray& nodeToChallenge, const SharedNodePointer& senderNode);
void validatePop(const QString& certID, const EntityItemID& entityItemID, const SharedNodePointer& senderNode, bool isRetryingValidation); void validatePop(const QString& certID, const EntityItemID& entityItemID, const SharedNodePointer& senderNode, bool isRetryingValidation);
AvatarData* _myAvatar{ nullptr };
}; };
#endif // hifi_EntityTree_h #endif // hifi_EntityTree_h

View file

@ -30,7 +30,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
case PacketType::EntityEdit: case PacketType::EntityEdit:
case PacketType::EntityData: case PacketType::EntityData:
case PacketType::EntityPhysics: case PacketType::EntityPhysics:
return static_cast<PacketVersion>(EntityVersion::ParentJointName); return static_cast<PacketVersion>(EntityVersion::HazeEffect);
case PacketType::EntityQuery: case PacketType::EntityQuery:
return static_cast<PacketVersion>(EntityQueryPacketVersion::JSONFilterWithFamilyTree); return static_cast<PacketVersion>(EntityQueryPacketVersion::JSONFilterWithFamilyTree);

View file

@ -199,8 +199,7 @@ QDebug operator<<(QDebug debug, const PacketType& type);
enum class EntityVersion : PacketVersion { enum class EntityVersion : PacketVersion {
StrokeColorProperty = 77, StrokeColorProperty = 77,
HasDynamicOwnershipTests, HasDynamicOwnershipTests,
HazeEffect, HazeEffect
ParentJointName
}; };
enum class EntityScriptCallMethodVersion : PacketVersion { enum class EntityScriptCallMethodVersion : PacketVersion {

View file

@ -77,18 +77,6 @@ void SpatiallyNestable::setParentID(const QUuid& parentID) {
getParentPointer(success); getParentPointer(success);
} }
quint16 SpatiallyNestable::getParentJointIndex() const {
if (_parentJointName.isEmpty()) {
return _parentJointIndex;
}
bool success = false;
SpatiallyNestablePointer parent = getParentPointer(success);
if (success && parent) {
return parent->getJointIndex(_parentJointName);
}
return _parentJointIndex;
}
Transform SpatiallyNestable::getParentTransform(bool& success, int depth) const { Transform SpatiallyNestable::getParentTransform(bool& success, int depth) const {
Transform result; Transform result;
SpatiallyNestablePointer parent = getParentPointer(success); SpatiallyNestablePointer parent = getParentPointer(success);
@ -96,7 +84,7 @@ Transform SpatiallyNestable::getParentTransform(bool& success, int depth) const
return result; return result;
} }
if (parent) { if (parent) {
result = parent->getTransform(getParentJointIndex(), success, depth + 1); result = parent->getTransform(_parentJointIndex, success, depth + 1);
} }
return result; return result;
} }
@ -175,14 +163,6 @@ void SpatiallyNestable::setParentJointIndex(quint16 parentJointIndex) {
_parentJointIndex = parentJointIndex; _parentJointIndex = parentJointIndex;
} }
void SpatiallyNestable::setParentJointName(const QString& parentJointName) {
_parentJointName = parentJointName;
}
QString SpatiallyNestable::getParentJointName() const {
return _parentJointName;
}
glm::vec3 SpatiallyNestable::worldToLocal(const glm::vec3& position, glm::vec3 SpatiallyNestable::worldToLocal(const glm::vec3& position,
const QUuid& parentID, int parentJointIndex, const QUuid& parentID, int parentJointIndex,
bool& success) { bool& success) {

View file

@ -47,12 +47,9 @@ public:
virtual const QUuid getParentID() const; virtual const QUuid getParentID() const;
virtual void setParentID(const QUuid& parentID); virtual void setParentID(const QUuid& parentID);
virtual quint16 getParentJointIndex() const; virtual quint16 getParentJointIndex() const { return _parentJointIndex; }
virtual void setParentJointIndex(quint16 parentJointIndex); virtual void setParentJointIndex(quint16 parentJointIndex);
virtual QString getParentJointName() const;
virtual void setParentJointName(const QString& parentJointName);
static glm::vec3 worldToLocal(const glm::vec3& position, const QUuid& parentID, int parentJointIndex, bool& success); static glm::vec3 worldToLocal(const glm::vec3& position, const QUuid& parentID, int parentJointIndex, bool& success);
static glm::quat worldToLocal(const glm::quat& orientation, const QUuid& parentID, int parentJointIndex, bool& success); static glm::quat worldToLocal(const glm::quat& orientation, const QUuid& parentID, int parentJointIndex, bool& success);
static glm::vec3 worldToLocalVelocity(const glm::vec3& velocity, const QUuid& parentID, static glm::vec3 worldToLocalVelocity(const glm::vec3& velocity, const QUuid& parentID,
@ -165,9 +162,6 @@ public:
virtual bool setLocalJointRotation(int index, const glm::quat& rotation) { return false; } virtual bool setLocalJointRotation(int index, const glm::quat& rotation) { return false; }
virtual bool setLocalJointTranslation(int index, const glm::vec3& translation) { return false; } virtual bool setLocalJointTranslation(int index, const glm::vec3& translation) { return false; }
virtual int getJointIndex(const QString& jointName) const { return -1; }
virtual QString getJointName(int jointIndex) const { return ""; }
SpatiallyNestablePointer getThisPointer() const; SpatiallyNestablePointer getThisPointer() const;
using ChildLambda = std::function<void(const SpatiallyNestablePointer&)>; using ChildLambda = std::function<void(const SpatiallyNestablePointer&)>;
@ -230,7 +224,6 @@ protected:
private: private:
QUuid _parentID; // what is this thing's transform relative to? QUuid _parentID; // what is this thing's transform relative to?
quint16 _parentJointIndex { INVALID_JOINT_INDEX }; // which joint of the parent is this relative to? quint16 _parentJointIndex { INVALID_JOINT_INDEX }; // which joint of the parent is this relative to?
QString _parentJointName;
mutable ReadWriteLockable _transformLock; mutable ReadWriteLockable _transformLock;
mutable ReadWriteLockable _idLock; mutable ReadWriteLockable _idLock;