mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
code review
This commit is contained in:
parent
ce1b8ae6f0
commit
96f506a98d
6 changed files with 23 additions and 20 deletions
|
@ -1648,3 +1648,13 @@ void AvatarData::setPosition(const glm::vec3& position) {
|
|||
void AvatarData::setOrientation(const glm::quat& orientation) {
|
||||
SpatiallyNestable::setOrientation(orientation);
|
||||
}
|
||||
|
||||
glm::quat AvatarData::getAbsoluteJointRotationInObjectFrame(int index) const {
|
||||
assert(false);
|
||||
return glm::quat();
|
||||
}
|
||||
|
||||
glm::vec3 AvatarData::getAbsoluteJointTranslationInObjectFrame(int index) const {
|
||||
assert(false);
|
||||
return glm::vec3();
|
||||
}
|
||||
|
|
|
@ -356,6 +356,9 @@ public slots:
|
|||
void setJointMappingsFromNetworkReply();
|
||||
void setSessionUUID(const QUuid& sessionUUID) { setID(sessionUUID); }
|
||||
|
||||
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
|
||||
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
|
||||
|
||||
protected:
|
||||
glm::vec3 _handPosition;
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
|
|||
entity->flagForOwnership();
|
||||
}
|
||||
}
|
||||
if (properties.parentRelatedPropertyChanged() && entity->setPuffedQueryAACube()) {
|
||||
if (properties.parentRelatedPropertyChanged() && entity->computePuffedQueryAACube()) {
|
||||
properties.setQueryAACube(entity->getQueryAACube());
|
||||
}
|
||||
entity->setLastBroadcast(usecTimestampNow());
|
||||
|
@ -283,8 +283,8 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
|
|||
// if they've changed.
|
||||
entity->forEachDescendant([&](SpatiallyNestablePointer descendant) {
|
||||
if (descendant->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entityDescendant = std::static_pointer_cast<EntityItem>(descendant);
|
||||
if (descendant->setPuffedQueryAACube()) {
|
||||
if (descendant->computePuffedQueryAACube()) {
|
||||
EntityItemPointer entityDescendant = std::static_pointer_cast<EntityItem>(descendant);
|
||||
EntityItemProperties newQueryCubeProperties;
|
||||
newQueryCubeProperties.setQueryAACube(descendant->getQueryAACube());
|
||||
queueEntityMessage(PacketType::EntityEdit, descendant->getID(), newQueryCubeProperties);
|
||||
|
|
|
@ -470,7 +470,7 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, const Q
|
|||
properties.setActionData(_serverActionData);
|
||||
}
|
||||
|
||||
if (properties.parentRelatedPropertyChanged() && _entity->setPuffedQueryAACube()) {
|
||||
if (properties.parentRelatedPropertyChanged() && _entity->computePuffedQueryAACube()) {
|
||||
// due to parenting, the server may not know where something is in world-space, so include the bounding cube.
|
||||
properties.setQueryAACube(_entity->getQueryAACube());
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, const Q
|
|||
_entity->forEachDescendant([&](SpatiallyNestablePointer descendant) {
|
||||
if (descendant->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer entityDescendant = std::static_pointer_cast<EntityItem>(descendant);
|
||||
if (descendant->setPuffedQueryAACube()) {
|
||||
if (descendant->computePuffedQueryAACube()) {
|
||||
EntityItemProperties newQueryCubeProperties;
|
||||
newQueryCubeProperties.setQueryAACube(descendant->getQueryAACube());
|
||||
entityPacketSender->queueEditEntityMessage(PacketType::EntityEdit, descendant->getID(), newQueryCubeProperties);
|
||||
|
|
|
@ -497,16 +497,6 @@ const Transform SpatiallyNestable::getAbsoluteJointTransformInObjectFrame(int jo
|
|||
return jointTransformInObjectFrame;
|
||||
}
|
||||
|
||||
glm::quat SpatiallyNestable::getAbsoluteJointRotationInObjectFrame(int index) const {
|
||||
assert(false);
|
||||
return glm::quat();
|
||||
}
|
||||
|
||||
glm::vec3 SpatiallyNestable::getAbsoluteJointTranslationInObjectFrame(int index) const {
|
||||
assert(false);
|
||||
return glm::vec3();
|
||||
}
|
||||
|
||||
SpatiallyNestablePointer SpatiallyNestable::getThisPointer() const {
|
||||
SpatiallyNestableConstPointer constThisPointer = shared_from_this();
|
||||
SpatiallyNestablePointer thisPointer = std::const_pointer_cast<SpatiallyNestable>(constThisPointer); // ermahgerd !!!
|
||||
|
@ -562,7 +552,7 @@ bool SpatiallyNestable::queryAABoxNeedsUpdate() const {
|
|||
// make sure children are still in their boxes, also.
|
||||
bool childNeedsUpdate = false;
|
||||
getThisPointer()->forEachDescendant([&](SpatiallyNestablePointer descendant) {
|
||||
if (descendant->queryAABoxNeedsUpdate()) {
|
||||
if (!childNeedsUpdate && descendant->queryAABoxNeedsUpdate()) {
|
||||
childNeedsUpdate = true;
|
||||
}
|
||||
});
|
||||
|
@ -577,7 +567,7 @@ bool SpatiallyNestable::queryAABoxNeedsUpdate() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool SpatiallyNestable::setPuffedQueryAACube() {
|
||||
bool SpatiallyNestable::computePuffedQueryAACube() {
|
||||
if (!queryAABoxNeedsUpdate()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
virtual void setOrientation(const glm::quat& orientation);
|
||||
|
||||
virtual AACube getMaximumAACube(bool& success) const;
|
||||
virtual bool setPuffedQueryAACube();
|
||||
virtual bool computePuffedQueryAACube();
|
||||
|
||||
virtual void setQueryAACube(const AACube& queryAACube);
|
||||
virtual bool queryAABoxNeedsUpdate() const;
|
||||
|
@ -102,8 +102,8 @@ public:
|
|||
|
||||
// this object's frame
|
||||
virtual const Transform getAbsoluteJointTransformInObjectFrame(int jointIndex) const;
|
||||
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const;
|
||||
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const;
|
||||
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const = 0;
|
||||
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const = 0;
|
||||
|
||||
SpatiallyNestablePointer getThisPointer() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue