mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into mouse_pick_in_oculus
This commit is contained in:
commit
36eecf1d15
5 changed files with 30 additions and 19 deletions
|
@ -49,6 +49,7 @@ public:
|
||||||
DIRTY_MOTION_TYPE = 0x0010,
|
DIRTY_MOTION_TYPE = 0x0010,
|
||||||
DIRTY_SHAPE = 0x0020,
|
DIRTY_SHAPE = 0x0020,
|
||||||
DIRTY_LIFETIME = 0x0040,
|
DIRTY_LIFETIME = 0x0040,
|
||||||
|
DIRTY_UPDATEABLE = 0x0080,
|
||||||
// add new simulation-relevant flags above
|
// add new simulation-relevant flags above
|
||||||
// all other flags below
|
// all other flags below
|
||||||
DIRTY_SCRIPT = 0x8000
|
DIRTY_SCRIPT = 0x8000
|
||||||
|
@ -130,7 +131,7 @@ public:
|
||||||
// perform linear extrapolation for SimpleEntitySimulation
|
// perform linear extrapolation for SimpleEntitySimulation
|
||||||
void simulate(const quint64& now);
|
void simulate(const quint64& now);
|
||||||
|
|
||||||
bool needsToCallUpdate() const { return false; }
|
virtual bool needsToCallUpdate() const { return false; }
|
||||||
|
|
||||||
virtual void debugDump() const;
|
virtual void debugDump() const;
|
||||||
|
|
||||||
|
|
|
@ -397,6 +397,11 @@ void ModelEntityItem::debugDump() const {
|
||||||
qDebug() << " model URL:" << getModelURL();
|
qDebug() << " model URL:" << getModelURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ModelEntityItem::setAnimationURL(const QString& url) {
|
||||||
|
_dirtyFlags |= EntityItem::DIRTY_UPDATEABLE;
|
||||||
|
_animationURL = url;
|
||||||
|
}
|
||||||
|
|
||||||
void ModelEntityItem::setAnimationSettings(const QString& value) {
|
void ModelEntityItem::setAnimationSettings(const QString& value) {
|
||||||
// the animations setting is a JSON string that may contain various animation settings.
|
// the animations setting is a JSON string that may contain various animation settings.
|
||||||
// if it includes fps, frameIndex, or running, those values will be parsed out and
|
// if it includes fps, frameIndex, or running, those values will be parsed out and
|
||||||
|
@ -448,6 +453,17 @@ void ModelEntityItem::setAnimationSettings(const QString& value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_animationSettings = value;
|
_animationSettings = value;
|
||||||
|
_dirtyFlags |= EntityItem::DIRTY_UPDATEABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModelEntityItem::setAnimationIsPlaying(bool value) {
|
||||||
|
_dirtyFlags |= EntityItem::DIRTY_UPDATEABLE;
|
||||||
|
_animationLoop.setRunning(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModelEntityItem::setAnimationFPS(float value) {
|
||||||
|
_dirtyFlags |= EntityItem::DIRTY_UPDATEABLE;
|
||||||
|
_animationLoop.setFPS(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelEntityItem::getAnimationSettings() const {
|
QString ModelEntityItem::getAnimationSettings() const {
|
||||||
|
|
|
@ -73,16 +73,16 @@ public:
|
||||||
|
|
||||||
// model related properties
|
// model related properties
|
||||||
void setModelURL(const QString& url) { _modelURL = url; }
|
void setModelURL(const QString& url) { _modelURL = url; }
|
||||||
void setAnimationURL(const QString& url) { _animationURL = url; }
|
void setAnimationURL(const QString& url);
|
||||||
static const float DEFAULT_ANIMATION_FRAME_INDEX;
|
static const float DEFAULT_ANIMATION_FRAME_INDEX;
|
||||||
void setAnimationFrameIndex(float value) { _animationLoop.setFrameIndex(value); }
|
void setAnimationFrameIndex(float value) { _animationLoop.setFrameIndex(value); }
|
||||||
void setAnimationSettings(const QString& value);
|
void setAnimationSettings(const QString& value);
|
||||||
|
|
||||||
static const bool DEFAULT_ANIMATION_IS_PLAYING;
|
static const bool DEFAULT_ANIMATION_IS_PLAYING;
|
||||||
void setAnimationIsPlaying(bool value) { _animationLoop.setRunning(value); }
|
void setAnimationIsPlaying(bool value);
|
||||||
|
|
||||||
static const float DEFAULT_ANIMATION_FPS;
|
static const float DEFAULT_ANIMATION_FPS;
|
||||||
void setAnimationFPS(float value) { _animationLoop.setFPS(value); }
|
void setAnimationFPS(float value);
|
||||||
|
|
||||||
void setAnimationLoop(bool loop) { _animationLoop.setLoop(loop); }
|
void setAnimationLoop(bool loop) { _animationLoop.setLoop(loop); }
|
||||||
bool getAnimationLoop() const { return _animationLoop.getLoop(); }
|
bool getAnimationLoop() const { return _animationLoop.getLoop(); }
|
||||||
|
|
|
@ -31,12 +31,10 @@ void SimpleEntitySimulation::updateEntitiesInternal(const quint64& now) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleEntitySimulation::addEntityInternal(EntityItem* entity) {
|
void SimpleEntitySimulation::addEntityInternal(EntityItem* entity) {
|
||||||
if (entity->getCollisionsWillMove()) {
|
if (entity->isMoving()) {
|
||||||
if (entity->isMoving()) {
|
_movingEntities.insert(entity);
|
||||||
_movingEntities.insert(entity);
|
} else if (entity->getCollisionsWillMove()) {
|
||||||
} else {
|
_movableButStoppedEntities.insert(entity);
|
||||||
_movableButStoppedEntities.insert(entity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,14 +48,10 @@ const int SIMPLE_SIMULATION_DIRTY_FLAGS = EntityItem::DIRTY_VELOCITY | EntityIte
|
||||||
void SimpleEntitySimulation::entityChangedInternal(EntityItem* entity) {
|
void SimpleEntitySimulation::entityChangedInternal(EntityItem* entity) {
|
||||||
int dirtyFlags = entity->getDirtyFlags();
|
int dirtyFlags = entity->getDirtyFlags();
|
||||||
if (dirtyFlags & SIMPLE_SIMULATION_DIRTY_FLAGS) {
|
if (dirtyFlags & SIMPLE_SIMULATION_DIRTY_FLAGS) {
|
||||||
if (entity->getCollisionsWillMove()) {
|
if (entity->isMoving()) {
|
||||||
if (entity->isMoving()) {
|
_movingEntities.insert(entity);
|
||||||
_movingEntities.insert(entity);
|
} else if (entity->getCollisionsWillMove()) {
|
||||||
_movableButStoppedEntities.remove(entity);
|
_movableButStoppedEntities.remove(entity);
|
||||||
} else {
|
|
||||||
_movingEntities.remove(entity);
|
|
||||||
_movableButStoppedEntities.insert(entity);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
_movingEntities.remove(entity);
|
_movingEntities.remove(entity);
|
||||||
_movableButStoppedEntities.remove(entity);
|
_movableButStoppedEntities.remove(entity);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "MetavoxelMessages.h"
|
#include "MetavoxelMessages.h"
|
||||||
|
|
||||||
// in sequencer parlance, a "packet" may consist of multiple datagrams. clarify when we refer to actual datagrams
|
// in sequencer parlance, a "packet" may consist of multiple datagrams. clarify when we refer to actual datagrams
|
||||||
const int MAX_DATAGRAM_SIZE = MAX_PACKET_SIZE;
|
const int MAX_DATAGRAM_SIZE = 1450;
|
||||||
|
|
||||||
const int DEFAULT_MAX_PACKET_SIZE = 3000;
|
const int DEFAULT_MAX_PACKET_SIZE = 3000;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue