mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Merge branch 'master' of github.com:highfidelity/hifi into polyvox
This commit is contained in:
commit
a91a7942a4
8 changed files with 28 additions and 16 deletions
|
@ -147,9 +147,9 @@ public:
|
|||
|
||||
Q_INVOKABLE glm::vec3 getNeckPosition() const;
|
||||
|
||||
Q_INVOKABLE const glm::vec3& getAcceleration() const { return _acceleration; }
|
||||
Q_INVOKABLE const glm::vec3& getAngularVelocity() const { return _angularVelocity; }
|
||||
Q_INVOKABLE const glm::vec3& getAngularAcceleration() const { return _angularAcceleration; }
|
||||
Q_INVOKABLE glm::vec3 getAcceleration() const { return _acceleration; }
|
||||
Q_INVOKABLE glm::vec3 getAngularVelocity() const { return _angularVelocity; }
|
||||
Q_INVOKABLE glm::vec3 getAngularAcceleration() const { return _angularAcceleration; }
|
||||
|
||||
|
||||
/// Scales a world space position vector relative to the avatar position and scale
|
||||
|
|
|
@ -123,17 +123,17 @@ glm::quat AvatarMotionState::getObjectRotation() const {
|
|||
}
|
||||
|
||||
// virtual
|
||||
const glm::vec3& AvatarMotionState::getObjectLinearVelocity() const {
|
||||
glm::vec3 AvatarMotionState::getObjectLinearVelocity() const {
|
||||
return _avatar->getVelocity();
|
||||
}
|
||||
|
||||
// virtual
|
||||
const glm::vec3& AvatarMotionState::getObjectAngularVelocity() const {
|
||||
glm::vec3 AvatarMotionState::getObjectAngularVelocity() const {
|
||||
return _avatar->getAngularVelocity();
|
||||
}
|
||||
|
||||
// virtual
|
||||
const glm::vec3& AvatarMotionState::getObjectGravity() const {
|
||||
glm::vec3 AvatarMotionState::getObjectGravity() const {
|
||||
return _avatar->getAcceleration();
|
||||
}
|
||||
|
||||
|
|
|
@ -48,9 +48,9 @@ public:
|
|||
|
||||
virtual glm::vec3 getObjectPosition() const;
|
||||
virtual glm::quat getObjectRotation() const;
|
||||
virtual const glm::vec3& getObjectLinearVelocity() const;
|
||||
virtual const glm::vec3& getObjectAngularVelocity() const;
|
||||
virtual const glm::vec3& getObjectGravity() const;
|
||||
virtual glm::vec3 getObjectLinearVelocity() const;
|
||||
virtual glm::vec3 getObjectAngularVelocity() const;
|
||||
virtual glm::vec3 getObjectGravity() const;
|
||||
|
||||
virtual const QUuid& getObjectID() const;
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ public:
|
|||
int getReceiveRate() const;
|
||||
|
||||
void setVelocity(const glm::vec3 velocity) { _velocity = velocity; }
|
||||
Q_INVOKABLE const glm::vec3& getVelocity() const { return _velocity; }
|
||||
Q_INVOKABLE glm::vec3 getVelocity() const { return _velocity; }
|
||||
const glm::vec3& getTargetVelocity() const { return _targetVelocity; }
|
||||
|
||||
bool shouldDie() const { return _owningAvatarMixer.isNull() || getUsecsSinceLastUpdate() > AVATAR_SILENCE_THRESHOLD_USECS; }
|
||||
|
|
|
@ -1109,6 +1109,17 @@ void EntityTreeRenderer::playEntityCollisionSound(const QUuid& myNodeID, EntityT
|
|||
return;
|
||||
}
|
||||
QUuid simulatorID = entity->getSimulatorID();
|
||||
if (simulatorID.isNull()) {
|
||||
// Can be null if it has never moved since being created or coming out of persistence.
|
||||
// However, for there to be a collission, one of the two objects must be moving.
|
||||
const EntityItemID& otherID = (id == collision.idA) ? collision.idB : collision.idA;
|
||||
EntityItemPointer otherEntity = entityTree->findEntityByEntityItemID(otherID);
|
||||
if (!otherEntity) {
|
||||
return;
|
||||
}
|
||||
simulatorID = otherEntity->getSimulatorID();
|
||||
}
|
||||
|
||||
if (simulatorID.isNull() || (simulatorID != myNodeID)) {
|
||||
return; // Only one injector per simulation, please.
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
|
|||
entity->setLastBroadcast(usecTimestampNow());
|
||||
// This Node is creating a new object. If it's in motion, set this Node as the simulator.
|
||||
bidForSimulationOwnership(propertiesWithSimID);
|
||||
entity->setSimulatorID(propertiesWithSimID.getSimulatorID()); // and make note of it now, so we can act on it right away.
|
||||
} else {
|
||||
qCDebug(entities) << "script failed to add new Entity to local Octree";
|
||||
success = false;
|
||||
|
|
|
@ -61,9 +61,9 @@ public:
|
|||
|
||||
virtual glm::vec3 getObjectPosition() const { return _entity->getPosition() - ObjectMotionState::getWorldOffset(); }
|
||||
virtual glm::quat getObjectRotation() const { return _entity->getRotation(); }
|
||||
virtual const glm::vec3& getObjectLinearVelocity() const { return _entity->getVelocity(); }
|
||||
virtual const glm::vec3& getObjectAngularVelocity() const { return _entity->getAngularVelocity(); }
|
||||
virtual const glm::vec3& getObjectGravity() const { return _entity->getGravity(); }
|
||||
virtual glm::vec3 getObjectLinearVelocity() const { return _entity->getVelocity(); }
|
||||
virtual glm::vec3 getObjectAngularVelocity() const { return _entity->getAngularVelocity(); }
|
||||
virtual glm::vec3 getObjectGravity() const { return _entity->getGravity(); }
|
||||
|
||||
virtual const QUuid& getObjectID() const { return _entity->getID(); }
|
||||
|
||||
|
|
|
@ -112,9 +112,9 @@ public:
|
|||
|
||||
virtual glm::vec3 getObjectPosition() const = 0;
|
||||
virtual glm::quat getObjectRotation() const = 0;
|
||||
virtual const glm::vec3& getObjectLinearVelocity() const = 0;
|
||||
virtual const glm::vec3& getObjectAngularVelocity() const = 0;
|
||||
virtual const glm::vec3& getObjectGravity() const = 0;
|
||||
virtual glm::vec3 getObjectLinearVelocity() const = 0;
|
||||
virtual glm::vec3 getObjectAngularVelocity() const = 0;
|
||||
virtual glm::vec3 getObjectGravity() const = 0;
|
||||
|
||||
virtual const QUuid& getObjectID() const = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue