mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-03 09:10:59 +02:00
Merge pull request #6083 from sethalves/groundwork-for-hold-action-changes
Groundwork for hold action changes
This commit is contained in:
commit
3d17c57910
33 changed files with 790 additions and 310 deletions
|
@ -24,15 +24,24 @@ AssignmentAction::~AssignmentAction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignmentAction::removeFromSimulation(EntitySimulation* simulation) const {
|
void AssignmentAction::removeFromSimulation(EntitySimulation* simulation) const {
|
||||||
simulation->removeAction(_id);
|
withReadLock([&]{
|
||||||
|
simulation->removeAction(_id);
|
||||||
|
simulation->applyActionChanges();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AssignmentAction::serialize() const {
|
QByteArray AssignmentAction::serialize() const {
|
||||||
return _data;
|
QByteArray result;
|
||||||
|
withReadLock([&]{
|
||||||
|
result = _data;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignmentAction::deserialize(QByteArray serializedArguments) {
|
void AssignmentAction::deserialize(QByteArray serializedArguments) {
|
||||||
_data = serializedArguments;
|
withWriteLock([&]{
|
||||||
|
_data = serializedArguments;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AssignmentAction::updateArguments(QVariantMap arguments) {
|
bool AssignmentAction::updateArguments(QVariantMap arguments) {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "EntityActionInterface.h"
|
#include "EntityActionInterface.h"
|
||||||
|
|
||||||
|
|
||||||
class AssignmentAction : public EntityActionInterface {
|
class AssignmentAction : public EntityActionInterface, public ReadWriteLockable {
|
||||||
public:
|
public:
|
||||||
AssignmentAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
AssignmentAction(EntityActionType type, const QUuid& id, EntityItemPointer ownerEntity);
|
||||||
virtual ~AssignmentAction();
|
virtual ~AssignmentAction();
|
||||||
|
|
|
@ -147,9 +147,13 @@ bool EntityServer::readAdditionalConfiguration(const QJsonObject& settingsSectio
|
||||||
readOptionBool(QString("wantEditLogging"), settingsSectionObject, wantEditLogging);
|
readOptionBool(QString("wantEditLogging"), settingsSectionObject, wantEditLogging);
|
||||||
qDebug("wantEditLogging=%s", debug::valueOf(wantEditLogging));
|
qDebug("wantEditLogging=%s", debug::valueOf(wantEditLogging));
|
||||||
|
|
||||||
|
bool wantTerseEditLogging = false;
|
||||||
|
readOptionBool(QString("wantTerseEditLogging"), settingsSectionObject, wantTerseEditLogging);
|
||||||
|
qDebug("wantTerseEditLogging=%s", debug::valueOf(wantTerseEditLogging));
|
||||||
|
|
||||||
EntityTreePointer tree = std::static_pointer_cast<EntityTree>(_tree);
|
EntityTreePointer tree = std::static_pointer_cast<EntityTree>(_tree);
|
||||||
tree->setWantEditLogging(wantEditLogging);
|
tree->setWantEditLogging(wantEditLogging);
|
||||||
|
tree->setWantTerseEditLogging(wantTerseEditLogging);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -484,6 +484,14 @@
|
||||||
"default": false,
|
"default": false,
|
||||||
"advanced": true
|
"advanced": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "wantTerseEditLogging",
|
||||||
|
"type": "checkbox",
|
||||||
|
"label": "Edit Logging (Terse)",
|
||||||
|
"help": "Logging of all edits to entities",
|
||||||
|
"default": false,
|
||||||
|
"advanced": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "verboseDebug",
|
"name": "verboseDebug",
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
|
|
|
@ -66,7 +66,8 @@ var MSEC_PER_SEC = 1000.0;
|
||||||
// these control how long an abandoned pointer line will hang around
|
// these control how long an abandoned pointer line will hang around
|
||||||
var startTime = Date.now();
|
var startTime = Date.now();
|
||||||
var LIFETIME = 10;
|
var LIFETIME = 10;
|
||||||
var ACTION_LIFETIME = 10; // seconds
|
var ACTION_LIFETIME = 15; // seconds
|
||||||
|
var ACTION_LIFETIME_REFRESH = 5;
|
||||||
var PICKS_PER_SECOND_PER_HAND = 5;
|
var PICKS_PER_SECOND_PER_HAND = 5;
|
||||||
var MSECS_PER_SEC = 1000.0;
|
var MSECS_PER_SEC = 1000.0;
|
||||||
|
|
||||||
|
@ -339,11 +340,12 @@ function MyController(hand, triggerAction) {
|
||||||
var handRotation = Quat.multiply(MyAvatar.orientation, Controller.getSpatialControlRawRotation(this.palm));
|
var handRotation = Quat.multiply(MyAvatar.orientation, Controller.getSpatialControlRawRotation(this.palm));
|
||||||
var grabbedProperties = Entities.getEntityProperties(this.grabbedEntity, ["position", "rotation",
|
var grabbedProperties = Entities.getEntityProperties(this.grabbedEntity, ["position", "rotation",
|
||||||
"gravity", "ignoreForCollisions"]);
|
"gravity", "ignoreForCollisions"]);
|
||||||
|
var now = Date.now();
|
||||||
|
|
||||||
// add the action and initialize some variables
|
// add the action and initialize some variables
|
||||||
this.currentObjectPosition = grabbedProperties.position;
|
this.currentObjectPosition = grabbedProperties.position;
|
||||||
this.currentObjectRotation = grabbedProperties.rotation;
|
this.currentObjectRotation = grabbedProperties.rotation;
|
||||||
this.currentObjectTime = Date.now();
|
this.currentObjectTime = now;
|
||||||
this.handPreviousPosition = handControllerPosition;
|
this.handPreviousPosition = handControllerPosition;
|
||||||
this.handPreviousRotation = handRotation;
|
this.handPreviousRotation = handRotation;
|
||||||
|
|
||||||
|
@ -359,6 +361,7 @@ function MyController(hand, triggerAction) {
|
||||||
if (this.actionID === NULL_ACTION_ID) {
|
if (this.actionID === NULL_ACTION_ID) {
|
||||||
this.actionID = null;
|
this.actionID = null;
|
||||||
}
|
}
|
||||||
|
this.actionTimeout = now + (ACTION_LIFETIME * MSEC_PER_SEC);
|
||||||
|
|
||||||
if (this.actionID !== null) {
|
if (this.actionID !== null) {
|
||||||
this.setState(STATE_CONTINUE_DISTANCE_HOLDING);
|
this.setState(STATE_CONTINUE_DISTANCE_HOLDING);
|
||||||
|
@ -441,7 +444,9 @@ function MyController(hand, triggerAction) {
|
||||||
this.currentObjectTime = now;
|
this.currentObjectTime = now;
|
||||||
|
|
||||||
// this doubles hand rotation
|
// this doubles hand rotation
|
||||||
var handChange = Quat.multiply(Quat.slerp(this.handPreviousRotation, handRotation, DISTANCE_HOLDING_ROTATION_EXAGGERATION_FACTOR), Quat.inverse(this.handPreviousRotation));
|
var handChange = Quat.multiply(Quat.slerp(this.handPreviousRotation, handRotation,
|
||||||
|
DISTANCE_HOLDING_ROTATION_EXAGGERATION_FACTOR),
|
||||||
|
Quat.inverse(this.handPreviousRotation));
|
||||||
this.handPreviousRotation = handRotation;
|
this.handPreviousRotation = handRotation;
|
||||||
this.currentObjectRotation = Quat.multiply(handChange, this.currentObjectRotation);
|
this.currentObjectRotation = Quat.multiply(handChange, this.currentObjectRotation);
|
||||||
|
|
||||||
|
@ -454,9 +459,11 @@ function MyController(hand, triggerAction) {
|
||||||
angularTimeScale: DISTANCE_HOLDING_ACTION_TIMEFRAME,
|
angularTimeScale: DISTANCE_HOLDING_ACTION_TIMEFRAME,
|
||||||
lifetime: ACTION_LIFETIME
|
lifetime: ACTION_LIFETIME
|
||||||
});
|
});
|
||||||
|
this.actionTimeout = now + (ACTION_LIFETIME * MSEC_PER_SEC);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.nearGrabbing = function() {
|
this.nearGrabbing = function() {
|
||||||
|
var now = Date.now();
|
||||||
|
|
||||||
if (this.triggerSmoothedReleased()) {
|
if (this.triggerSmoothedReleased()) {
|
||||||
this.setState(STATE_RELEASE);
|
this.setState(STATE_RELEASE);
|
||||||
|
@ -465,7 +472,7 @@ function MyController(hand, triggerAction) {
|
||||||
|
|
||||||
this.lineOff();
|
this.lineOff();
|
||||||
|
|
||||||
var grabbedProperties = Entities.getEntityProperties(this.grabbedEntity,
|
var grabbedProperties = Entities.getEntityProperties(this.grabbedEntity,
|
||||||
["position", "rotation", "gravity", "ignoreForCollisions"]);
|
["position", "rotation", "gravity", "ignoreForCollisions"]);
|
||||||
this.activateEntity(this.grabbedEntity, grabbedProperties);
|
this.activateEntity(this.grabbedEntity, grabbedProperties);
|
||||||
|
|
||||||
|
@ -473,23 +480,24 @@ function MyController(hand, triggerAction) {
|
||||||
var handPosition = this.getHandPosition();
|
var handPosition = this.getHandPosition();
|
||||||
|
|
||||||
var objectRotation = grabbedProperties.rotation;
|
var objectRotation = grabbedProperties.rotation;
|
||||||
var offsetRotation = Quat.multiply(Quat.inverse(handRotation), objectRotation);
|
this.offsetRotation = Quat.multiply(Quat.inverse(handRotation), objectRotation);
|
||||||
|
|
||||||
var currentObjectPosition = grabbedProperties.position;
|
var currentObjectPosition = grabbedProperties.position;
|
||||||
var offset = Vec3.subtract(currentObjectPosition, handPosition);
|
var offset = Vec3.subtract(currentObjectPosition, handPosition);
|
||||||
var offsetPosition = Vec3.multiplyQbyV(Quat.inverse(Quat.multiply(handRotation, offsetRotation)), offset);
|
this.offsetPosition = Vec3.multiplyQbyV(Quat.inverse(Quat.multiply(handRotation, this.offsetRotation)), offset);
|
||||||
|
|
||||||
this.actionID = NULL_ACTION_ID;
|
this.actionID = NULL_ACTION_ID;
|
||||||
this.actionID = Entities.addAction("hold", this.grabbedEntity, {
|
this.actionID = Entities.addAction("hold", this.grabbedEntity, {
|
||||||
hand: this.hand === RIGHT_HAND ? "right" : "left",
|
hand: this.hand === RIGHT_HAND ? "right" : "left",
|
||||||
timeScale: NEAR_GRABBING_ACTION_TIMEFRAME,
|
timeScale: NEAR_GRABBING_ACTION_TIMEFRAME,
|
||||||
relativePosition: offsetPosition,
|
relativePosition: this.offsetPosition,
|
||||||
relativeRotation: offsetRotation,
|
relativeRotation: this.offsetRotation,
|
||||||
lifetime: ACTION_LIFETIME
|
lifetime: ACTION_LIFETIME
|
||||||
});
|
});
|
||||||
if (this.actionID === NULL_ACTION_ID) {
|
if (this.actionID === NULL_ACTION_ID) {
|
||||||
this.actionID = null;
|
this.actionID = null;
|
||||||
} else {
|
} else {
|
||||||
|
this.actionTimeout = now + (ACTION_LIFETIME * MSEC_PER_SEC);
|
||||||
this.setState(STATE_CONTINUE_NEAR_GRABBING);
|
this.setState(STATE_CONTINUE_NEAR_GRABBING);
|
||||||
if (this.hand === RIGHT_HAND) {
|
if (this.hand === RIGHT_HAND) {
|
||||||
Entities.callEntityMethod(this.grabbedEntity, "setRightHand");
|
Entities.callEntityMethod(this.grabbedEntity, "setRightHand");
|
||||||
|
@ -511,10 +519,10 @@ function MyController(hand, triggerAction) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep track of the fingertip velocity to impart when we release the object
|
// Keep track of the fingertip velocity to impart when we release the object.
|
||||||
// Note that the idea of using a constant 'tip' velocity regardless of the
|
// Note that the idea of using a constant 'tip' velocity regardless of the
|
||||||
// object's actual held offset is an idea intended to make it easier to throw things:
|
// object's actual held offset is an idea intended to make it easier to throw things:
|
||||||
// Because we might catch something or transfer it between hands without a good idea
|
// Because we might catch something or transfer it between hands without a good idea
|
||||||
// of it's actual offset, let's try imparting a velocity which is at a fixed radius
|
// of it's actual offset, let's try imparting a velocity which is at a fixed radius
|
||||||
// from the palm.
|
// from the palm.
|
||||||
|
|
||||||
|
@ -529,9 +537,17 @@ function MyController(hand, triggerAction) {
|
||||||
this.currentObjectTime = now;
|
this.currentObjectTime = now;
|
||||||
Entities.callEntityMethod(this.grabbedEntity, "continueNearGrab");
|
Entities.callEntityMethod(this.grabbedEntity, "continueNearGrab");
|
||||||
|
|
||||||
Entities.updateAction(this.grabbedEntity, this.actionID, {
|
if (this.actionTimeout - now < ACTION_LIFETIME_REFRESH * MSEC_PER_SEC) {
|
||||||
lifetime: ACTION_LIFETIME
|
// if less than a 5 seconds left, refresh the actions lifetime
|
||||||
});
|
Entities.updateAction(this.grabbedEntity, this.actionID, {
|
||||||
|
hand: this.hand === RIGHT_HAND ? "right" : "left",
|
||||||
|
timeScale: NEAR_GRABBING_ACTION_TIMEFRAME,
|
||||||
|
relativePosition: this.offsetPosition,
|
||||||
|
relativeRotation: this.offsetRotation,
|
||||||
|
lifetime: ACTION_LIFETIME
|
||||||
|
});
|
||||||
|
this.actionTimeout = now + (ACTION_LIFETIME * MSEC_PER_SEC);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.nearGrabbingNonColliding = function() {
|
this.nearGrabbingNonColliding = function() {
|
||||||
|
|
|
@ -56,6 +56,7 @@ const float DISPLAYNAME_FADE_TIME = 0.5f;
|
||||||
const float DISPLAYNAME_FADE_FACTOR = pow(0.01f, 1.0f / DISPLAYNAME_FADE_TIME);
|
const float DISPLAYNAME_FADE_FACTOR = pow(0.01f, 1.0f / DISPLAYNAME_FADE_TIME);
|
||||||
const float DISPLAYNAME_ALPHA = 1.0f;
|
const float DISPLAYNAME_ALPHA = 1.0f;
|
||||||
const float DISPLAYNAME_BACKGROUND_ALPHA = 0.4f;
|
const float DISPLAYNAME_BACKGROUND_ALPHA = 0.4f;
|
||||||
|
const glm::vec3 HAND_TO_PALM_OFFSET(0.0f, 0.12f, 0.08f);
|
||||||
|
|
||||||
namespace render {
|
namespace render {
|
||||||
template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) {
|
template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) {
|
||||||
|
@ -1167,3 +1168,64 @@ void Avatar::rebuildSkeletonBody() {
|
||||||
DependencyManager::get<AvatarManager>()->updateAvatarPhysicsShape(getSessionUUID());
|
DependencyManager::get<AvatarManager>()->updateAvatarPhysicsShape(getSessionUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getLeftPalmPosition() {
|
||||||
|
glm::vec3 leftHandPosition;
|
||||||
|
getSkeletonModel().getLeftHandPosition(leftHandPosition);
|
||||||
|
glm::quat leftRotation;
|
||||||
|
getSkeletonModel().getJointRotationInWorldFrame(getSkeletonModel().getLeftHandJointIndex(), leftRotation);
|
||||||
|
leftHandPosition += HAND_TO_PALM_OFFSET * glm::inverse(leftRotation);
|
||||||
|
return leftHandPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getLeftPalmVelocity() {
|
||||||
|
const PalmData* palm = getHand()->getPalm(LEFT_HAND_INDEX);
|
||||||
|
if (palm != NULL) {
|
||||||
|
return palm->getVelocity();
|
||||||
|
}
|
||||||
|
return glm::vec3(0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getLeftPalmAngularVelocity() {
|
||||||
|
const PalmData* palm = getHand()->getPalm(LEFT_HAND_INDEX);
|
||||||
|
if (palm != NULL) {
|
||||||
|
return palm->getRawAngularVelocity();
|
||||||
|
}
|
||||||
|
return glm::vec3(0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::quat Avatar::getLeftPalmRotation() {
|
||||||
|
glm::quat leftRotation;
|
||||||
|
getSkeletonModel().getJointRotationInWorldFrame(getSkeletonModel().getLeftHandJointIndex(), leftRotation);
|
||||||
|
return leftRotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getRightPalmPosition() {
|
||||||
|
glm::vec3 rightHandPosition;
|
||||||
|
getSkeletonModel().getRightHandPosition(rightHandPosition);
|
||||||
|
glm::quat rightRotation;
|
||||||
|
getSkeletonModel().getJointRotationInWorldFrame(getSkeletonModel().getRightHandJointIndex(), rightRotation);
|
||||||
|
rightHandPosition += HAND_TO_PALM_OFFSET * glm::inverse(rightRotation);
|
||||||
|
return rightHandPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getRightPalmVelocity() {
|
||||||
|
const PalmData* palm = getHand()->getPalm(RIGHT_HAND_INDEX);
|
||||||
|
if (palm != NULL) {
|
||||||
|
return palm->getVelocity();
|
||||||
|
}
|
||||||
|
return glm::vec3(0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 Avatar::getRightPalmAngularVelocity() {
|
||||||
|
const PalmData* palm = getHand()->getPalm(RIGHT_HAND_INDEX);
|
||||||
|
if (palm != NULL) {
|
||||||
|
return palm->getRawAngularVelocity();
|
||||||
|
}
|
||||||
|
return glm::vec3(0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::quat Avatar::getRightPalmRotation() {
|
||||||
|
glm::quat rightRotation;
|
||||||
|
getSkeletonModel().getJointRotationInWorldFrame(getSkeletonModel().getRightHandJointIndex(), rightRotation);
|
||||||
|
return rightRotation;
|
||||||
|
}
|
||||||
|
|
|
@ -174,6 +174,16 @@ public:
|
||||||
void setMotionState(AvatarMotionState* motionState) { _motionState = motionState; }
|
void setMotionState(AvatarMotionState* motionState) { _motionState = motionState; }
|
||||||
AvatarMotionState* getMotionState() { return _motionState; }
|
AvatarMotionState* getMotionState() { return _motionState; }
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
glm::vec3 getLeftPalmPosition();
|
||||||
|
glm::vec3 getLeftPalmVelocity();
|
||||||
|
glm::vec3 getLeftPalmAngularVelocity();
|
||||||
|
glm::quat getLeftPalmRotation();
|
||||||
|
glm::vec3 getRightPalmPosition();
|
||||||
|
glm::vec3 getRightPalmVelocity();
|
||||||
|
glm::vec3 getRightPalmAngularVelocity();
|
||||||
|
glm::quat getRightPalmRotation();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SkeletonModel _skeletonModel;
|
SkeletonModel _skeletonModel;
|
||||||
glm::vec3 _skeletonOffset;
|
glm::vec3 _skeletonOffset;
|
||||||
|
|
|
@ -21,8 +21,7 @@ AvatarActionHold::AvatarActionHold(const QUuid& id, EntityItemPointer ownerEntit
|
||||||
ObjectActionSpring(id, ownerEntity),
|
ObjectActionSpring(id, ownerEntity),
|
||||||
_relativePosition(glm::vec3(0.0f)),
|
_relativePosition(glm::vec3(0.0f)),
|
||||||
_relativeRotation(glm::quat()),
|
_relativeRotation(glm::quat()),
|
||||||
_hand("right"),
|
_hand("right")
|
||||||
_mine(false)
|
|
||||||
{
|
{
|
||||||
_type = ACTION_TYPE_HOLD;
|
_type = ACTION_TYPE_HOLD;
|
||||||
#if WANT_DEBUG
|
#if WANT_DEBUG
|
||||||
|
@ -37,17 +36,12 @@ AvatarActionHold::~AvatarActionHold() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarActionHold::updateActionWorker(float deltaTimeStep) {
|
void AvatarActionHold::updateActionWorker(float deltaTimeStep) {
|
||||||
if (!_mine) {
|
bool gotLock = false;
|
||||||
// if a local script isn't updating this, then we are just getting spring-action data over the wire.
|
|
||||||
// let the super-class handle it.
|
|
||||||
ObjectActionSpring::updateActionWorker(deltaTimeStep);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::quat rotation;
|
glm::quat rotation;
|
||||||
glm::vec3 position;
|
glm::vec3 position;
|
||||||
glm::vec3 offset;
|
glm::vec3 offset;
|
||||||
bool gotLock = withTryReadLock([&]{
|
|
||||||
|
gotLock = withTryReadLock([&]{
|
||||||
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||||
glm::vec3 palmPosition;
|
glm::vec3 palmPosition;
|
||||||
glm::quat palmRotation;
|
glm::quat palmRotation;
|
||||||
|
@ -66,17 +60,16 @@ void AvatarActionHold::updateActionWorker(float deltaTimeStep) {
|
||||||
|
|
||||||
if (gotLock) {
|
if (gotLock) {
|
||||||
gotLock = withTryWriteLock([&]{
|
gotLock = withTryWriteLock([&]{
|
||||||
if (_positionalTarget != position || _rotationalTarget != rotation) {
|
_positionalTarget = position;
|
||||||
auto ownerEntity = _ownerEntity.lock();
|
_rotationalTarget = rotation;
|
||||||
if (ownerEntity) {
|
_positionalTargetSet = true;
|
||||||
ownerEntity->setActionDataDirty(true);
|
_rotationalTargetSet = true;
|
||||||
}
|
auto ownerEntity = _ownerEntity.lock();
|
||||||
_positionalTarget = position;
|
if (ownerEntity) {
|
||||||
_rotationalTarget = rotation;
|
ownerEntity->setActionDataDirty(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gotLock) {
|
if (gotLock) {
|
||||||
ObjectActionSpring::updateActionWorker(deltaTimeStep);
|
ObjectActionSpring::updateActionWorker(deltaTimeStep);
|
||||||
}
|
}
|
||||||
|
@ -84,66 +77,76 @@ void AvatarActionHold::updateActionWorker(float deltaTimeStep) {
|
||||||
|
|
||||||
|
|
||||||
bool AvatarActionHold::updateArguments(QVariantMap arguments) {
|
bool AvatarActionHold::updateArguments(QVariantMap arguments) {
|
||||||
if (!ObjectAction::updateArguments(arguments)) {
|
glm::vec3 relativePosition;
|
||||||
return false;
|
glm::quat relativeRotation;
|
||||||
}
|
float timeScale;
|
||||||
bool ok = true;
|
QString hand;
|
||||||
glm::vec3 relativePosition =
|
QUuid holderID;
|
||||||
EntityActionInterface::extractVec3Argument("hold", arguments, "relativePosition", ok, false);
|
bool needUpdate = false;
|
||||||
if (!ok) {
|
|
||||||
relativePosition = _relativePosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
ok = true;
|
bool somethingChanged = ObjectAction::updateArguments(arguments);
|
||||||
glm::quat relativeRotation =
|
withReadLock([&]{
|
||||||
EntityActionInterface::extractQuatArgument("hold", arguments, "relativeRotation", ok, false);
|
bool ok = true;
|
||||||
if (!ok) {
|
relativePosition = EntityActionInterface::extractVec3Argument("hold", arguments, "relativePosition", ok, false);
|
||||||
relativeRotation = _relativeRotation;
|
if (!ok) {
|
||||||
}
|
relativePosition = _relativePosition;
|
||||||
|
}
|
||||||
ok = true;
|
|
||||||
float timeScale =
|
|
||||||
EntityActionInterface::extractFloatArgument("hold", arguments, "timeScale", ok, false);
|
|
||||||
if (!ok) {
|
|
||||||
timeScale = _linearTimeScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
ok = true;
|
ok = true;
|
||||||
QString hand =
|
relativeRotation = EntityActionInterface::extractQuatArgument("hold", arguments, "relativeRotation", ok, false);
|
||||||
EntityActionInterface::extractStringArgument("hold", arguments, "hand", ok, false);
|
if (!ok) {
|
||||||
if (!ok || !(hand == "left" || hand == "right")) {
|
relativeRotation = _relativeRotation;
|
||||||
hand = _hand;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (relativePosition != _relativePosition
|
ok = true;
|
||||||
|| relativeRotation != _relativeRotation
|
timeScale = EntityActionInterface::extractFloatArgument("hold", arguments, "timeScale", ok, false);
|
||||||
|| timeScale != _linearTimeScale
|
if (!ok) {
|
||||||
|| hand != _hand) {
|
timeScale = _linearTimeScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
ok = true;
|
||||||
|
hand = EntityActionInterface::extractStringArgument("hold", arguments, "hand", ok, false);
|
||||||
|
if (!ok || !(hand == "left" || hand == "right")) {
|
||||||
|
hand = _hand;
|
||||||
|
}
|
||||||
|
|
||||||
|
ok = true;
|
||||||
|
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||||
|
holderID = myAvatar->getSessionUUID();
|
||||||
|
|
||||||
|
if (somethingChanged ||
|
||||||
|
relativePosition != _relativePosition ||
|
||||||
|
relativeRotation != _relativeRotation ||
|
||||||
|
timeScale != _linearTimeScale ||
|
||||||
|
hand != _hand) {
|
||||||
|
needUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (needUpdate) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_relativePosition = relativePosition;
|
_relativePosition = relativePosition;
|
||||||
_relativeRotation = relativeRotation;
|
_relativeRotation = relativeRotation;
|
||||||
const float MIN_TIMESCALE = 0.1f;
|
const float MIN_TIMESCALE = 0.1f;
|
||||||
_linearTimeScale = glm::min(MIN_TIMESCALE, timeScale);
|
_linearTimeScale = glm::max(MIN_TIMESCALE, timeScale);
|
||||||
_angularTimeScale = _linearTimeScale;
|
_angularTimeScale = _linearTimeScale;
|
||||||
_hand = hand;
|
_hand = hand;
|
||||||
|
|
||||||
_mine = true;
|
|
||||||
_active = true;
|
_active = true;
|
||||||
activateBody();
|
|
||||||
|
auto ownerEntity = _ownerEntity.lock();
|
||||||
|
if (ownerEntity) {
|
||||||
|
ownerEntity->setActionDataDirty(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
activateBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariantMap AvatarActionHold::getArguments() {
|
QVariantMap AvatarActionHold::getArguments() {
|
||||||
QVariantMap arguments = ObjectAction::getArguments();
|
QVariantMap arguments = ObjectAction::getArguments();
|
||||||
withReadLock([&]{
|
withReadLock([&]{
|
||||||
if (!_mine) {
|
|
||||||
arguments = ObjectActionSpring::getArguments();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
arguments["relativePosition"] = glmToQMap(_relativePosition);
|
arguments["relativePosition"] = glmToQMap(_relativePosition);
|
||||||
arguments["relativeRotation"] = glmToQMap(_relativeRotation);
|
arguments["relativeRotation"] = glmToQMap(_relativeRotation);
|
||||||
arguments["timeScale"] = _linearTimeScale;
|
arguments["timeScale"] = _linearTimeScale;
|
||||||
|
@ -152,9 +155,10 @@ QVariantMap AvatarActionHold::getArguments() {
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QByteArray AvatarActionHold::serialize() const {
|
||||||
|
return ObjectActionSpring::serialize();
|
||||||
|
}
|
||||||
|
|
||||||
void AvatarActionHold::deserialize(QByteArray serializedArguments) {
|
void AvatarActionHold::deserialize(QByteArray serializedArguments) {
|
||||||
if (!_mine) {
|
assert(false);
|
||||||
ObjectActionSpring::deserialize(serializedArguments);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,15 +27,17 @@ public:
|
||||||
|
|
||||||
virtual void updateActionWorker(float deltaTimeStep);
|
virtual void updateActionWorker(float deltaTimeStep);
|
||||||
|
|
||||||
|
QByteArray serialize() const;
|
||||||
virtual void deserialize(QByteArray serializedArguments);
|
virtual void deserialize(QByteArray serializedArguments);
|
||||||
|
|
||||||
|
virtual bool shouldSuppressLocationEdits() { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const uint16_t holdVersion;
|
static const uint16_t holdVersion;
|
||||||
|
|
||||||
glm::vec3 _relativePosition;
|
glm::vec3 _relativePosition;
|
||||||
glm::quat _relativeRotation;
|
glm::quat _relativeRotation;
|
||||||
QString _hand;
|
QString _hand;
|
||||||
bool _mine = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_AvatarActionHold_h
|
#endif // hifi_AvatarActionHold_h
|
||||||
|
|
|
@ -343,3 +343,11 @@ void AvatarManager::updateAvatarRenderStatus(bool shouldRenderAvatars) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AvatarSharedPointer AvatarManager::getAvatarBySessionID(const QUuid& sessionID) {
|
||||||
|
if (sessionID == _myAvatar->getSessionUUID()) {
|
||||||
|
return std::static_pointer_cast<Avatar>(_myAvatar);
|
||||||
|
}
|
||||||
|
return getAvatarHash()[sessionID];
|
||||||
|
}
|
||||||
|
|
|
@ -35,7 +35,8 @@ public:
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
MyAvatar* getMyAvatar() { return _myAvatar.get(); }
|
MyAvatar* getMyAvatar() { return _myAvatar.get(); }
|
||||||
|
AvatarSharedPointer getAvatarBySessionID(const QUuid& sessionID);
|
||||||
|
|
||||||
void updateMyAvatar(float deltaTime);
|
void updateMyAvatar(float deltaTime);
|
||||||
void updateOtherAvatars(float deltaTime);
|
void updateOtherAvatars(float deltaTime);
|
||||||
|
|
||||||
|
|
|
@ -540,70 +540,6 @@ void MyAvatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const glm::vec3 HAND_TO_PALM_OFFSET(0.0f, 0.12f, 0.08f);
|
|
||||||
|
|
||||||
glm::vec3 MyAvatar::getLeftPalmPosition() {
|
|
||||||
glm::vec3 leftHandPosition;
|
|
||||||
getSkeletonModel().getLeftHandPosition(leftHandPosition);
|
|
||||||
glm::quat leftRotation;
|
|
||||||
getSkeletonModel().getJointRotationInWorldFrame(getSkeletonModel().getLeftHandJointIndex(), leftRotation);
|
|
||||||
leftHandPosition += HAND_TO_PALM_OFFSET * glm::inverse(leftRotation);
|
|
||||||
return leftHandPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec3 MyAvatar::getLeftPalmVelocity() {
|
|
||||||
const PalmData* palm = getHand()->getPalm(LEFT_HAND_INDEX);
|
|
||||||
if (palm != NULL) {
|
|
||||||
return palm->getVelocity();
|
|
||||||
}
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec3 MyAvatar::getLeftPalmAngularVelocity() {
|
|
||||||
const PalmData* palm = getHand()->getPalm(LEFT_HAND_INDEX);
|
|
||||||
if (palm != NULL) {
|
|
||||||
return palm->getRawAngularVelocity();
|
|
||||||
}
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::quat MyAvatar::getLeftPalmRotation() {
|
|
||||||
glm::quat leftRotation;
|
|
||||||
getSkeletonModel().getJointRotationInWorldFrame(getSkeletonModel().getLeftHandJointIndex(), leftRotation);
|
|
||||||
return leftRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec3 MyAvatar::getRightPalmPosition() {
|
|
||||||
glm::vec3 rightHandPosition;
|
|
||||||
getSkeletonModel().getRightHandPosition(rightHandPosition);
|
|
||||||
glm::quat rightRotation;
|
|
||||||
getSkeletonModel().getJointRotationInWorldFrame(getSkeletonModel().getRightHandJointIndex(), rightRotation);
|
|
||||||
rightHandPosition += HAND_TO_PALM_OFFSET * glm::inverse(rightRotation);
|
|
||||||
return rightHandPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec3 MyAvatar::getRightPalmVelocity() {
|
|
||||||
const PalmData* palm = getHand()->getPalm(RIGHT_HAND_INDEX);
|
|
||||||
if (palm != NULL) {
|
|
||||||
return palm->getVelocity();
|
|
||||||
}
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec3 MyAvatar::getRightPalmAngularVelocity() {
|
|
||||||
const PalmData* palm = getHand()->getPalm(RIGHT_HAND_INDEX);
|
|
||||||
if (palm != NULL) {
|
|
||||||
return palm->getRawAngularVelocity();
|
|
||||||
}
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::quat MyAvatar::getRightPalmRotation() {
|
|
||||||
glm::quat rightRotation;
|
|
||||||
getSkeletonModel().getJointRotationInWorldFrame(getSkeletonModel().getRightHandJointIndex(), rightRotation);
|
|
||||||
return rightRotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyAvatar::clearReferential() {
|
void MyAvatar::clearReferential() {
|
||||||
changeReferential(NULL);
|
changeReferential(NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,15 +199,6 @@ public slots:
|
||||||
|
|
||||||
Q_INVOKABLE void updateMotionBehaviorFromMenu();
|
Q_INVOKABLE void updateMotionBehaviorFromMenu();
|
||||||
|
|
||||||
glm::vec3 getLeftPalmPosition();
|
|
||||||
glm::vec3 getLeftPalmVelocity();
|
|
||||||
glm::vec3 getLeftPalmAngularVelocity();
|
|
||||||
glm::quat getLeftPalmRotation();
|
|
||||||
glm::vec3 getRightPalmPosition();
|
|
||||||
glm::vec3 getRightPalmVelocity();
|
|
||||||
glm::vec3 getRightPalmAngularVelocity();
|
|
||||||
glm::quat getRightPalmRotation();
|
|
||||||
|
|
||||||
void clearReferential();
|
void clearReferential();
|
||||||
bool setModelReferential(const QUuid& id);
|
bool setModelReferential(const QUuid& id);
|
||||||
bool setJointReferential(const QUuid& id, int jointIndex);
|
bool setJointReferential(const QUuid& id, int jointIndex);
|
||||||
|
|
|
@ -163,6 +163,19 @@ void AnimationPropertyGroup::debugDump() const {
|
||||||
qDebug() << "currentFrame:" << getCurrentFrame() << " has changed:" << currentFrameChanged();
|
qDebug() << "currentFrame:" << getCurrentFrame() << " has changed:" << currentFrameChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AnimationPropertyGroup::listChangedProperties(QList<QString>& out) {
|
||||||
|
if (urlChanged()) {
|
||||||
|
out << "animation-url";
|
||||||
|
}
|
||||||
|
if (fpsChanged()) {
|
||||||
|
out << "animation-fps";
|
||||||
|
}
|
||||||
|
if (currentFrameChanged()) {
|
||||||
|
out << "animation-currentFrame";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AnimationPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
bool AnimationPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
EntityPropertyFlags& propertyFlags,
|
EntityPropertyFlags& propertyFlags,
|
||||||
|
|
|
@ -37,6 +37,7 @@ public:
|
||||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
||||||
virtual void debugDump() const;
|
virtual void debugDump() const;
|
||||||
|
virtual void listChangedProperties(QList<QString>& out);
|
||||||
|
|
||||||
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
|
|
|
@ -54,6 +54,30 @@ void AtmospherePropertyGroup::debugDump() const {
|
||||||
qDebug() << " Has Stars:" << getHasStars() << " has changed:" << hasStarsChanged();
|
qDebug() << " Has Stars:" << getHasStars() << " has changed:" << hasStarsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AtmospherePropertyGroup::listChangedProperties(QList<QString>& out) {
|
||||||
|
if (centerChanged()) {
|
||||||
|
out << "center";
|
||||||
|
}
|
||||||
|
if (innerRadiusChanged()) {
|
||||||
|
out << "innerRadius";
|
||||||
|
}
|
||||||
|
if (outerRadiusChanged()) {
|
||||||
|
out << "outerRadius";
|
||||||
|
}
|
||||||
|
if (mieScatteringChanged()) {
|
||||||
|
out << "mieScattering";
|
||||||
|
}
|
||||||
|
if (rayleighScatteringChanged()) {
|
||||||
|
out << "rayleighScattering";
|
||||||
|
}
|
||||||
|
if (scatteringWavelengthsChanged()) {
|
||||||
|
out << "scatteringWavelengths";
|
||||||
|
}
|
||||||
|
if (hasStarsChanged()) {
|
||||||
|
out << "hasStars";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool AtmospherePropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
bool AtmospherePropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
EntityPropertyFlags& propertyFlags,
|
EntityPropertyFlags& propertyFlags,
|
||||||
|
|
|
@ -53,6 +53,7 @@ public:
|
||||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
||||||
virtual void debugDump() const;
|
virtual void debugDump() const;
|
||||||
|
virtual void listChangedProperties(QList<QString>& out);
|
||||||
|
|
||||||
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
|
@ -87,7 +88,7 @@ public:
|
||||||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
||||||
bool& somethingChanged);
|
bool& somethingChanged);
|
||||||
|
|
||||||
|
|
||||||
static const glm::vec3 DEFAULT_CENTER;
|
static const glm::vec3 DEFAULT_CENTER;
|
||||||
static const float DEFAULT_INNER_RADIUS;
|
static const float DEFAULT_INNER_RADIUS;
|
||||||
static const float DEFAULT_OUTER_RADIUS;
|
static const float DEFAULT_OUTER_RADIUS;
|
||||||
|
|
|
@ -51,15 +51,7 @@ public:
|
||||||
|
|
||||||
bool locallyAddedButNotYetReceived = false;
|
bool locallyAddedButNotYetReceived = false;
|
||||||
|
|
||||||
protected:
|
virtual bool shouldSuppressLocationEdits() { return false; }
|
||||||
virtual glm::vec3 getPosition() = 0;
|
|
||||||
virtual void setPosition(glm::vec3 position) = 0;
|
|
||||||
virtual glm::quat getRotation() = 0;
|
|
||||||
virtual void setRotation(glm::quat rotation) = 0;
|
|
||||||
virtual glm::vec3 getLinearVelocity() = 0;
|
|
||||||
virtual void setLinearVelocity(glm::vec3 linearVelocity) = 0;
|
|
||||||
virtual glm::vec3 getAngularVelocity() = 0;
|
|
||||||
virtual void setAngularVelocity(glm::vec3 angularVelocity) = 0;
|
|
||||||
|
|
||||||
// these look in the arguments map for a named argument. if it's not found or isn't well formed,
|
// these look in the arguments map for a named argument. if it's not found or isn't well formed,
|
||||||
// ok will be set to false (note that it's never set to true -- set it to true before calling these).
|
// ok will be set to false (note that it's never set to true -- set it to true before calling these).
|
||||||
|
@ -75,6 +67,16 @@ protected:
|
||||||
static QString extractStringArgument(QString objectName, QVariantMap arguments,
|
static QString extractStringArgument(QString objectName, QVariantMap arguments,
|
||||||
QString argumentName, bool& ok, bool required = true);
|
QString argumentName, bool& ok, bool required = true);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual glm::vec3 getPosition() = 0;
|
||||||
|
virtual void setPosition(glm::vec3 position) = 0;
|
||||||
|
virtual glm::quat getRotation() = 0;
|
||||||
|
virtual void setRotation(glm::quat rotation) = 0;
|
||||||
|
virtual glm::vec3 getLinearVelocity() = 0;
|
||||||
|
virtual void setLinearVelocity(glm::vec3 linearVelocity) = 0;
|
||||||
|
virtual glm::vec3 getAngularVelocity() = 0;
|
||||||
|
virtual void setAngularVelocity(glm::vec3 angularVelocity) = 0;
|
||||||
|
|
||||||
QUuid _id;
|
QUuid _id;
|
||||||
EntityActionType _type;
|
EntityActionType _type;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1579,6 +1579,7 @@ bool EntityItem::removeActionInternal(const QUuid& actionID, EntitySimulation* s
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityActionPointer action = _objectActions[actionID];
|
EntityActionPointer action = _objectActions[actionID];
|
||||||
|
|
||||||
action->setOwnerEntity(nullptr);
|
action->setOwnerEntity(nullptr);
|
||||||
_objectActions.remove(actionID);
|
_objectActions.remove(actionID);
|
||||||
|
|
||||||
|
@ -1630,8 +1631,6 @@ void EntityItem::deserializeActionsInternal() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep track of which actions got added or updated by the new actionData
|
|
||||||
|
|
||||||
EntityTreePointer entityTree = _element ? _element->getTree() : nullptr;
|
EntityTreePointer entityTree = _element ? _element->getTree() : nullptr;
|
||||||
assert(entityTree);
|
assert(entityTree);
|
||||||
EntitySimulation* simulation = entityTree ? entityTree->getSimulation() : nullptr;
|
EntitySimulation* simulation = entityTree ? entityTree->getSimulation() : nullptr;
|
||||||
|
@ -1643,6 +1642,7 @@ void EntityItem::deserializeActionsInternal() {
|
||||||
serializedActionsStream >> serializedActions;
|
serializedActionsStream >> serializedActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep track of which actions got added or updated by the new actionData
|
||||||
QSet<QUuid> updated;
|
QSet<QUuid> updated;
|
||||||
|
|
||||||
foreach(QByteArray serializedAction, serializedActions) {
|
foreach(QByteArray serializedAction, serializedActions) {
|
||||||
|
@ -1720,9 +1720,11 @@ void EntityItem::setActionData(QByteArray actionData) {
|
||||||
|
|
||||||
void EntityItem::setActionDataInternal(QByteArray actionData) {
|
void EntityItem::setActionDataInternal(QByteArray actionData) {
|
||||||
assertWriteLocked();
|
assertWriteLocked();
|
||||||
|
if (_allActionsDataCache != actionData) {
|
||||||
|
_allActionsDataCache = actionData;
|
||||||
|
deserializeActionsInternal();
|
||||||
|
}
|
||||||
checkWaitingToRemove();
|
checkWaitingToRemove();
|
||||||
_allActionsDataCache = actionData;
|
|
||||||
deserializeActionsInternal();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItem::serializeActions(bool& success, QByteArray& result) const {
|
void EntityItem::serializeActions(bool& success, QByteArray& result) const {
|
||||||
|
@ -1788,3 +1790,15 @@ QVariantMap EntityItem::getActionArguments(const QUuid& actionID) const {
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EntityItem::shouldSuppressLocationEdits() const {
|
||||||
|
QHash<QUuid, EntityActionPointer>::const_iterator i = _objectActions.begin();
|
||||||
|
while (i != _objectActions.end()) {
|
||||||
|
if (i.value()->shouldSuppressLocationEdits()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -424,6 +424,7 @@ public:
|
||||||
QVariantMap getActionArguments(const QUuid& actionID) const;
|
QVariantMap getActionArguments(const QUuid& actionID) const;
|
||||||
void deserializeActions();
|
void deserializeActions();
|
||||||
void setActionDataDirty(bool value) const { _actionDataDirty = value; }
|
void setActionDataDirty(bool value) const { _actionDataDirty = value; }
|
||||||
|
bool shouldSuppressLocationEdits() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
@ -1519,3 +1519,254 @@ void EntityItemProperties::setSimulationOwner(const QByteArray& data) {
|
||||||
_simulationOwnerChanged = true;
|
_simulationOwnerChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<QString> EntityItemProperties::listChangedProperties() {
|
||||||
|
QList<QString> out;
|
||||||
|
if (containsPositionChange()) {
|
||||||
|
out += "posistion";
|
||||||
|
}
|
||||||
|
if (dimensionsChanged()) {
|
||||||
|
out += "dimensions";
|
||||||
|
}
|
||||||
|
if (velocityChanged()) {
|
||||||
|
out += "velocity";
|
||||||
|
}
|
||||||
|
if (nameChanged()) {
|
||||||
|
out += "name";
|
||||||
|
}
|
||||||
|
if (visibleChanged()) {
|
||||||
|
out += "visible";
|
||||||
|
}
|
||||||
|
if (rotationChanged()) {
|
||||||
|
out += "rotation";
|
||||||
|
}
|
||||||
|
if (densityChanged()) {
|
||||||
|
out += "density";
|
||||||
|
}
|
||||||
|
if (gravityChanged()) {
|
||||||
|
out += "gravity";
|
||||||
|
}
|
||||||
|
if (accelerationChanged()) {
|
||||||
|
out += "acceleration";
|
||||||
|
}
|
||||||
|
if (dampingChanged()) {
|
||||||
|
out += "damping";
|
||||||
|
}
|
||||||
|
if (restitutionChanged()) {
|
||||||
|
out += "restitution";
|
||||||
|
}
|
||||||
|
if (frictionChanged()) {
|
||||||
|
out += "friction";
|
||||||
|
}
|
||||||
|
if (lifetimeChanged()) {
|
||||||
|
out += "lifetime";
|
||||||
|
}
|
||||||
|
if (scriptChanged()) {
|
||||||
|
out += "script";
|
||||||
|
}
|
||||||
|
if (scriptTimestampChanged()) {
|
||||||
|
out += "scriptTimestamp";
|
||||||
|
}
|
||||||
|
if (collisionSoundURLChanged()) {
|
||||||
|
out += "collisionSoundURL";
|
||||||
|
}
|
||||||
|
if (colorChanged()) {
|
||||||
|
out += "color";
|
||||||
|
}
|
||||||
|
if (colorSpreadChanged()) {
|
||||||
|
out += "colorSpread";
|
||||||
|
}
|
||||||
|
if (colorStartChanged()) {
|
||||||
|
out += "colorStart";
|
||||||
|
}
|
||||||
|
if (colorFinishChanged()) {
|
||||||
|
out += "colorFinish";
|
||||||
|
}
|
||||||
|
if (alphaChanged()) {
|
||||||
|
out += "alpha";
|
||||||
|
}
|
||||||
|
if (alphaSpreadChanged()) {
|
||||||
|
out += "alphaSpread";
|
||||||
|
}
|
||||||
|
if (alphaStartChanged()) {
|
||||||
|
out += "alphaStart";
|
||||||
|
}
|
||||||
|
if (alphaFinishChanged()) {
|
||||||
|
out += "alphaFinish";
|
||||||
|
}
|
||||||
|
if (modelURLChanged()) {
|
||||||
|
out += "modelURL";
|
||||||
|
}
|
||||||
|
if (compoundShapeURLChanged()) {
|
||||||
|
out += "compoundShapeURL";
|
||||||
|
}
|
||||||
|
if (registrationPointChanged()) {
|
||||||
|
out += "registrationPoint";
|
||||||
|
}
|
||||||
|
if (angularVelocityChanged()) {
|
||||||
|
out += "angularVelocity";
|
||||||
|
}
|
||||||
|
if (angularDampingChanged()) {
|
||||||
|
out += "angularDamping";
|
||||||
|
}
|
||||||
|
if (ignoreForCollisionsChanged()) {
|
||||||
|
out += "ignoreForCollisions";
|
||||||
|
}
|
||||||
|
if (collisionsWillMoveChanged()) {
|
||||||
|
out += "collisionsWillMove";
|
||||||
|
}
|
||||||
|
if (isSpotlightChanged()) {
|
||||||
|
out += "isSpotlight";
|
||||||
|
}
|
||||||
|
if (intensityChanged()) {
|
||||||
|
out += "intensity";
|
||||||
|
}
|
||||||
|
if (exponentChanged()) {
|
||||||
|
out += "exponent";
|
||||||
|
}
|
||||||
|
if (cutoffChanged()) {
|
||||||
|
out += "cutoff";
|
||||||
|
}
|
||||||
|
if (lockedChanged()) {
|
||||||
|
out += "locked";
|
||||||
|
}
|
||||||
|
if (texturesChanged()) {
|
||||||
|
out += "textures";
|
||||||
|
}
|
||||||
|
if (userDataChanged()) {
|
||||||
|
out += "userData";
|
||||||
|
}
|
||||||
|
if (simulationOwnerChanged()) {
|
||||||
|
out += "simulationOwner";
|
||||||
|
}
|
||||||
|
if (textChanged()) {
|
||||||
|
out += "text";
|
||||||
|
}
|
||||||
|
if (lineHeightChanged()) {
|
||||||
|
out += "lineHeight";
|
||||||
|
}
|
||||||
|
if (textColorChanged()) {
|
||||||
|
out += "textColor";
|
||||||
|
}
|
||||||
|
if (backgroundColorChanged()) {
|
||||||
|
out += "backgroundColor";
|
||||||
|
}
|
||||||
|
if (shapeTypeChanged()) {
|
||||||
|
out += "shapeType";
|
||||||
|
}
|
||||||
|
if (maxParticlesChanged()) {
|
||||||
|
out += "maxParticles";
|
||||||
|
}
|
||||||
|
if (lifespanChanged()) {
|
||||||
|
out += "lifespan";
|
||||||
|
}
|
||||||
|
if (isEmittingChanged()) {
|
||||||
|
out += "isEmitting";
|
||||||
|
}
|
||||||
|
if (emitRateChanged()) {
|
||||||
|
out += "emitRate";
|
||||||
|
}
|
||||||
|
if (emitSpeedChanged()) {
|
||||||
|
out += "emitSpeed";
|
||||||
|
}
|
||||||
|
if (speedSpreadChanged()) {
|
||||||
|
out += "speedSpread";
|
||||||
|
}
|
||||||
|
if (emitOrientationChanged()) {
|
||||||
|
out += "emitOrientation";
|
||||||
|
}
|
||||||
|
if (emitDimensionsChanged()) {
|
||||||
|
out += "emitDimensions";
|
||||||
|
}
|
||||||
|
if (emitRadiusStartChanged()) {
|
||||||
|
out += "emitRadiusStart";
|
||||||
|
}
|
||||||
|
if (polarStartChanged()) {
|
||||||
|
out += "polarStart";
|
||||||
|
}
|
||||||
|
if (polarFinishChanged()) {
|
||||||
|
out += "polarFinish";
|
||||||
|
}
|
||||||
|
if (azimuthStartChanged()) {
|
||||||
|
out += "azimuthStart";
|
||||||
|
}
|
||||||
|
if (azimuthFinishChanged()) {
|
||||||
|
out += "azimuthFinish";
|
||||||
|
}
|
||||||
|
if (emitAccelerationChanged()) {
|
||||||
|
out += "emitAcceleration";
|
||||||
|
}
|
||||||
|
if (accelerationSpreadChanged()) {
|
||||||
|
out += "accelerationSpread";
|
||||||
|
}
|
||||||
|
if (particleRadiusChanged()) {
|
||||||
|
out += "particleRadius";
|
||||||
|
}
|
||||||
|
if (radiusSpreadChanged()) {
|
||||||
|
out += "radiusSpread";
|
||||||
|
}
|
||||||
|
if (radiusStartChanged()) {
|
||||||
|
out += "radiusStart";
|
||||||
|
}
|
||||||
|
if (radiusFinishChanged()) {
|
||||||
|
out += "radiusFinish";
|
||||||
|
}
|
||||||
|
if (marketplaceIDChanged()) {
|
||||||
|
out += "marketplaceID";
|
||||||
|
}
|
||||||
|
if (backgroundModeChanged()) {
|
||||||
|
out += "backgroundMode";
|
||||||
|
}
|
||||||
|
if (voxelVolumeSizeChanged()) {
|
||||||
|
out += "voxelVolumeSize";
|
||||||
|
}
|
||||||
|
if (voxelDataChanged()) {
|
||||||
|
out += "voxelData";
|
||||||
|
}
|
||||||
|
if (voxelSurfaceStyleChanged()) {
|
||||||
|
out += "voxelSurfaceStyle";
|
||||||
|
}
|
||||||
|
if (hrefChanged()) {
|
||||||
|
out += "href";
|
||||||
|
}
|
||||||
|
if (descriptionChanged()) {
|
||||||
|
out += "description";
|
||||||
|
}
|
||||||
|
if (actionDataChanged()) {
|
||||||
|
out += "actionData";
|
||||||
|
}
|
||||||
|
if (xTextureURLChanged()) {
|
||||||
|
out += "xTextureURL";
|
||||||
|
}
|
||||||
|
if (yTextureURLChanged()) {
|
||||||
|
out += "yTextureURL";
|
||||||
|
}
|
||||||
|
if (zTextureURLChanged()) {
|
||||||
|
out += "zTextureURL";
|
||||||
|
}
|
||||||
|
if (xNNeighborIDChanged()) {
|
||||||
|
out += "xNNeighborID";
|
||||||
|
}
|
||||||
|
if (yNNeighborIDChanged()) {
|
||||||
|
out += "yNNeighborID";
|
||||||
|
}
|
||||||
|
if (zNNeighborIDChanged()) {
|
||||||
|
out += "zNNeighborID";
|
||||||
|
}
|
||||||
|
if (xPNeighborIDChanged()) {
|
||||||
|
out += "xPNeighborID";
|
||||||
|
}
|
||||||
|
if (yPNeighborIDChanged()) {
|
||||||
|
out += "yPNeighborID";
|
||||||
|
}
|
||||||
|
if (zPNeighborIDChanged()) {
|
||||||
|
out += "zPNeighborID";
|
||||||
|
}
|
||||||
|
|
||||||
|
getAnimation().listChangedProperties(out);
|
||||||
|
getAtmosphere().listChangedProperties(out);
|
||||||
|
getSkybox().listChangedProperties(out);
|
||||||
|
getStage().listChangedProperties(out);
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
|
@ -253,6 +253,8 @@ public:
|
||||||
|
|
||||||
void setActionDataDirty() { _actionDataChanged = true; }
|
void setActionDataDirty() { _actionDataChanged = true; }
|
||||||
|
|
||||||
|
QList<QString> listChangedProperties();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QUuid _id;
|
QUuid _id;
|
||||||
bool _idSet;
|
bool _idSet;
|
||||||
|
@ -370,7 +372,9 @@ inline QDebug operator<<(QDebug debug, const EntityItemProperties& properties) {
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, VoxelSurfaceStyle, voxelSurfaceStyle, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, VoxelSurfaceStyle, voxelSurfaceStyle, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Href, href, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Href, href, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Description, description, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Description, description, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, ActionData, actionData, "");
|
if (properties.actionDataChanged()) {
|
||||||
|
debug << " " << "actionData" << ":" << properties.getActionData().toHex() << "" << "\n";
|
||||||
|
}
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, XTextureURL, xTextureURL, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, XTextureURL, xTextureURL, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, YTextureURL, yTextureURL, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, YTextureURL, yTextureURL, "");
|
||||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, ZTextureURL, zTextureURL, "");
|
DEBUG_PROPERTY_IF_CHANGED(debug, properties, ZTextureURL, zTextureURL, "");
|
||||||
|
|
|
@ -613,6 +613,9 @@ int EntityTree::processEditPacketData(NLPacket& packet, const unsigned char* edi
|
||||||
qCDebug(entities) << "User [" << senderNode->getUUID() << "] editing entity. ID:" << entityItemID;
|
qCDebug(entities) << "User [" << senderNode->getUUID() << "] editing entity. ID:" << entityItemID;
|
||||||
qCDebug(entities) << " properties:" << properties;
|
qCDebug(entities) << " properties:" << properties;
|
||||||
}
|
}
|
||||||
|
if (wantTerseEditLogging()) {
|
||||||
|
qCDebug(entities) << "edit" << entityItemID.toString() << properties.listChangedProperties();
|
||||||
|
}
|
||||||
endLogging = usecTimestampNow();
|
endLogging = usecTimestampNow();
|
||||||
|
|
||||||
startUpdate = usecTimestampNow();
|
startUpdate = usecTimestampNow();
|
||||||
|
@ -638,6 +641,9 @@ int EntityTree::processEditPacketData(NLPacket& packet, const unsigned char* edi
|
||||||
<< newEntity->getEntityItemID();
|
<< newEntity->getEntityItemID();
|
||||||
qCDebug(entities) << " properties:" << properties;
|
qCDebug(entities) << " properties:" << properties;
|
||||||
}
|
}
|
||||||
|
if (wantTerseEditLogging()) {
|
||||||
|
qCDebug(entities) << "add" << entityItemID.toString() << properties.listChangedProperties();
|
||||||
|
}
|
||||||
endLogging = usecTimestampNow();
|
endLogging = usecTimestampNow();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -869,7 +875,7 @@ int EntityTree::processEraseMessage(NLPacket& packet, const SharedNodePointer& s
|
||||||
EntityItemID entityItemID(entityID);
|
EntityItemID entityItemID(entityID);
|
||||||
entityItemIDsToDelete << entityItemID;
|
entityItemIDsToDelete << entityItemID;
|
||||||
|
|
||||||
if (wantEditLogging()) {
|
if (wantEditLogging() || wantTerseEditLogging()) {
|
||||||
qCDebug(entities) << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID;
|
qCDebug(entities) << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,7 +919,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
|
||||||
EntityItemID entityItemID(entityID);
|
EntityItemID entityItemID(entityID);
|
||||||
entityItemIDsToDelete << entityItemID;
|
entityItemIDsToDelete << entityItemID;
|
||||||
|
|
||||||
if (wantEditLogging()) {
|
if (wantEditLogging() || wantTerseEditLogging()) {
|
||||||
qCDebug(entities) << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID;
|
qCDebug(entities) << "User [" << sourceNode->getUUID() << "] deleting entity. ID:" << entityItemID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,9 @@ public:
|
||||||
bool wantEditLogging() const { return _wantEditLogging; }
|
bool wantEditLogging() const { return _wantEditLogging; }
|
||||||
void setWantEditLogging(bool value) { _wantEditLogging = value; }
|
void setWantEditLogging(bool value) { _wantEditLogging = value; }
|
||||||
|
|
||||||
|
bool wantTerseEditLogging() const { return _wantTerseEditLogging; }
|
||||||
|
void setWantTerseEditLogging(bool value) { _wantTerseEditLogging = value; }
|
||||||
|
|
||||||
bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues);
|
bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues);
|
||||||
bool readFromMap(QVariantMap& entityDescription);
|
bool readFromMap(QVariantMap& entityDescription);
|
||||||
|
|
||||||
|
@ -240,6 +243,7 @@ private:
|
||||||
EntitySimulation* _simulation;
|
EntitySimulation* _simulation;
|
||||||
|
|
||||||
bool _wantEditLogging = false;
|
bool _wantEditLogging = false;
|
||||||
|
bool _wantTerseEditLogging = false;
|
||||||
void maybeNotifyNewCollisionSoundURL(const QString& oldCollisionSoundURL, const QString& newCollisionSoundURL);
|
void maybeNotifyNewCollisionSoundURL(const QString& oldCollisionSoundURL, const QString& newCollisionSoundURL);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ public:
|
||||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const = 0;
|
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const = 0;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) = 0;
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) = 0;
|
||||||
virtual void debugDump() const { }
|
virtual void debugDump() const { }
|
||||||
|
virtual void listChangedProperties(QList<QString>& out) { }
|
||||||
|
|
||||||
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
|
|
|
@ -33,6 +33,15 @@ void SkyboxPropertyGroup::debugDump() const {
|
||||||
qDebug() << " URL:" << getURL() << " has changed:" << urlChanged();
|
qDebug() << " URL:" << getURL() << " has changed:" << urlChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SkyboxPropertyGroup::listChangedProperties(QList<QString>& out) {
|
||||||
|
if (colorChanged()) {
|
||||||
|
out << "skybox-color";
|
||||||
|
}
|
||||||
|
if (urlChanged()) {
|
||||||
|
out << "skybox-url";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool SkyboxPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
bool SkyboxPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
EntityPropertyFlags& propertyFlags,
|
EntityPropertyFlags& propertyFlags,
|
||||||
|
|
|
@ -33,6 +33,7 @@ public:
|
||||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
||||||
virtual void debugDump() const;
|
virtual void debugDump() const;
|
||||||
|
virtual void listChangedProperties(QList<QString>& out);
|
||||||
|
|
||||||
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
|
|
|
@ -66,6 +66,27 @@ void StagePropertyGroup::debugDump() const {
|
||||||
qDebug() << " _automaticHourDay:" << _automaticHourDay;
|
qDebug() << " _automaticHourDay:" << _automaticHourDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StagePropertyGroup::listChangedProperties(QList<QString>& out) {
|
||||||
|
if (sunModelEnabledChanged()) {
|
||||||
|
out << "stage-sunModelEnabled";
|
||||||
|
}
|
||||||
|
if (latitudeChanged()) {
|
||||||
|
out << "stage-latitude";
|
||||||
|
}
|
||||||
|
if (altitudeChanged()) {
|
||||||
|
out << "stage-altitude";
|
||||||
|
}
|
||||||
|
if (dayChanged()) {
|
||||||
|
out << "stage-day";
|
||||||
|
}
|
||||||
|
if (hourChanged()) {
|
||||||
|
out << "stage-hour";
|
||||||
|
}
|
||||||
|
if (automaticHourDayChanged()) {
|
||||||
|
out << "stage-automaticHourDay";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool StagePropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
bool StagePropertyGroup::appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
EntityPropertyFlags& propertyFlags,
|
EntityPropertyFlags& propertyFlags,
|
||||||
|
|
|
@ -33,6 +33,7 @@ public:
|
||||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
||||||
virtual void debugDump() const;
|
virtual void debugDump() const;
|
||||||
|
virtual void listChangedProperties(QList<QString>& out);
|
||||||
|
|
||||||
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
virtual bool appendToEditPacket(OctreePacketData* packetData,
|
||||||
EntityPropertyFlags& requestedProperties,
|
EntityPropertyFlags& requestedProperties,
|
||||||
|
|
|
@ -291,6 +291,10 @@ bool EntityMotionState::remoteSimulationOutOfSync(uint32_t simulationStep) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_entity->shouldSuppressLocationEdits()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Else we measure the error between current and extrapolated transform (according to expected behavior
|
// Else we measure the error between current and extrapolated transform (according to expected behavior
|
||||||
// of remote EntitySimulation) and return true if the error is significant.
|
// of remote EntitySimulation) and return true if the error is significant.
|
||||||
|
|
||||||
|
|
|
@ -24,20 +24,33 @@ ObjectAction::~ObjectAction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep) {
|
void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar deltaTimeStep) {
|
||||||
if (_ownerEntity.expired()) {
|
bool ownerEntityExpired = false;
|
||||||
|
quint64 expiresWhen = 0;
|
||||||
|
|
||||||
|
withReadLock([&]{
|
||||||
|
ownerEntityExpired = _ownerEntity.expired();
|
||||||
|
expiresWhen = _expires;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (ownerEntityExpired) {
|
||||||
qDebug() << "warning -- action with no entity removing self from btCollisionWorld.";
|
qDebug() << "warning -- action with no entity removing self from btCollisionWorld.";
|
||||||
btDynamicsWorld* dynamicsWorld = static_cast<btDynamicsWorld*>(collisionWorld);
|
btDynamicsWorld* dynamicsWorld = static_cast<btDynamicsWorld*>(collisionWorld);
|
||||||
dynamicsWorld->removeAction(this);
|
dynamicsWorld->removeAction(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_expires > 0) {
|
if (expiresWhen > 0) {
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
if (now > _expires) {
|
if (now > expiresWhen) {
|
||||||
EntityItemPointer ownerEntity = _ownerEntity.lock();
|
EntityItemPointer ownerEntity = nullptr;
|
||||||
_active = false;
|
QUuid myID;
|
||||||
|
withWriteLock([&]{
|
||||||
|
ownerEntity = _ownerEntity.lock();
|
||||||
|
_active = false;
|
||||||
|
myID = getID();
|
||||||
|
});
|
||||||
if (ownerEntity) {
|
if (ownerEntity) {
|
||||||
ownerEntity->removeAction(nullptr, getID());
|
ownerEntity->removeAction(nullptr, myID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,35 +63,48 @@ void ObjectAction::updateAction(btCollisionWorld* collisionWorld, btScalar delta
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ObjectAction::updateArguments(QVariantMap arguments) {
|
bool ObjectAction::updateArguments(QVariantMap arguments) {
|
||||||
bool lifetimeSet = true;
|
bool somethingChanged = false;
|
||||||
float lifetime = EntityActionInterface::extractFloatArgument("action", arguments, "lifetime", lifetimeSet, false);
|
|
||||||
if (lifetimeSet) {
|
|
||||||
quint64 now = usecTimestampNow();
|
|
||||||
_expires = now + (quint64)(lifetime * USECS_PER_SECOND);
|
|
||||||
} else {
|
|
||||||
_expires = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool tagSet = true;
|
withWriteLock([&]{
|
||||||
QString tag = EntityActionInterface::extractStringArgument("action", arguments, "tag", tagSet, false);
|
quint64 previousExpires = _expires;
|
||||||
if (tagSet) {
|
QString previousTag = _tag;
|
||||||
_tag = tag;
|
|
||||||
} else {
|
|
||||||
tag = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
bool lifetimeSet = true;
|
||||||
|
float lifetime = EntityActionInterface::extractFloatArgument("action", arguments, "lifetime", lifetimeSet, false);
|
||||||
|
if (lifetimeSet) {
|
||||||
|
quint64 now = usecTimestampNow();
|
||||||
|
_expires = now + (quint64)(lifetime * USECS_PER_SECOND);
|
||||||
|
} else {
|
||||||
|
_expires = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool tagSet = true;
|
||||||
|
QString tag = EntityActionInterface::extractStringArgument("action", arguments, "tag", tagSet, false);
|
||||||
|
if (tagSet) {
|
||||||
|
_tag = tag;
|
||||||
|
} else {
|
||||||
|
tag = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (previousExpires != _expires || previousTag != _tag) {
|
||||||
|
somethingChanged = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap ObjectAction::getArguments() {
|
QVariantMap ObjectAction::getArguments() {
|
||||||
QVariantMap arguments;
|
QVariantMap arguments;
|
||||||
if (_expires == 0) {
|
withReadLock([&]{
|
||||||
arguments["lifetime"] = 0.0f;
|
if (_expires == 0) {
|
||||||
} else {
|
arguments["lifetime"] = 0.0f;
|
||||||
quint64 now = usecTimestampNow();
|
} else {
|
||||||
arguments["lifetime"] = (float)(_expires - now) / (float)USECS_PER_SECOND;
|
quint64 now = usecTimestampNow();
|
||||||
}
|
arguments["lifetime"] = (float)(_expires - now) / (float)USECS_PER_SECOND;
|
||||||
arguments["tag"] = _tag;
|
}
|
||||||
|
arguments["tag"] = _tag;
|
||||||
|
});
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,20 +113,30 @@ void ObjectAction::debugDraw(btIDebugDraw* debugDrawer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectAction::removeFromSimulation(EntitySimulation* simulation) const {
|
void ObjectAction::removeFromSimulation(EntitySimulation* simulation) const {
|
||||||
simulation->removeAction(_id);
|
QUuid myID;
|
||||||
|
withReadLock([&]{
|
||||||
|
myID = _id;
|
||||||
|
});
|
||||||
|
simulation->removeAction(myID);
|
||||||
}
|
}
|
||||||
|
|
||||||
btRigidBody* ObjectAction::getRigidBody() {
|
btRigidBody* ObjectAction::getRigidBody() {
|
||||||
auto ownerEntity = _ownerEntity.lock();
|
ObjectMotionState* motionState = nullptr;
|
||||||
if (!ownerEntity) {
|
withReadLock([&]{
|
||||||
return nullptr;
|
auto ownerEntity = _ownerEntity.lock();
|
||||||
|
if (!ownerEntity) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void* physicsInfo = ownerEntity->getPhysicsInfo();
|
||||||
|
if (!physicsInfo) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
motionState = static_cast<ObjectMotionState*>(physicsInfo);
|
||||||
|
});
|
||||||
|
if (motionState) {
|
||||||
|
return motionState->getRigidBody();
|
||||||
}
|
}
|
||||||
void* physicsInfo = ownerEntity->getPhysicsInfo();
|
return nullptr;
|
||||||
if (!physicsInfo) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
ObjectMotionState* motionState = static_cast<ObjectMotionState*>(physicsInfo);
|
|
||||||
return motionState->getRigidBody();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 ObjectAction::getPosition() {
|
glm::vec3 ObjectAction::getPosition() {
|
||||||
|
|
|
@ -80,44 +80,61 @@ void ObjectActionOffset::updateActionWorker(btScalar deltaTimeStep) {
|
||||||
|
|
||||||
|
|
||||||
bool ObjectActionOffset::updateArguments(QVariantMap arguments) {
|
bool ObjectActionOffset::updateArguments(QVariantMap arguments) {
|
||||||
if (!ObjectAction::updateArguments(arguments)) {
|
glm::vec3 pointToOffsetFrom;
|
||||||
return false;
|
float linearTimeScale;
|
||||||
}
|
float linearDistance;
|
||||||
bool ok = true;
|
|
||||||
glm::vec3 pointToOffsetFrom =
|
|
||||||
EntityActionInterface::extractVec3Argument("offset action", arguments, "pointToOffsetFrom", ok, true);
|
|
||||||
if (!ok) {
|
|
||||||
pointToOffsetFrom = _pointToOffsetFrom;
|
|
||||||
}
|
|
||||||
|
|
||||||
ok = true;
|
bool needUpdate = false;
|
||||||
float linearTimeScale =
|
bool somethingChanged = ObjectAction::updateArguments(arguments);
|
||||||
EntityActionInterface::extractFloatArgument("offset action", arguments, "linearTimeScale", ok, false);
|
|
||||||
if (!ok) {
|
|
||||||
linearTimeScale = _linearTimeScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
ok = true;
|
withReadLock([&]{
|
||||||
float linearDistance =
|
bool ok = true;
|
||||||
EntityActionInterface::extractFloatArgument("offset action", arguments, "linearDistance", ok, false);
|
pointToOffsetFrom =
|
||||||
if (!ok) {
|
EntityActionInterface::extractVec3Argument("offset action", arguments, "pointToOffsetFrom", ok, true);
|
||||||
linearDistance = _linearDistance;
|
if (!ok) {
|
||||||
}
|
pointToOffsetFrom = _pointToOffsetFrom;
|
||||||
|
}
|
||||||
|
|
||||||
// only change stuff if something actually changed
|
ok = true;
|
||||||
if (_pointToOffsetFrom != pointToOffsetFrom
|
linearTimeScale =
|
||||||
|| _linearTimeScale != linearTimeScale
|
EntityActionInterface::extractFloatArgument("offset action", arguments, "linearTimeScale", ok, false);
|
||||||
|| _linearDistance != linearDistance) {
|
if (!ok) {
|
||||||
|
linearTimeScale = _linearTimeScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
ok = true;
|
||||||
|
linearDistance =
|
||||||
|
EntityActionInterface::extractFloatArgument("offset action", arguments, "linearDistance", ok, false);
|
||||||
|
if (!ok) {
|
||||||
|
linearDistance = _linearDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
// only change stuff if something actually changed
|
||||||
|
if (somethingChanged ||
|
||||||
|
_pointToOffsetFrom != pointToOffsetFrom ||
|
||||||
|
_linearTimeScale != linearTimeScale ||
|
||||||
|
_linearDistance != linearDistance) {
|
||||||
|
needUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if (needUpdate) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_pointToOffsetFrom = pointToOffsetFrom;
|
_pointToOffsetFrom = pointToOffsetFrom;
|
||||||
_linearTimeScale = linearTimeScale;
|
_linearTimeScale = linearTimeScale;
|
||||||
_linearDistance = linearDistance;
|
_linearDistance = linearDistance;
|
||||||
_positionalTargetSet = true;
|
_positionalTargetSet = true;
|
||||||
_active = true;
|
_active = true;
|
||||||
activateBody();
|
|
||||||
|
auto ownerEntity = _ownerEntity.lock();
|
||||||
|
if (ownerEntity) {
|
||||||
|
ownerEntity->setActionDataDirty(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
activateBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,17 +151,18 @@ QVariantMap ObjectActionOffset::getArguments() {
|
||||||
QByteArray ObjectActionOffset::serialize() const {
|
QByteArray ObjectActionOffset::serialize() const {
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
QDataStream dataStream(&ba, QIODevice::WriteOnly);
|
QDataStream dataStream(&ba, QIODevice::WriteOnly);
|
||||||
dataStream << getType();
|
dataStream << ACTION_TYPE_OFFSET;
|
||||||
dataStream << getID();
|
dataStream << getID();
|
||||||
dataStream << ObjectActionOffset::offsetVersion;
|
dataStream << ObjectActionOffset::offsetVersion;
|
||||||
|
|
||||||
dataStream << _pointToOffsetFrom;
|
withReadLock([&] {
|
||||||
dataStream << _linearDistance;
|
dataStream << _pointToOffsetFrom;
|
||||||
dataStream << _linearTimeScale;
|
dataStream << _linearDistance;
|
||||||
dataStream << _positionalTargetSet;
|
dataStream << _linearTimeScale;
|
||||||
|
dataStream << _positionalTargetSet;
|
||||||
dataStream << _expires;
|
dataStream << _expires;
|
||||||
dataStream << _tag;
|
dataStream << _tag;
|
||||||
|
});
|
||||||
|
|
||||||
return ba;
|
return ba;
|
||||||
}
|
}
|
||||||
|
@ -166,13 +184,13 @@ void ObjectActionOffset::deserialize(QByteArray serializedArguments) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataStream >> _pointToOffsetFrom;
|
withWriteLock([&] {
|
||||||
dataStream >> _linearDistance;
|
dataStream >> _pointToOffsetFrom;
|
||||||
dataStream >> _linearTimeScale;
|
dataStream >> _linearDistance;
|
||||||
dataStream >> _positionalTargetSet;
|
dataStream >> _linearTimeScale;
|
||||||
|
dataStream >> _positionalTargetSet;
|
||||||
dataStream >> _expires;
|
dataStream >> _expires;
|
||||||
dataStream >> _tag;
|
dataStream >> _tag;
|
||||||
|
_active = true;
|
||||||
_active = true;
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ ObjectActionSpring::~ObjectActionSpring() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) {
|
void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) {
|
||||||
|
// don't risk hanging the thread running the physics simulation
|
||||||
auto lockResult = withTryReadLock([&]{
|
auto lockResult = withTryReadLock([&]{
|
||||||
auto ownerEntity = _ownerEntity.lock();
|
auto ownerEntity = _ownerEntity.lock();
|
||||||
if (!ownerEntity) {
|
if (!ownerEntity) {
|
||||||
|
@ -100,60 +101,73 @@ void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!lockResult) {
|
if (!lockResult) {
|
||||||
// don't risk hanging the thread running the physics simulation
|
|
||||||
qDebug() << "ObjectActionSpring::updateActionWorker lock failed";
|
qDebug() << "ObjectActionSpring::updateActionWorker lock failed";
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const float MIN_TIMESCALE = 0.1f;
|
const float MIN_TIMESCALE = 0.1f;
|
||||||
|
|
||||||
|
|
||||||
bool ObjectActionSpring::updateArguments(QVariantMap arguments) {
|
bool ObjectActionSpring::updateArguments(QVariantMap arguments) {
|
||||||
if (!ObjectAction::updateArguments(arguments)) {
|
glm::vec3 positionalTarget;
|
||||||
return false;
|
float linearTimeScale;
|
||||||
}
|
glm::quat rotationalTarget;
|
||||||
// targets are required, spring-constants are optional
|
float angularTimeScale;
|
||||||
bool ok = true;
|
|
||||||
glm::vec3 positionalTarget =
|
|
||||||
EntityActionInterface::extractVec3Argument("spring action", arguments, "targetPosition", ok, false);
|
|
||||||
if (!ok) {
|
|
||||||
positionalTarget = _positionalTarget;
|
|
||||||
}
|
|
||||||
ok = true;
|
|
||||||
float linearTimeScale =
|
|
||||||
EntityActionInterface::extractFloatArgument("spring action", arguments, "linearTimeScale", ok, false);
|
|
||||||
if (!ok || linearTimeScale <= 0.0f) {
|
|
||||||
linearTimeScale = _linearTimeScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
ok = true;
|
bool needUpdate = false;
|
||||||
glm::quat rotationalTarget =
|
bool somethingChanged = ObjectAction::updateArguments(arguments);
|
||||||
EntityActionInterface::extractQuatArgument("spring action", arguments, "targetRotation", ok, false);
|
withReadLock([&]{
|
||||||
if (!ok) {
|
// targets are required, spring-constants are optional
|
||||||
rotationalTarget = _rotationalTarget;
|
bool ok = true;
|
||||||
}
|
positionalTarget = EntityActionInterface::extractVec3Argument("spring action", arguments, "targetPosition", ok, false);
|
||||||
|
if (!ok) {
|
||||||
|
positionalTarget = _positionalTarget;
|
||||||
|
}
|
||||||
|
ok = true;
|
||||||
|
linearTimeScale = EntityActionInterface::extractFloatArgument("spring action", arguments, "linearTimeScale", ok, false);
|
||||||
|
if (!ok || linearTimeScale <= 0.0f) {
|
||||||
|
linearTimeScale = _linearTimeScale;
|
||||||
|
}
|
||||||
|
|
||||||
ok = true;
|
ok = true;
|
||||||
float angularTimeScale =
|
rotationalTarget = EntityActionInterface::extractQuatArgument("spring action", arguments, "targetRotation", ok, false);
|
||||||
EntityActionInterface::extractFloatArgument("spring action", arguments, "angularTimeScale", ok, false);
|
if (!ok) {
|
||||||
if (!ok) {
|
rotationalTarget = _rotationalTarget;
|
||||||
angularTimeScale = _angularTimeScale;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (positionalTarget != _positionalTarget
|
ok = true;
|
||||||
|| linearTimeScale != _linearTimeScale
|
angularTimeScale =
|
||||||
|| rotationalTarget != _rotationalTarget
|
EntityActionInterface::extractFloatArgument("spring action", arguments, "angularTimeScale", ok, false);
|
||||||
|| angularTimeScale != _angularTimeScale) {
|
if (!ok) {
|
||||||
// something changed
|
angularTimeScale = _angularTimeScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (somethingChanged ||
|
||||||
|
positionalTarget != _positionalTarget ||
|
||||||
|
linearTimeScale != _linearTimeScale ||
|
||||||
|
rotationalTarget != _rotationalTarget ||
|
||||||
|
angularTimeScale != _angularTimeScale) {
|
||||||
|
// something changed
|
||||||
|
needUpdate = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (needUpdate) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_positionalTarget = positionalTarget;
|
_positionalTarget = positionalTarget;
|
||||||
_linearTimeScale = glm::max(MIN_TIMESCALE, glm::abs(linearTimeScale));
|
_linearTimeScale = glm::max(MIN_TIMESCALE, glm::abs(linearTimeScale));
|
||||||
_rotationalTarget = rotationalTarget;
|
_rotationalTarget = rotationalTarget;
|
||||||
_angularTimeScale = glm::max(MIN_TIMESCALE, glm::abs(angularTimeScale));
|
_angularTimeScale = glm::max(MIN_TIMESCALE, glm::abs(angularTimeScale));
|
||||||
_active = true;
|
_active = true;
|
||||||
activateBody();
|
|
||||||
|
auto ownerEntity = _ownerEntity.lock();
|
||||||
|
if (ownerEntity) {
|
||||||
|
ownerEntity->setActionDataDirty(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
activateBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,16 +191,16 @@ QByteArray ObjectActionSpring::serialize() const {
|
||||||
dataStream << getID();
|
dataStream << getID();
|
||||||
dataStream << ObjectActionSpring::springVersion;
|
dataStream << ObjectActionSpring::springVersion;
|
||||||
|
|
||||||
dataStream << _positionalTarget;
|
withReadLock([&] {
|
||||||
dataStream << _linearTimeScale;
|
dataStream << _positionalTarget;
|
||||||
dataStream << _positionalTargetSet;
|
dataStream << _linearTimeScale;
|
||||||
|
dataStream << _positionalTargetSet;
|
||||||
dataStream << _rotationalTarget;
|
dataStream << _rotationalTarget;
|
||||||
dataStream << _angularTimeScale;
|
dataStream << _angularTimeScale;
|
||||||
dataStream << _rotationalTargetSet;
|
dataStream << _rotationalTargetSet;
|
||||||
|
dataStream << _expires;
|
||||||
dataStream << _expires;
|
dataStream << _tag;
|
||||||
dataStream << _tag;
|
});
|
||||||
|
|
||||||
return serializedActionArguments;
|
return serializedActionArguments;
|
||||||
}
|
}
|
||||||
|
@ -205,19 +219,22 @@ void ObjectActionSpring::deserialize(QByteArray serializedArguments) {
|
||||||
uint16_t serializationVersion;
|
uint16_t serializationVersion;
|
||||||
dataStream >> serializationVersion;
|
dataStream >> serializationVersion;
|
||||||
if (serializationVersion != ObjectActionSpring::springVersion) {
|
if (serializationVersion != ObjectActionSpring::springVersion) {
|
||||||
|
assert(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataStream >> _positionalTarget;
|
withWriteLock([&] {
|
||||||
dataStream >> _linearTimeScale;
|
dataStream >> _positionalTarget;
|
||||||
dataStream >> _positionalTargetSet;
|
dataStream >> _linearTimeScale;
|
||||||
|
dataStream >> _positionalTargetSet;
|
||||||
|
|
||||||
dataStream >> _rotationalTarget;
|
dataStream >> _rotationalTarget;
|
||||||
dataStream >> _angularTimeScale;
|
dataStream >> _angularTimeScale;
|
||||||
dataStream >> _rotationalTargetSet;
|
dataStream >> _rotationalTargetSet;
|
||||||
|
|
||||||
dataStream >> _expires;
|
dataStream >> _expires;
|
||||||
dataStream >> _tag;
|
dataStream >> _tag;
|
||||||
|
|
||||||
_active = true;
|
_active = true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue