mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-24 09:34:03 +02:00
Merge branch 'master' into fix/domain-threading-defaults
This commit is contained in:
commit
40219e6ff9
63 changed files with 346 additions and 353 deletions
8
BUILD.md
8
BUILD.md
|
@ -1,6 +1,6 @@
|
||||||
# General Build Information
|
# General Build Information
|
||||||
|
|
||||||
*Last Updated on June 27, 2020*
|
*Last Updated on August 26, 2020*
|
||||||
|
|
||||||
### OS Specific Build Guides
|
### OS Specific Build Guides
|
||||||
|
|
||||||
|
@ -80,12 +80,12 @@ Where /path/to/directory is the path to a directory where you wish the build fil
|
||||||
// The type of release.
|
// The type of release.
|
||||||
RELEASE_TYPE=PRODUCTION|PR|DEV
|
RELEASE_TYPE=PRODUCTION|PR|DEV
|
||||||
|
|
||||||
// TODO: What do these do?
|
// Determine the build type
|
||||||
PRODUCTION_BUILD=0|1
|
PRODUCTION_BUILD=0|1
|
||||||
PR_BUILD=0|1
|
PR_BUILD=0|1
|
||||||
STABLE_BUILD=0|1
|
STABLE_BUILD=0|1
|
||||||
|
|
||||||
// TODO: What do these do?
|
// Determine if to utilize testing or stable Metaverse URLs
|
||||||
USE_STABLE_GLOBAL_SERVICES=1
|
USE_STABLE_GLOBAL_SERVICES=1
|
||||||
BUILD_GLOBAL_SERVICES=STABLE
|
BUILD_GLOBAL_SERVICES=STABLE
|
||||||
|
|
||||||
|
@ -141,6 +141,8 @@ The following build options can be used when running CMake
|
||||||
* BUILD_SERVER
|
* BUILD_SERVER
|
||||||
* BUILD_TESTS
|
* BUILD_TESTS
|
||||||
* BUILD_TOOLS
|
* BUILD_TOOLS
|
||||||
|
* CLIENT_ONLY // Will package only the Interface
|
||||||
|
* SERVER_ONLY // Will package only the Server
|
||||||
|
|
||||||
#### Developer Build Options
|
#### Developer Build Options
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Use default time server if none defined in environment
|
# Use default time server if none defined in environment
|
||||||
set_from_env(TIMESERVER_URL TIMESERVER_URL "http://sha256timestamp.ws.symantec.com/sha256/timestamp")
|
set_from_env(TIMESERVER_URL TIMESERVER_URL "http://timestamp.comodoca.com?td=sha256")
|
||||||
|
|
||||||
set(HIFI_USE_OPTIMIZED_IK_OPTION OFF)
|
set(HIFI_USE_OPTIMIZED_IK_OPTION OFF)
|
||||||
set(BUILD_CLIENT_OPTION ON)
|
set(BUILD_CLIENT_OPTION ON)
|
||||||
|
|
|
@ -199,18 +199,15 @@
|
||||||
|
|
||||||
!system "$%TEMP%\tempinstaller.exe" = 2
|
!system "$%TEMP%\tempinstaller.exe" = 2
|
||||||
|
|
||||||
; NOTE: We're not code signing right now, so we're going to disable that.
|
|
||||||
; TODO: Get a code signing certificate so we can re-enable code signing.
|
|
||||||
|
|
||||||
; The Inner invocation has written an uninstaller binary for us.
|
; The Inner invocation has written an uninstaller binary for us.
|
||||||
; We need to sign it if it's a production or PR build.
|
; We need to sign it if it's a production or PR build.
|
||||||
; !if @PRODUCTION_BUILD@ == 1
|
!if @PRODUCTION_BUILD@ == 1
|
||||||
; !if @BYPASS_SIGNING@ == 1
|
!if @BYPASS_SIGNING@ == 1
|
||||||
; !warning "BYPASS_SIGNING set - installer will not be signed"
|
!warning "BYPASS_SIGNING set - installer will not be signed"
|
||||||
; !else
|
!else
|
||||||
; !system '"@SIGNTOOL_EXECUTABLE@" sign /fd sha256 /f %HF_PFX_FILE% /p %HF_PFX_PASSPHRASE% /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 $%TEMP%\@UNINSTALLER_NAME@' = 0
|
!system '"@SIGNTOOL_EXECUTABLE@" sign /fd sha256 /f %HF_PFX_FILE% /p %HF_PFX_PASSPHRASE% /tr http://timestamp.comodoca.com?td=sha256 /td SHA256 $%TEMP%\@UNINSTALLER_NAME@' = 0
|
||||||
; !endif
|
!endif
|
||||||
; !endif
|
!endif
|
||||||
|
|
||||||
; Good. Now we can carry on writing the real installer.
|
; Good. Now we can carry on writing the real installer.
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
// Here you can put a script that will be run by an assignment-client (AC)
|
// Here you can put a script that will be run by an assignment-client (AC)
|
||||||
// For examples, please go to https://github.com/highfidelity/hifi/tree/master/script-archive/acScripts
|
// For examples, please go to https://github.com/kasenvr/project-athena/tree/master/script-archive/acScripts
|
||||||
// The directory named acScripts contains assignment-client specific scripts you can try.
|
// The directory named acScripts contains assignment-client specific scripts you can try.
|
||||||
|
|
|
@ -386,6 +386,10 @@ Item {
|
||||||
visible: root.expanded
|
visible: root.expanded
|
||||||
text: "LOD: " + root.lodStatus;
|
text: "LOD: " + root.lodStatus;
|
||||||
}
|
}
|
||||||
|
StatText {
|
||||||
|
visible: root.expanded
|
||||||
|
text: "Entity Updates: " + root.numEntityUpdates + " / " + root.numNeededEntityUpdates;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -437,6 +437,10 @@ Item {
|
||||||
visible: root.expanded
|
visible: root.expanded
|
||||||
text: "LOD: " + root.lodStatus;
|
text: "LOD: " + root.lodStatus;
|
||||||
}
|
}
|
||||||
|
StatText {
|
||||||
|
visible: root.expanded
|
||||||
|
text: "Entity Updates: " + root.numEntityUpdates + " / " + root.numNeededEntityUpdates;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,6 +458,8 @@ void Stats::updateStats(bool force) {
|
||||||
STAT_UPDATE(localLeaves, (int)OctreeElement::getLeafNodeCount());
|
STAT_UPDATE(localLeaves, (int)OctreeElement::getLeafNodeCount());
|
||||||
// LOD Details
|
// LOD Details
|
||||||
STAT_UPDATE(lodStatus, "You can see " + DependencyManager::get<LODManager>()->getLODFeedbackText());
|
STAT_UPDATE(lodStatus, "You can see " + DependencyManager::get<LODManager>()->getLODFeedbackText());
|
||||||
|
STAT_UPDATE(numEntityUpdates, DependencyManager::get<EntityTreeRenderer>()->getPrevNumEntityUpdates());
|
||||||
|
STAT_UPDATE(numNeededEntityUpdates, DependencyManager::get<EntityTreeRenderer>()->getPrevTotalNeededEntityUpdates());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -248,6 +248,10 @@ private: \
|
||||||
* <em>Read-only.</em>
|
* <em>Read-only.</em>
|
||||||
* @property {string} lodStatus - Description of the current LOD.
|
* @property {string} lodStatus - Description of the current LOD.
|
||||||
* <em>Read-only.</em>
|
* <em>Read-only.</em>
|
||||||
|
* @property {string} numEntityUpdates - The number of entity updates that happened last frame.
|
||||||
|
* <em>Read-only.</em>
|
||||||
|
* @property {string} numNeededEntityUpdates - The total number of entity updates scheduled for last frame.
|
||||||
|
* <em>Read-only.</em>
|
||||||
* @property {string} timingStats - Details of the average time (ms) spent in and number of calls made to different parts of
|
* @property {string} timingStats - Details of the average time (ms) spent in and number of calls made to different parts of
|
||||||
* the code. Provided only if <code>timingExpanded</code> is <code>true</code>. Only the top 10 items are provided if
|
* the code. Provided only if <code>timingExpanded</code> is <code>true</code>. Only the top 10 items are provided if
|
||||||
* Developer > Timing > Performance Timer > Only Display Top 10 is enabled.
|
* Developer > Timing > Performance Timer > Only Display Top 10 is enabled.
|
||||||
|
@ -543,6 +547,8 @@ class Stats : public QQuickItem {
|
||||||
STATS_PROPERTY(int, lodAngle, 0)
|
STATS_PROPERTY(int, lodAngle, 0)
|
||||||
STATS_PROPERTY(int, lodTargetFramerate, 0)
|
STATS_PROPERTY(int, lodTargetFramerate, 0)
|
||||||
STATS_PROPERTY(QString, lodStatus, QString())
|
STATS_PROPERTY(QString, lodStatus, QString())
|
||||||
|
STATS_PROPERTY(int, numEntityUpdates, 0)
|
||||||
|
STATS_PROPERTY(int, numNeededEntityUpdates, 0)
|
||||||
STATS_PROPERTY(QString, timingStats, QString())
|
STATS_PROPERTY(QString, timingStats, QString())
|
||||||
STATS_PROPERTY(QString, gameUpdateStats, QString())
|
STATS_PROPERTY(QString, gameUpdateStats, QString())
|
||||||
STATS_PROPERTY(int, serverElements, 0)
|
STATS_PROPERTY(int, serverElements, 0)
|
||||||
|
@ -1211,6 +1217,20 @@ signals:
|
||||||
*/
|
*/
|
||||||
void lodStatusChanged();
|
void lodStatusChanged();
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the value of the <code>numEntityUpdates</code> property changes.
|
||||||
|
* @function Stats.numEntityUpdatesChanged
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void numEntityUpdatesChanged();
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Triggered when the value of the <code>numNeededEntityUpdates</code> property changes.
|
||||||
|
* @function Stats.numNeededEntityUpdatesChanged
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
|
void numNeededEntityUpdatesChanged();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Triggered when the value of the <code>timingStats</code> property changes.
|
* Triggered when the value of the <code>timingStats</code> property changes.
|
||||||
* @function Stats.timingStatsChanged
|
* @function Stats.timingStatsChanged
|
||||||
|
|
|
@ -425,6 +425,7 @@ void EntityTreeRenderer::updateChangedEntities(const render::ScenePointer& scene
|
||||||
}
|
}
|
||||||
|
|
||||||
float expectedUpdateCost = _avgRenderableUpdateCost * _renderablesToUpdate.size();
|
float expectedUpdateCost = _avgRenderableUpdateCost * _renderablesToUpdate.size();
|
||||||
|
_prevTotalNeededEntityUpdates = _renderablesToUpdate.size();
|
||||||
if (expectedUpdateCost < MAX_UPDATE_RENDERABLES_TIME_BUDGET) {
|
if (expectedUpdateCost < MAX_UPDATE_RENDERABLES_TIME_BUDGET) {
|
||||||
// we expect to update all renderables within available time budget
|
// we expect to update all renderables within available time budget
|
||||||
PROFILE_RANGE_EX(simulation_physics, "UpdateRenderables", 0xffff00ff, (uint64_t)_renderablesToUpdate.size());
|
PROFILE_RANGE_EX(simulation_physics, "UpdateRenderables", 0xffff00ff, (uint64_t)_renderablesToUpdate.size());
|
||||||
|
@ -433,7 +434,8 @@ void EntityTreeRenderer::updateChangedEntities(const render::ScenePointer& scene
|
||||||
assert(renderable); // only valid renderables are added to _renderablesToUpdate
|
assert(renderable); // only valid renderables are added to _renderablesToUpdate
|
||||||
renderable->updateInScene(scene, transaction);
|
renderable->updateInScene(scene, transaction);
|
||||||
}
|
}
|
||||||
size_t numRenderables = _renderablesToUpdate.size() + 1; // add one to avoid divide by zero
|
_prevNumEntityUpdates = _renderablesToUpdate.size();
|
||||||
|
size_t numRenderables = _prevNumEntityUpdates + 1; // add one to avoid divide by zero
|
||||||
_renderablesToUpdate.clear();
|
_renderablesToUpdate.clear();
|
||||||
|
|
||||||
// compute average per-renderable update cost
|
// compute average per-renderable update cost
|
||||||
|
@ -494,7 +496,8 @@ void EntityTreeRenderer::updateChangedEntities(const render::ScenePointer& scene
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute average per-renderable update cost
|
// compute average per-renderable update cost
|
||||||
size_t numUpdated = sortedRenderables.size() - _renderablesToUpdate.size() + 1; // add one to avoid divide by zero
|
_prevNumEntityUpdates = sortedRenderables.size() - _renderablesToUpdate.size();
|
||||||
|
size_t numUpdated = _prevNumEntityUpdates + 1; // add one to avoid divide by zero
|
||||||
float cost = (float)(usecTimestampNow() - updateStart) / (float)(numUpdated);
|
float cost = (float)(usecTimestampNow() - updateStart) / (float)(numUpdated);
|
||||||
const float BLEND = 0.1f;
|
const float BLEND = 0.1f;
|
||||||
_avgRenderableUpdateCost = (1.0f - BLEND) * _avgRenderableUpdateCost + BLEND * cost;
|
_avgRenderableUpdateCost = (1.0f - BLEND) * _avgRenderableUpdateCost + BLEND * cost;
|
||||||
|
|
|
@ -136,6 +136,9 @@ public:
|
||||||
static bool addMaterialToAvatar(const QUuid& avatarID, graphics::MaterialLayer material, const std::string& parentMaterialName);
|
static bool addMaterialToAvatar(const QUuid& avatarID, graphics::MaterialLayer material, const std::string& parentMaterialName);
|
||||||
static bool removeMaterialFromAvatar(const QUuid& avatarID, graphics::MaterialPointer material, const std::string& parentMaterialName);
|
static bool removeMaterialFromAvatar(const QUuid& avatarID, graphics::MaterialPointer material, const std::string& parentMaterialName);
|
||||||
|
|
||||||
|
int getPrevNumEntityUpdates() const { return _prevNumEntityUpdates; }
|
||||||
|
int getPrevTotalNeededEntityUpdates() const { return _prevTotalNeededEntityUpdates; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void enterEntity(const EntityItemID& entityItemID);
|
void enterEntity(const EntityItemID& entityItemID);
|
||||||
void leaveEntity(const EntityItemID& entityItemID);
|
void leaveEntity(const EntityItemID& entityItemID);
|
||||||
|
@ -249,6 +252,8 @@ private:
|
||||||
|
|
||||||
ReadWriteLockable _changedEntitiesGuard;
|
ReadWriteLockable _changedEntitiesGuard;
|
||||||
std::unordered_set<EntityItemID> _changedEntities;
|
std::unordered_set<EntityItemID> _changedEntities;
|
||||||
|
int _prevNumEntityUpdates { 0 };
|
||||||
|
int _prevTotalNeededEntityUpdates { 0 };
|
||||||
|
|
||||||
std::unordered_set<EntityRendererPointer> _renderablesToUpdate;
|
std::unordered_set<EntityRendererPointer> _renderablesToUpdate;
|
||||||
std::unordered_map<EntityItemID, EntityRendererPointer> _entitiesInScene;
|
std::unordered_map<EntityItemID, EntityRendererPointer> _entitiesInScene;
|
||||||
|
|
|
@ -219,13 +219,6 @@ void EntityRenderer::render(RenderArgs* args) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_renderUpdateQueued && needsRenderUpdate()) {
|
|
||||||
// FIXME find a way to spread out the calls to needsRenderUpdate so that only a given subset of the
|
|
||||||
// items checks every frame, like 1/N of the tree ever N frames
|
|
||||||
_renderUpdateQueued = true;
|
|
||||||
emit requestRenderUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_visible && (args->_renderMode != RenderArgs::RenderMode::DEFAULT_RENDER_MODE || !_cauterized)) {
|
if (_visible && (args->_renderMode != RenderArgs::RenderMode::DEFAULT_RENDER_MODE || !_cauterized)) {
|
||||||
doRender(args);
|
doRender(args);
|
||||||
}
|
}
|
||||||
|
@ -344,11 +337,6 @@ void EntityRenderer::updateInScene(const ScenePointer& scene, Transaction& trans
|
||||||
}
|
}
|
||||||
_updateTime = usecTimestampNow();
|
_updateTime = usecTimestampNow();
|
||||||
|
|
||||||
// FIXME is this excessive?
|
|
||||||
if (!needsRenderUpdate()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
doRenderUpdateSynchronous(scene, transaction, _entity);
|
doRenderUpdateSynchronous(scene, transaction, _entity);
|
||||||
transaction.updateItem<PayloadProxyInterface>(_renderItemID, [this](PayloadProxyInterface& self) {
|
transaction.updateItem<PayloadProxyInterface>(_renderItemID, [this](PayloadProxyInterface& self) {
|
||||||
if (!isValidRenderItem()) {
|
if (!isValidRenderItem()) {
|
||||||
|
@ -356,7 +344,6 @@ void EntityRenderer::updateInScene(const ScenePointer& scene, Transaction& trans
|
||||||
}
|
}
|
||||||
// Happens on the render thread. Classes should use
|
// Happens on the render thread. Classes should use
|
||||||
doRenderUpdateAsynchronous(_entity);
|
doRenderUpdateAsynchronous(_entity);
|
||||||
_renderUpdateQueued = false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,7 +444,7 @@ void EntityRenderer::doRenderUpdateSynchronous(const ScenePointer& scene, Transa
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityRenderer::onAddToScene(const EntityItemPointer& entity) {
|
void EntityRenderer::onAddToScene(const EntityItemPointer& entity) {
|
||||||
QObject::connect(this, &EntityRenderer::requestRenderUpdate, this, [this] {
|
QObject::connect(this, &EntityRenderer::requestRenderUpdate, this, [this] {
|
||||||
auto renderer = DependencyManager::get<EntityTreeRenderer>();
|
auto renderer = DependencyManager::get<EntityTreeRenderer>();
|
||||||
if (renderer) {
|
if (renderer) {
|
||||||
renderer->onEntityChanged(_entity->getID());
|
renderer->onEntityChanged(_entity->getID());
|
||||||
|
@ -466,7 +453,10 @@ void EntityRenderer::onAddToScene(const EntityItemPointer& entity) {
|
||||||
_changeHandlerId = entity->registerChangeHandler([](const EntityItemID& changedEntity) {
|
_changeHandlerId = entity->registerChangeHandler([](const EntityItemID& changedEntity) {
|
||||||
auto renderer = DependencyManager::get<EntityTreeRenderer>();
|
auto renderer = DependencyManager::get<EntityTreeRenderer>();
|
||||||
if (renderer) {
|
if (renderer) {
|
||||||
renderer->onEntityChanged(changedEntity);
|
auto renderable = renderer->renderableForEntityId(changedEntity);
|
||||||
|
if (renderable && renderable->needsRenderUpdate()) {
|
||||||
|
renderer->onEntityChanged(changedEntity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,8 +148,6 @@ protected:
|
||||||
QVector<QUuid> _renderWithZones;
|
QVector<QUuid> _renderWithZones;
|
||||||
bool _cauterized { false };
|
bool _cauterized { false };
|
||||||
bool _moving { false };
|
bool _moving { false };
|
||||||
// Only touched on the rendering thread
|
|
||||||
bool _renderUpdateQueued{ false };
|
|
||||||
Transform _renderTransform;
|
Transform _renderTransform;
|
||||||
|
|
||||||
std::unordered_map<std::string, graphics::MultiMaterial> _materials;
|
std::unordered_map<std::string, graphics::MultiMaterial> _materials;
|
||||||
|
@ -191,10 +189,7 @@ protected:
|
||||||
using Parent::needsRenderUpdateFromEntity;
|
using Parent::needsRenderUpdateFromEntity;
|
||||||
// Returns true if the item in question needs to have updateInScene called because of changes in the entity
|
// Returns true if the item in question needs to have updateInScene called because of changes in the entity
|
||||||
virtual bool needsRenderUpdateFromEntity(const EntityItemPointer& entity) const override final {
|
virtual bool needsRenderUpdateFromEntity(const EntityItemPointer& entity) const override final {
|
||||||
if (Parent::needsRenderUpdateFromEntity(entity)) {
|
return Parent::needsRenderUpdateFromEntity(entity) || needsRenderUpdateFromTypedEntity(_typedEntity);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return needsRenderUpdateFromTypedEntity(_typedEntity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void doRenderUpdateSynchronous(const ScenePointer& scene, Transaction& transaction, const EntityItemPointer& entity) override final {
|
virtual void doRenderUpdateSynchronous(const ScenePointer& scene, Transaction& transaction, const EntityItemPointer& entity) override final {
|
||||||
|
|
|
@ -39,6 +39,16 @@ bool GizmoEntityRenderer::isTransparent() const {
|
||||||
return Parent::isTransparent() || ringTransparent;
|
return Parent::isTransparent() || ringTransparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GizmoEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
|
||||||
|
void* key = (void*)this;
|
||||||
|
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] {
|
||||||
|
withWriteLock([&] {
|
||||||
|
_renderTransform = getModelTransform();
|
||||||
|
_renderTransform.postScale(entity->getScaledDimensions());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void GizmoEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
|
void GizmoEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
|
||||||
bool dirty = false;
|
bool dirty = false;
|
||||||
RingGizmoPropertyGroup ringProperties = entity->getRingProperties();
|
RingGizmoPropertyGroup ringProperties = entity->getRingProperties();
|
||||||
|
@ -186,15 +196,6 @@ void GizmoEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPoint
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void* key = (void*)this;
|
|
||||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity]() {
|
|
||||||
withWriteLock([&] {
|
|
||||||
updateModelTransformAndBound();
|
|
||||||
_renderTransform = getModelTransform();
|
|
||||||
_renderTransform.postScale(entity->getScaledDimensions());
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item::Bound GizmoEntityRenderer::getBound() {
|
Item::Bound GizmoEntityRenderer::getBound() {
|
||||||
|
|
|
@ -29,6 +29,7 @@ protected:
|
||||||
bool isTransparent() const override;
|
bool isTransparent() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
virtual void doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity);
|
||||||
virtual void doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) override;
|
virtual void doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) override;
|
||||||
virtual void doRender(RenderArgs* args) override;
|
virtual void doRender(RenderArgs* args) override;
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,9 @@ void GridEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scen
|
||||||
});
|
});
|
||||||
|
|
||||||
void* key = (void*)this;
|
void* key = (void*)this;
|
||||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity]() {
|
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_dimensions = entity->getScaledDimensions();
|
_dimensions = entity->getScaledDimensions();
|
||||||
updateModelTransformAndBound();
|
|
||||||
_renderTransform = getModelTransform();
|
_renderTransform = getModelTransform();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,11 +30,9 @@ bool ImageEntityRenderer::isTransparent() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImageEntityRenderer::needsRenderUpdate() const {
|
bool ImageEntityRenderer::needsRenderUpdate() const {
|
||||||
bool textureLoadedChanged = resultWithReadLock<bool>([&] {
|
if (resultWithReadLock<bool>([&] {
|
||||||
return (!_textureIsLoaded && _texture && _texture->isLoaded());
|
return !_textureIsLoaded;
|
||||||
});
|
})) {
|
||||||
|
|
||||||
if (textureLoadedChanged) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,15 +61,15 @@ void ImageEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
|
||||||
_pulseProperties = entity->getPulseProperties();
|
_pulseProperties = entity->getPulseProperties();
|
||||||
_billboardMode = entity->getBillboardMode();
|
_billboardMode = entity->getBillboardMode();
|
||||||
|
|
||||||
if (!_textureIsLoaded && _texture && _texture->isLoaded()) {
|
if (!_textureIsLoaded) {
|
||||||
_textureIsLoaded = true;
|
emit requestRenderUpdate();
|
||||||
}
|
}
|
||||||
|
_textureIsLoaded = _texture && (_texture->isLoaded() || _texture->isFailed());
|
||||||
});
|
});
|
||||||
|
|
||||||
void* key = (void*)this;
|
void* key = (void*)this;
|
||||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity]() {
|
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
updateModelTransformAndBound();
|
|
||||||
_renderTransform = getModelTransform();
|
_renderTransform = getModelTransform();
|
||||||
_renderTransform.postScale(entity->getScaledDimensions());
|
_renderTransform.postScale(entity->getScaledDimensions());
|
||||||
});
|
});
|
||||||
|
|
|
@ -64,6 +64,16 @@ ParticleEffectEntityRenderer::ParticleEffectEntityRenderer(const EntityItemPoint
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ParticleEffectEntityRenderer::needsRenderUpdate() const {
|
||||||
|
if (resultWithReadLock<bool>([&] {
|
||||||
|
return !_textureLoaded;
|
||||||
|
})) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Parent::needsRenderUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
|
void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
|
||||||
auto newParticleProperties = entity->getParticleProperties();
|
auto newParticleProperties = entity->getParticleProperties();
|
||||||
if (!newParticleProperties.valid()) {
|
if (!newParticleProperties.valid()) {
|
||||||
|
@ -102,6 +112,7 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi
|
||||||
}
|
}
|
||||||
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
|
_textureLoaded = true;
|
||||||
entity->setVisuallyReady(true);
|
entity->setVisuallyReady(true);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -111,20 +122,29 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi
|
||||||
if (textureNeedsUpdate) {
|
if (textureNeedsUpdate) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_networkTexture = DependencyManager::get<TextureCache>()->getTexture(_particleProperties.textures);
|
_networkTexture = DependencyManager::get<TextureCache>()->getTexture(_particleProperties.textures);
|
||||||
|
_textureLoaded = false;
|
||||||
|
entity->setVisuallyReady(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_networkTexture) {
|
if (!_textureLoaded) {
|
||||||
|
emit requestRenderUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool textureLoaded = resultWithReadLock<bool>([&] {
|
||||||
|
return _networkTexture && (_networkTexture->isLoaded() || _networkTexture->isFailed());
|
||||||
|
});
|
||||||
|
if (textureLoaded) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
entity->setVisuallyReady(_networkTexture->isFailed() || _networkTexture->isLoaded());
|
entity->setVisuallyReady(true);
|
||||||
|
_textureLoaded = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void* key = (void*)this;
|
void* key = (void*)this;
|
||||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this] () {
|
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this] {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
updateModelTransformAndBound();
|
|
||||||
_renderTransform = getModelTransform();
|
_renderTransform = getModelTransform();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,6 +25,7 @@ public:
|
||||||
ParticleEffectEntityRenderer(const EntityItemPointer& entity);
|
ParticleEffectEntityRenderer(const EntityItemPointer& entity);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual bool needsRenderUpdate() const override;
|
||||||
virtual void doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) override;
|
virtual void doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) override;
|
||||||
virtual void doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) override;
|
virtual void doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) override;
|
||||||
|
|
||||||
|
@ -111,6 +112,7 @@ private:
|
||||||
GeometryResource::Pointer _geometryResource;
|
GeometryResource::Pointer _geometryResource;
|
||||||
|
|
||||||
NetworkTexturePointer _networkTexture;
|
NetworkTexturePointer _networkTexture;
|
||||||
|
bool _textureLoaded { false };
|
||||||
ScenePointer _scene;
|
ScenePointer _scene;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -204,9 +204,8 @@ void PolyLineEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer&
|
||||||
bool geometryChanged = uvModeStretchChanged || pointsChanged || widthsChanged || normalsChanged || colorsChanged || textureChanged || faceCameraChanged;
|
bool geometryChanged = uvModeStretchChanged || pointsChanged || widthsChanged || normalsChanged || colorsChanged || textureChanged || faceCameraChanged;
|
||||||
|
|
||||||
void* key = (void*)this;
|
void* key = (void*)this;
|
||||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, geometryChanged] () {
|
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, geometryChanged] {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
updateModelTransformAndBound();
|
|
||||||
_renderTransform = getModelTransform();
|
_renderTransform = getModelTransform();
|
||||||
|
|
||||||
if (geometryChanged) {
|
if (geometryChanged) {
|
||||||
|
|
|
@ -70,20 +70,18 @@ void ShapeEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce
|
||||||
});
|
});
|
||||||
|
|
||||||
void* key = (void*)this;
|
void* key = (void*)this;
|
||||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this] () {
|
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
auto entity = getEntity();
|
|
||||||
_position = entity->getWorldPosition();
|
_position = entity->getWorldPosition();
|
||||||
_dimensions = entity->getUnscaledDimensions(); // get unscaled to avoid scaling twice
|
_dimensions = entity->getUnscaledDimensions(); // get unscaled to avoid scaling twice
|
||||||
_orientation = entity->getWorldOrientation();
|
_orientation = entity->getWorldOrientation();
|
||||||
updateModelTransformAndBound();
|
|
||||||
_renderTransform = getModelTransform(); // contains parent scale, if this entity scales with its parent
|
_renderTransform = getModelTransform(); // contains parent scale, if this entity scales with its parent
|
||||||
if (_shape == entity::Sphere) {
|
if (_shape == entity::Sphere) {
|
||||||
_renderTransform.postScale(SPHERE_ENTITY_SCALE);
|
_renderTransform.postScale(SPHERE_ENTITY_SCALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderTransform.postScale(_dimensions);
|
_renderTransform.postScale(_dimensions);
|
||||||
});;
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,11 +119,16 @@ void ShapeEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPoint
|
||||||
materialChanged = true;
|
materialChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (materialChanged) {
|
auto materials = _materials.find("0");
|
||||||
auto materials = _materials.find("0");
|
if (materials != _materials.end()) {
|
||||||
if (materials != _materials.end()) {
|
if (materialChanged) {
|
||||||
materials->second.setNeedsUpdate(true);
|
materials->second.setNeedsUpdate(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (materials->second.shouldUpdate()) {
|
||||||
|
RenderPipelines::updateMultiMaterial(materials->second);
|
||||||
|
emit requestRenderUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,10 +102,9 @@ bool TextEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPoint
|
||||||
|
|
||||||
void TextEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
|
void TextEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) {
|
||||||
void* key = (void*)this;
|
void* key = (void*)this;
|
||||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] () {
|
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_dimensions = entity->getScaledDimensions();
|
_dimensions = entity->getScaledDimensions();
|
||||||
updateModelTransformAndBound();
|
|
||||||
_renderTransform = getModelTransform();
|
_renderTransform = getModelTransform();
|
||||||
_renderTransform.postScale(_dimensions);
|
_renderTransform.postScale(_dimensions);
|
||||||
});
|
});
|
||||||
|
|
|
@ -236,11 +236,10 @@ void WebEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene
|
||||||
}
|
}
|
||||||
|
|
||||||
void* key = (void*)this;
|
void* key = (void*)this;
|
||||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity]() {
|
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [this, entity] {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
glm::vec2 windowSize = getWindowSize(entity);
|
glm::vec2 windowSize = getWindowSize(entity);
|
||||||
_webSurface->resize(QSize(windowSize.x, windowSize.y));
|
_webSurface->resize(QSize(windowSize.x, windowSize.y));
|
||||||
updateModelTransformAndBound();
|
|
||||||
_renderTransform = getModelTransform();
|
_renderTransform = getModelTransform();
|
||||||
_renderTransform.setScale(1.0f);
|
_renderTransform.setScale(1.0f);
|
||||||
_renderTransform.postScale(entity->getScaledDimensions());
|
_renderTransform.postScale(entity->getScaledDimensions());
|
||||||
|
|
|
@ -262,14 +262,6 @@ void ZoneEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scen
|
||||||
entity->setVisuallyReady(visuallyReady);
|
entity->setVisuallyReady(visuallyReady);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
|
|
||||||
if (entity->getShapeType() == SHAPE_TYPE_SPHERE) {
|
|
||||||
_renderTransform = getModelTransform();
|
|
||||||
_renderTransform.postScale(SPHERE_ENTITY_SCALE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ItemKey ZoneEntityRenderer::getKey() {
|
ItemKey ZoneEntityRenderer::getKey() {
|
||||||
return ItemKey::Builder().withTypeMeta().withTagBits(getTagMask()).build();
|
return ItemKey::Builder().withTypeMeta().withTagBits(getTagMask()).build();
|
||||||
}
|
}
|
||||||
|
@ -306,8 +298,6 @@ bool ZoneEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPoint
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: do we need to trigger an update when shapeType changes? see doRenderUpdateAsynchronousTyped
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ protected:
|
||||||
virtual void doRender(RenderArgs* args) override;
|
virtual void doRender(RenderArgs* args) override;
|
||||||
virtual bool needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const override;
|
virtual bool needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const override;
|
||||||
virtual void doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) override;
|
virtual void doRenderUpdateSynchronousTyped(const ScenePointer& scene, Transaction& transaction, const TypedEntityPointer& entity) override;
|
||||||
virtual void doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateKeyZoneItemFromEntity(const TypedEntityPointer& entity);
|
void updateKeyZoneItemFromEntity(const TypedEntityPointer& entity);
|
||||||
|
|
|
@ -617,10 +617,6 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
||||||
_lastEdited = lastEditedFromBufferAdjusted;
|
_lastEdited = lastEditedFromBufferAdjusted;
|
||||||
_lastEditedFromRemote = now;
|
_lastEditedFromRemote = now;
|
||||||
_lastEditedFromRemoteInRemoteTime = lastEditedFromBuffer;
|
_lastEditedFromRemoteInRemoteTime = lastEditedFromBuffer;
|
||||||
|
|
||||||
// TODO: only send this notification if something ACTUALLY changed (hint, we haven't yet parsed
|
|
||||||
// the properties out of the bitstream (see below))
|
|
||||||
somethingChangedNotification(); // notify derived classes that something has changed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// last updated is stored as ByteCountCoded delta from lastEdited
|
// last updated is stored as ByteCountCoded delta from lastEdited
|
||||||
|
@ -1005,6 +1001,9 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
||||||
element->getTree()->trackIncomingEntityLastEdited(lastEditedFromBufferAdjusted, bytesRead);
|
element->getTree()->trackIncomingEntityLastEdited(lastEditedFromBufferAdjusted, bytesRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (somethingChanged) {
|
||||||
|
somethingChangedNotification();
|
||||||
|
}
|
||||||
|
|
||||||
return bytesRead;
|
return bytesRead;
|
||||||
}
|
}
|
||||||
|
@ -1573,14 +1572,14 @@ bool EntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
qCDebug(entities) << "EntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
qCDebug(entities) << "EntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
"now=" << now << " getLastEdited()=" << getLastEdited();
|
||||||
#endif
|
#endif
|
||||||
setLastEdited(now);
|
setLastEdited(properties._lastEdited);
|
||||||
somethingChangedNotification(); // notify derived classes that something has changed
|
|
||||||
if (getDirtyFlags() & (Simulation::DIRTY_TRANSFORM | Simulation::DIRTY_VELOCITIES)) {
|
if (getDirtyFlags() & (Simulation::DIRTY_TRANSFORM | Simulation::DIRTY_VELOCITIES)) {
|
||||||
// anything that sets the transform or velocity must update _lastSimulated which is used
|
// anything that sets the transform or velocity must update _lastSimulated which is used
|
||||||
// for kinematic extrapolation (e.g. we want to extrapolate forward from this moment
|
// for kinematic extrapolation (e.g. we want to extrapolate forward from this moment
|
||||||
// when position and/or velocity was changed).
|
// when position and/or velocity was changed).
|
||||||
_lastSimulated = now;
|
_lastSimulated = now;
|
||||||
}
|
}
|
||||||
|
somethingChangedNotification();
|
||||||
}
|
}
|
||||||
|
|
||||||
// timestamps
|
// timestamps
|
||||||
|
@ -1832,6 +1831,7 @@ void EntityItem::setPosition(const glm::vec3& value) {
|
||||||
void EntityItem::setParentID(const QUuid& value) {
|
void EntityItem::setParentID(const QUuid& value) {
|
||||||
QUuid oldParentID = getParentID();
|
QUuid oldParentID = getParentID();
|
||||||
if (oldParentID != value) {
|
if (oldParentID != value) {
|
||||||
|
_needsRenderUpdate = true;
|
||||||
EntityTreePointer tree = getTree();
|
EntityTreePointer tree = getTree();
|
||||||
if (tree && !oldParentID.isNull()) {
|
if (tree && !oldParentID.isNull()) {
|
||||||
tree->removeFromChildrenOfAvatars(getThisPointer());
|
tree->removeFromChildrenOfAvatars(getThisPointer());
|
||||||
|
@ -3000,10 +3000,15 @@ bool EntityItem::getCauterized() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItem::setCauterized(bool value) {
|
void EntityItem::setCauterized(bool value) {
|
||||||
|
bool needsRenderUpdate = false;
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_needsRenderUpdate |= _cauterized != value;
|
needsRenderUpdate = _cauterized != value;
|
||||||
|
_needsRenderUpdate |= needsRenderUpdate;
|
||||||
_cauterized = value;
|
_cauterized = value;
|
||||||
});
|
});
|
||||||
|
if (needsRenderUpdate) {
|
||||||
|
somethingChangedNotification();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EntityItem::getIgnorePickIntersection() const {
|
bool EntityItem::getIgnorePickIntersection() const {
|
||||||
|
@ -3042,10 +3047,15 @@ bool EntityItem::getCullWithParent() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItem::setCullWithParent(bool value) {
|
void EntityItem::setCullWithParent(bool value) {
|
||||||
|
bool needsRenderUpdate = false;
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_needsRenderUpdate |= _cullWithParent != value;
|
needsRenderUpdate = _cullWithParent != value;
|
||||||
|
_needsRenderUpdate |= needsRenderUpdate;
|
||||||
_cullWithParent = value;
|
_cullWithParent = value;
|
||||||
});
|
});
|
||||||
|
if (needsRenderUpdate) {
|
||||||
|
somethingChangedNotification();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EntityItem::isChildOfMyAvatar() const {
|
bool EntityItem::isChildOfMyAvatar() const {
|
||||||
|
|
|
@ -579,8 +579,8 @@ public:
|
||||||
|
|
||||||
bool stillHasMyGrab() const;
|
bool stillHasMyGrab() const;
|
||||||
|
|
||||||
bool needsRenderUpdate() const { return resultWithReadLock<bool>([&] { return _needsRenderUpdate; }); }
|
bool needsRenderUpdate() const { return _needsRenderUpdate; }
|
||||||
void setNeedsRenderUpdate(bool needsRenderUpdate) { withWriteLock([&] { _needsRenderUpdate = needsRenderUpdate; }); }
|
void setNeedsRenderUpdate(bool needsRenderUpdate) { _needsRenderUpdate = needsRenderUpdate; }
|
||||||
|
|
||||||
void setRenderWithZones(const QVector<QUuid>& renderWithZones);
|
void setRenderWithZones(const QVector<QUuid>& renderWithZones);
|
||||||
QVector<QUuid> getRenderWithZones() const;
|
QVector<QUuid> getRenderWithZones() const;
|
||||||
|
|
|
@ -39,8 +39,8 @@ EntityItemProperties GizmoEntityItem::getProperties(const EntityPropertyFlags& d
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GizmoEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool GizmoEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(gizmoType, setGizmoType);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(gizmoType, setGizmoType);
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
|
@ -49,16 +49,6 @@ bool GizmoEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
_needsRenderUpdate |= ringPropertiesChanged;
|
_needsRenderUpdate |= ringPropertiesChanged;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "GizmoEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties.getLastEdited());
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
bool setProperties(const EntityItemProperties& properties) override;
|
bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ EntityItemProperties GridEntityItem::getProperties(const EntityPropertyFlags& de
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GridEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool GridEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
||||||
|
@ -61,16 +61,6 @@ bool GridEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(majorGridEvery, setMajorGridEvery);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(majorGridEvery, setMajorGridEvery);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(minorGridEvery, setMinorGridEvery);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(minorGridEvery, setMinorGridEvery);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "GridEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties.getLastEdited());
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
bool setProperties(const EntityItemProperties& properties) override;
|
bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ EntityItemProperties ImageEntityItem::getProperties(const EntityPropertyFlags& d
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImageEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool ImageEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
||||||
|
@ -62,16 +62,6 @@ bool ImageEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(keepAspectRatio, setKeepAspectRatio);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(keepAspectRatio, setKeepAspectRatio);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(subImage, setSubImage);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(subImage, setSubImage);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "ImageEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties.getLastEdited());
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
bool setProperties(const EntityItemProperties& properties) override;
|
bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -55,21 +55,6 @@ void LightEntityItem::setUnscaledDimensions(const glm::vec3& value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightEntityItem::locationChanged(bool tellPhysics, bool tellChildren) {
|
|
||||||
EntityItem::locationChanged(tellPhysics, tellChildren);
|
|
||||||
withWriteLock([&] {
|
|
||||||
_needsRenderUpdate = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void LightEntityItem::dimensionsChanged() {
|
|
||||||
EntityItem::dimensionsChanged();
|
|
||||||
withWriteLock([&] {
|
|
||||||
_needsRenderUpdate = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
EntityItemProperties LightEntityItem::getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const {
|
EntityItemProperties LightEntityItem::getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const {
|
||||||
EntityItemProperties properties = EntityItem::getProperties(desiredProperties, allowEmptyDesiredProperties); // get the properties from our base class
|
EntityItemProperties properties = EntityItem::getProperties(desiredProperties, allowEmptyDesiredProperties); // get the properties from our base class
|
||||||
|
|
||||||
|
@ -134,23 +119,8 @@ void LightEntityItem::setCutoff(float value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LightEntityItem::setProperties(const EntityItemProperties& properties) {
|
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "LightEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties.getLastEdited());
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LightEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
bool LightEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setSubClassProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(isSpotlight, setIsSpotlight);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(isSpotlight, setIsSpotlight);
|
||||||
|
@ -162,7 +132,6 @@ bool LightEntityItem::setSubClassProperties(const EntityItemProperties& properti
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int LightEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
int LightEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
||||||
ReadBitstreamToTreeParams& args,
|
ReadBitstreamToTreeParams& args,
|
||||||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
||||||
|
|
|
@ -33,11 +33,9 @@ public:
|
||||||
/// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately
|
/// set dimensions in domain scale units (0.0 - 1.0) this will also reset radius appropriately
|
||||||
virtual void setUnscaledDimensions(const glm::vec3& value) override;
|
virtual void setUnscaledDimensions(const glm::vec3& value) override;
|
||||||
|
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
|
||||||
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
@ -73,9 +71,6 @@ public:
|
||||||
|
|
||||||
static bool getLightsArePickable() { return _lightsArePickable; }
|
static bool getLightsArePickable() { return _lightsArePickable; }
|
||||||
static void setLightsArePickable(bool value) { _lightsArePickable = value; }
|
static void setLightsArePickable(bool value) { _lightsArePickable = value; }
|
||||||
|
|
||||||
virtual void locationChanged(bool tellPhysics, bool tellChildren) override;
|
|
||||||
virtual void dimensionsChanged() override;
|
|
||||||
|
|
||||||
virtual bool supportsDetailedIntersection() const override { return true; }
|
virtual bool supportsDetailedIntersection() const override { return true; }
|
||||||
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
|
|
|
@ -45,23 +45,12 @@ EntityItemProperties LineEntityItem::getProperties(const EntityPropertyFlags& de
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LineEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool LineEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(linePoints, setLinePoints);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(linePoints, setLinePoints);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "LineEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties._lastEdited);
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ class LineEntityItem : public EntityItem {
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,8 @@ EntityItemProperties MaterialEntityItem::getProperties(const EntityPropertyFlags
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MaterialEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool MaterialEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(materialURL, setMaterialURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(materialURL, setMaterialURL);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(materialMappingMode, setMaterialMappingMode);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(materialMappingMode, setMaterialMappingMode);
|
||||||
|
@ -51,16 +51,6 @@ bool MaterialEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(materialData, setMaterialData);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(materialData, setMaterialData);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(materialRepeat, setMaterialRepeat);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(materialRepeat, setMaterialRepeat);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "MaterialEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties.getLastEdited());
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -79,9 +79,8 @@ EntityItemProperties ModelEntityItem::getProperties(const EntityPropertyFlags& d
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool ModelEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shapeType, setShapeType);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shapeType, setShapeType);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(compoundShapeURL, setCompoundShapeURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(compoundShapeURL, setCompoundShapeURL);
|
||||||
|
@ -105,17 +104,6 @@ bool ModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
somethingChanged = somethingChanged || somethingChangedInAnimations;
|
somethingChanged = somethingChanged || somethingChangedInAnimations;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "ModelEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties._lastEdited);
|
|
||||||
}
|
|
||||||
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -696,8 +696,8 @@ EntityItemProperties ParticleEffectEntityItem::getProperties(const EntityPropert
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParticleEffectEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool ParticleEffectEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shapeType, setShapeType);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shapeType, setShapeType);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(compoundShapeURL, setCompoundShapeURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(compoundShapeURL, setCompoundShapeURL);
|
||||||
|
@ -750,16 +750,6 @@ bool ParticleEffectEntityItem::setProperties(const EntityItemProperties& propert
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(spinFinish, setSpinFinish);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(spinFinish, setSpinFinish);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(rotateWithEntity, setRotateWithEntity);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(rotateWithEntity, setRotateWithEntity);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "ParticleEffectEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties.getLastEdited());
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -214,7 +214,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of this entity
|
// methods for getting/setting all properties of this entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -53,9 +53,8 @@ EntityItemProperties PolyLineEntityItem::getProperties(const EntityPropertyFlags
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PolyLineEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool PolyLineEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textures, setTextures);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textures, setTextures);
|
||||||
|
@ -68,16 +67,6 @@ bool PolyLineEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(glow, setGlow);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(glow, setGlow);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(faceCamera, setFaceCamera);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(faceCamera, setFaceCamera);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "PolyLineEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties._lastEdited);
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -106,8 +106,9 @@ EntityItemProperties PolyVoxEntityItem::getProperties(const EntityPropertyFlags&
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PolyVoxEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool PolyVoxEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(voxelVolumeSize, setVoxelVolumeSize);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(voxelVolumeSize, setVoxelVolumeSize);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(voxelData, setVoxelData);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(voxelData, setVoxelData);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(voxelSurfaceStyle, setVoxelSurfaceStyle);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(voxelSurfaceStyle, setVoxelSurfaceStyle);
|
||||||
|
@ -121,16 +122,6 @@ bool PolyVoxEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(yPNeighborID, setYPNeighborID);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(yPNeighborID, setYPNeighborID);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(zPNeighborID, setZPNeighborID);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(zPNeighborID, setZPNeighborID);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "PolyVoxEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties._lastEdited);
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ class PolyVoxEntityItem : public EntityItem {
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -165,8 +165,8 @@ entity::Shape ShapeEntityItem::getShape() const {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShapeEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool ShapeEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
||||||
|
@ -177,16 +177,6 @@ bool ShapeEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
});
|
});
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shape, setShape);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shape, setShape);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "ShapeEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties.getLastEdited());
|
|
||||||
}
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
bool setProperties(const EntityItemProperties& properties) override;
|
bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -73,9 +73,8 @@ EntityItemProperties TextEntityItem::getProperties(const EntityPropertyFlags& de
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool TextEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
|
||||||
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
bool pulsePropertiesChanged = _pulseProperties.setProperties(properties);
|
bool pulsePropertiesChanged = _pulseProperties.setProperties(properties);
|
||||||
|
@ -99,17 +98,6 @@ bool TextEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textEffect, setTextEffect);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textEffect, setTextEffect);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textEffectColor, setTextEffectColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textEffectColor, setTextEffectColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textEffectThickness, setTextEffectThickness);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textEffectThickness, setTextEffectThickness);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "TextEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties._lastEdited);
|
|
||||||
}
|
|
||||||
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,8 @@ EntityItemProperties WebEntityItem::getProperties(const EntityPropertyFlags& des
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebEntityItem::setProperties(const EntityItemProperties& properties) {
|
bool WebEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(color, setColor);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(alpha, setAlpha);
|
||||||
|
@ -83,17 +82,6 @@ bool WebEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(inputMode, setInputMode);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(inputMode, setInputMode);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(showKeyboardFocusHighlight, setShowKeyboardFocusHighlight);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(showKeyboardFocusHighlight, setShowKeyboardFocusHighlight);
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "WebEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties._lastEdited);
|
|
||||||
}
|
|
||||||
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
||||||
|
|
|
@ -76,26 +76,8 @@ EntityItemProperties ZoneEntityItem::getProperties(const EntityPropertyFlags& de
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneEntityItem::setProperties(const EntityItemProperties& properties) {
|
|
||||||
bool somethingChanged = false;
|
|
||||||
somethingChanged = EntityItem::setProperties(properties); // set the properties in our base class
|
|
||||||
|
|
||||||
if (somethingChanged) {
|
|
||||||
bool wantDebug = false;
|
|
||||||
if (wantDebug) {
|
|
||||||
uint64_t now = usecTimestampNow();
|
|
||||||
int elapsed = now - getLastEdited();
|
|
||||||
qCDebug(entities) << "ZoneEntityItem::setProperties() AFTER update... edited AGO=" << elapsed <<
|
|
||||||
"now=" << now << " getLastEdited()=" << getLastEdited();
|
|
||||||
}
|
|
||||||
setLastEdited(properties._lastEdited);
|
|
||||||
}
|
|
||||||
|
|
||||||
return somethingChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ZoneEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
bool ZoneEntityItem::setSubClassProperties(const EntityItemProperties& properties) {
|
||||||
bool somethingChanged = EntityItem::setSubClassProperties(properties); // set the properties in our base class
|
bool somethingChanged = false;
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shapeType, setShapeType);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(shapeType, setShapeType);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(compoundShapeURL, setCompoundShapeURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(compoundShapeURL, setCompoundShapeURL);
|
||||||
|
@ -121,7 +103,7 @@ bool ZoneEntityItem::setSubClassProperties(const EntityItemProperties& propertie
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(avatarPriority, setAvatarPriority);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(avatarPriority, setAvatarPriority);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(screenshare, setScreenshare);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(screenshare, setScreenshare);
|
||||||
|
|
||||||
somethingChanged = somethingChanged || _keyLightPropertiesChanged || _ambientLightPropertiesChanged ||
|
somethingChanged |= _keyLightPropertiesChanged || _ambientLightPropertiesChanged ||
|
||||||
_skyboxPropertiesChanged || _hazePropertiesChanged || _bloomPropertiesChanged;
|
_skyboxPropertiesChanged || _hazePropertiesChanged || _bloomPropertiesChanged;
|
||||||
|
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
|
|
|
@ -33,7 +33,6 @@ public:
|
||||||
|
|
||||||
// methods for getting/setting all properties of an entity
|
// methods for getting/setting all properties of an entity
|
||||||
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
virtual EntityItemProperties getProperties(const EntityPropertyFlags& desiredProperties, bool allowEmptyDesiredProperties) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
|
||||||
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
virtual bool setSubClassProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
||||||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const override;
|
||||||
|
|
|
@ -685,8 +685,9 @@ bool Octree::readFromFile(const char* fileName) {
|
||||||
QDataStream fileInputStream(&file);
|
QDataStream fileInputStream(&file);
|
||||||
QFileInfo fileInfo(qFileName);
|
QFileInfo fileInfo(qFileName);
|
||||||
uint64_t fileLength = fileInfo.size();
|
uint64_t fileLength = fileInfo.size();
|
||||||
|
QUrl relativeURL = QUrl::fromLocalFile(qFileName).adjusted(QUrl::RemoveFilename);
|
||||||
|
|
||||||
bool success = readFromStream(fileLength, fileInputStream);
|
bool success = readFromStream(fileLength, fileInputStream, "", false, relativeURL);
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
@ -708,7 +709,9 @@ bool Octree::readJSONFromGzippedFile(QString qFileName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream jsonStream(jsonData);
|
QDataStream jsonStream(jsonData);
|
||||||
return readJSONFromStream(-1, jsonStream);
|
QUrl relativeURL = QUrl::fromLocalFile(qFileName).adjusted(QUrl::RemoveFilename);
|
||||||
|
|
||||||
|
return readJSONFromStream(-1, jsonStream, "", false, relativeURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack to get the marketplace id into the entities. We will create a way to get this from a hash of
|
// hack to get the marketplace id into the entities. We will create a way to get this from a hash of
|
||||||
|
@ -761,13 +764,15 @@ bool Octree::readFromURL(
|
||||||
QByteArray uncompressedJsonData;
|
QByteArray uncompressedJsonData;
|
||||||
bool wasCompressed = gunzip(data, uncompressedJsonData);
|
bool wasCompressed = gunzip(data, uncompressedJsonData);
|
||||||
|
|
||||||
|
QUrl relativeURL = QUrl(urlString).adjusted(QUrl::RemoveFilename);
|
||||||
|
|
||||||
if (wasCompressed) {
|
if (wasCompressed) {
|
||||||
QDataStream inputStream(uncompressedJsonData);
|
QDataStream inputStream(uncompressedJsonData);
|
||||||
return readFromStream(uncompressedJsonData.size(), inputStream, marketplaceID);
|
return readFromStream(uncompressedJsonData.size(), inputStream, marketplaceID, isImport, relativeURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream inputStream(data);
|
QDataStream inputStream(data);
|
||||||
return readFromStream(data.size(), inputStream, marketplaceID, isImport);
|
return readFromStream(data.size(), inputStream, marketplaceID, isImport, relativeURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Octree::readFromByteArray(
|
bool Octree::readFromByteArray(
|
||||||
|
@ -780,20 +785,23 @@ bool Octree::readFromByteArray(
|
||||||
QByteArray uncompressedJsonData;
|
QByteArray uncompressedJsonData;
|
||||||
bool wasCompressed = gunzip(data, uncompressedJsonData);
|
bool wasCompressed = gunzip(data, uncompressedJsonData);
|
||||||
|
|
||||||
|
QUrl relativeURL = QUrl(urlString).adjusted(QUrl::RemoveFilename);
|
||||||
|
|
||||||
if (wasCompressed) {
|
if (wasCompressed) {
|
||||||
QDataStream inputStream(uncompressedJsonData);
|
QDataStream inputStream(uncompressedJsonData);
|
||||||
return readFromStream(uncompressedJsonData.size(), inputStream, marketplaceID);
|
return readFromStream(uncompressedJsonData.size(), inputStream, marketplaceID, false, relativeURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream inputStream(data);
|
QDataStream inputStream(data);
|
||||||
return readFromStream(data.size(), inputStream, marketplaceID);
|
return readFromStream(data.size(), inputStream, marketplaceID, false, relativeURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Octree::readFromStream(
|
bool Octree::readFromStream(
|
||||||
uint64_t streamLength,
|
uint64_t streamLength,
|
||||||
QDataStream& inputStream,
|
QDataStream& inputStream,
|
||||||
const QString& marketplaceID,
|
const QString& marketplaceID,
|
||||||
const bool isImport
|
const bool isImport,
|
||||||
|
const QUrl& relativeURL
|
||||||
) {
|
) {
|
||||||
// decide if this is binary SVO or JSON-formatted SVO
|
// decide if this is binary SVO or JSON-formatted SVO
|
||||||
QIODevice *device = inputStream.device();
|
QIODevice *device = inputStream.device();
|
||||||
|
@ -806,7 +814,7 @@ bool Octree::readFromStream(
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
qCDebug(octree) << "Reading from JSON SVO Stream length:" << streamLength;
|
qCDebug(octree) << "Reading from JSON SVO Stream length:" << streamLength;
|
||||||
return readJSONFromStream(streamLength, inputStream, marketplaceID, isImport);
|
return readJSONFromStream(streamLength, inputStream, marketplaceID, isImport, relativeURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -837,7 +845,8 @@ bool Octree::readJSONFromStream(
|
||||||
uint64_t streamLength,
|
uint64_t streamLength,
|
||||||
QDataStream& inputStream,
|
QDataStream& inputStream,
|
||||||
const QString& marketplaceID, /*=""*/
|
const QString& marketplaceID, /*=""*/
|
||||||
const bool isImport
|
const bool isImport,
|
||||||
|
const QUrl& relativeURL
|
||||||
) {
|
) {
|
||||||
// if the data is gzipped we may not have a useful bytesAvailable() result, so just keep reading until
|
// if the data is gzipped we may not have a useful bytesAvailable() result, so just keep reading until
|
||||||
// we get an eof. Leave streamLength parameter for consistency.
|
// we get an eof. Leave streamLength parameter for consistency.
|
||||||
|
@ -858,7 +867,9 @@ bool Octree::readJSONFromStream(
|
||||||
}
|
}
|
||||||
|
|
||||||
OctreeEntitiesFileParser octreeParser;
|
OctreeEntitiesFileParser octreeParser;
|
||||||
|
octreeParser.relativeURL = relativeURL;
|
||||||
octreeParser.setEntitiesString(jsonBuffer);
|
octreeParser.setEntitiesString(jsonBuffer);
|
||||||
|
|
||||||
QVariantMap asMap;
|
QVariantMap asMap;
|
||||||
if (!octreeParser.parseEntities(asMap)) {
|
if (!octreeParser.parseEntities(asMap)) {
|
||||||
qCritical() << "Couldn't parse Entities JSON:" << octreeParser.getErrorString().c_str();
|
qCritical() << "Couldn't parse Entities JSON:" << octreeParser.getErrorString().c_str();
|
||||||
|
|
|
@ -218,8 +218,8 @@ public:
|
||||||
bool readFromFile(const char* filename);
|
bool readFromFile(const char* filename);
|
||||||
bool readFromURL(const QString& url, const bool isObservable = true, const qint64 callerId = -1, const bool isImport = false); // will support file urls as well...
|
bool readFromURL(const QString& url, const bool isObservable = true, const qint64 callerId = -1, const bool isImport = false); // will support file urls as well...
|
||||||
bool readFromByteArray(const QString& url, const QByteArray& byteArray);
|
bool readFromByteArray(const QString& url, const QByteArray& byteArray);
|
||||||
bool readFromStream(uint64_t streamLength, QDataStream& inputStream, const QString& marketplaceID="", const bool isImport = false);
|
bool readFromStream(uint64_t streamLength, QDataStream& inputStream, const QString& marketplaceID="", const bool isImport = false, const QUrl& urlString = QUrl());
|
||||||
bool readJSONFromStream(uint64_t streamLength, QDataStream& inputStream, const QString& marketplaceID="", const bool isImport = false);
|
bool readJSONFromStream(uint64_t streamLength, QDataStream& inputStream, const QString& marketplaceID="", const bool isImport = false, const QUrl& urlString = QUrl());
|
||||||
bool readJSONFromGzippedFile(QString qFileName);
|
bool readJSONFromGzippedFile(QString qFileName);
|
||||||
virtual bool readFromMap(QVariantMap& entityDescription, const bool isImport = false) = 0;
|
virtual bool readFromMap(QVariantMap& entityDescription, const bool isImport = false) = 0;
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,75 @@ bool OctreeEntitiesFileParser::readEntitiesArray(QVariantList& entitiesArray) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
entitiesArray.append(entity.object());
|
QJsonObject entityObject = entity.object();
|
||||||
|
|
||||||
|
// resolve urls starting with ./ or ../
|
||||||
|
if (relativeURL.isEmpty() == false) {
|
||||||
|
bool isDirty = false;
|
||||||
|
|
||||||
|
const QStringList urlKeys {
|
||||||
|
// model
|
||||||
|
"modelURL",
|
||||||
|
"animation.url",
|
||||||
|
// image
|
||||||
|
"imageURL",
|
||||||
|
// web
|
||||||
|
"sourceUrl",
|
||||||
|
"scriptURL",
|
||||||
|
// zone
|
||||||
|
"ambientLight.ambientURL",
|
||||||
|
"skybox.url",
|
||||||
|
// particles
|
||||||
|
"textures",
|
||||||
|
// materials
|
||||||
|
"materialURL",
|
||||||
|
// ...shared
|
||||||
|
"href",
|
||||||
|
"script",
|
||||||
|
"serverScripts",
|
||||||
|
"collisionSoundURL",
|
||||||
|
"compoundShapeURL",
|
||||||
|
// TODO: deal with materialData and userData
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const QString& key : urlKeys) {
|
||||||
|
if (key.contains('.')) {
|
||||||
|
// url is inside another object
|
||||||
|
const QStringList keyPair = key.split('.');
|
||||||
|
const QString entityKey = keyPair[0];
|
||||||
|
const QString childKey = keyPair[1];
|
||||||
|
|
||||||
|
if (entityObject.contains(entityKey) && entityObject[entityKey].isObject()) {
|
||||||
|
QJsonObject childObject = entityObject[entityKey].toObject();
|
||||||
|
|
||||||
|
if (childObject.contains(childKey) && childObject[childKey].isString()) {
|
||||||
|
const QString url = childObject[childKey].toString();
|
||||||
|
|
||||||
|
if (url.startsWith("./") || url.startsWith("../")) {
|
||||||
|
childObject[childKey] = relativeURL.resolved(url).toString();
|
||||||
|
entityObject[entityKey] = childObject;
|
||||||
|
isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (entityObject.contains(key) && entityObject[key].isString()) {
|
||||||
|
const QString url = entityObject[key].toString();
|
||||||
|
|
||||||
|
if (url.startsWith("./") || url.startsWith("../")) {
|
||||||
|
entityObject[key] = relativeURL.resolved(url).toString();
|
||||||
|
isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDirty) {
|
||||||
|
entity.setObject(entityObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
entitiesArray.append(entityObject);
|
||||||
_position = matchingBrace;
|
_position = matchingBrace;
|
||||||
char c = nextToken();
|
char c = nextToken();
|
||||||
if (c == ']') {
|
if (c == ']') {
|
||||||
|
|
|
@ -16,12 +16,14 @@
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
class OctreeEntitiesFileParser {
|
class OctreeEntitiesFileParser {
|
||||||
public:
|
public:
|
||||||
void setEntitiesString(const QByteArray& entitiesContents);
|
void setEntitiesString(const QByteArray& entitiesContents);
|
||||||
bool parseEntities(QVariantMap& parsedEntities);
|
bool parseEntities(QVariantMap& parsedEntities);
|
||||||
std::string getErrorString() const;
|
std::string getErrorString() const;
|
||||||
|
QUrl relativeURL;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nextToken();
|
int nextToken();
|
||||||
|
|
|
@ -961,7 +961,7 @@ void Model::setCauterized(bool cauterized, const render::ScenePointer& scene) {
|
||||||
void Model::setPrimitiveMode(PrimitiveMode primitiveMode) {
|
void Model::setPrimitiveMode(PrimitiveMode primitiveMode) {
|
||||||
if (_primitiveMode != primitiveMode) {
|
if (_primitiveMode != primitiveMode) {
|
||||||
_primitiveMode = primitiveMode;
|
_primitiveMode = primitiveMode;
|
||||||
setRenderItemsNeedUpdate();
|
updateRenderItemsKey(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,9 @@ public:
|
||||||
bool isCauterized() const { return _cauterized; }
|
bool isCauterized() const { return _cauterized; }
|
||||||
void setCauterized(bool value, const render::ScenePointer& scene);
|
void setCauterized(bool value, const render::ScenePointer& scene);
|
||||||
|
|
||||||
|
void setPrimitiveMode(PrimitiveMode primitiveMode);
|
||||||
|
PrimitiveMode getPrimitiveMode() const { return _primitiveMode; }
|
||||||
|
|
||||||
void setCullWithParent(bool value);
|
void setCullWithParent(bool value);
|
||||||
|
|
||||||
void setRenderWithZones(const QVector<QUuid>& renderWithZones);
|
void setRenderWithZones(const QVector<QUuid>& renderWithZones);
|
||||||
|
@ -160,9 +163,6 @@ public:
|
||||||
bool isLoaded() const { return (bool)_renderGeometry && _renderGeometry->isHFMModelLoaded(); }
|
bool isLoaded() const { return (bool)_renderGeometry && _renderGeometry->isHFMModelLoaded(); }
|
||||||
bool isAddedToScene() const { return _addedToScene; }
|
bool isAddedToScene() const { return _addedToScene; }
|
||||||
|
|
||||||
void setPrimitiveMode(PrimitiveMode primitiveMode);
|
|
||||||
PrimitiveMode getPrimitiveMode() const { return _primitiveMode; }
|
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
void setSnapModelToRegistrationPoint(bool snapModelToRegistrationPoint, const glm::vec3& registrationPoint);
|
void setSnapModelToRegistrationPoint(bool snapModelToRegistrationPoint, const glm::vec3& registrationPoint);
|
||||||
|
|
|
@ -319,7 +319,7 @@
|
||||||
"tooltip": "The finish color of each particle."
|
"tooltip": "The finish color of each particle."
|
||||||
},
|
},
|
||||||
"colorSpread": {
|
"colorSpread": {
|
||||||
"tooltip": "The spread in color that each particle is given, resulting in a variety of colors."
|
"tooltip": "The spread in color that each particle is given, resulting in a variety of colors. The variation range (-/+) on each RGB channel to use around the RGB values of the particle color."
|
||||||
},
|
},
|
||||||
"particleAlphaTriple": {
|
"particleAlphaTriple": {
|
||||||
"tooltip": "The opacity of each particle between 0.0 fully transparent and 1.0 completely opaque.",
|
"tooltip": "The opacity of each particle between 0.0 fully transparent and 1.0 completely opaque.",
|
||||||
|
@ -531,7 +531,7 @@
|
||||||
"tooltip": "If enabled, grabbed entities will follow the movements of your hand controller instead of your avatar's hand."
|
"tooltip": "If enabled, grabbed entities will follow the movements of your hand controller instead of your avatar's hand."
|
||||||
},
|
},
|
||||||
"canCastShadow": {
|
"canCastShadow": {
|
||||||
"tooltip": "If enabled, the geometry of this entity casts shadows when a shadow-casting light source shines on it. Note: Shadows are rendered only on high-profiled computers. This setting will have no effect on computers profiled to medium or low graphics.."
|
"tooltip": "If enabled, the geometry of this entity casts shadows when a shadow-casting light source shines on it. Note: Shadows are rendered only on high-profiled computers. This setting will have no effect on computers profiled to medium or low graphics."
|
||||||
},
|
},
|
||||||
"ignorePickIntersection": {
|
"ignorePickIntersection": {
|
||||||
"tooltip": "If enabled, this entity will not be considered for ray picks, and will also not occlude other entities when picking."
|
"tooltip": "If enabled, this entity will not be considered for ray picks, and will also not occlude other entities when picking."
|
||||||
|
@ -569,13 +569,13 @@
|
||||||
"tooltip": "The linear velocity vector of the entity. The velocity at which this entity moves forward in space."
|
"tooltip": "The linear velocity vector of the entity. The velocity at which this entity moves forward in space."
|
||||||
},
|
},
|
||||||
"damping": {
|
"damping": {
|
||||||
"tooltip": "The linear damping to slow down the linear velocity of an entity over time."
|
"tooltip": "The linear damping to slow down the linear velocity of an entity over time. A higher damping value slows down the entity more quickly. The default value is for an exponential decay timescale of 2.0s, where it takes 2.0s for the movement to slow to 1/e = 0.368 of its initial value."
|
||||||
},
|
},
|
||||||
"localAngularVelocity": {
|
"localAngularVelocity": {
|
||||||
"tooltip": "The angular velocity of the entity in rad/s with respect to its axes, about its pivot point."
|
"tooltip": "The angular velocity of the entity in 'deg/s' with respect to its axes, about its pivot point."
|
||||||
},
|
},
|
||||||
"angularDamping": {
|
"angularDamping": {
|
||||||
"tooltip": "The angular damping to slow down the angular velocity of an entity over time."
|
"tooltip": "The angular damping to slow down the angular velocity of an entity over time. A higher damping value slows down the entity more quickly. The default value is for an exponential decay timescale of 2.0s, where it takes 2.0s for the movement to slow to 1/e = 0.368 of its initial value."
|
||||||
},
|
},
|
||||||
"restitution": {
|
"restitution": {
|
||||||
"tooltip": "If enabled, the entity can bounce against other objects that also have Bounciness."
|
"tooltip": "If enabled, the entity can bounce against other objects that also have Bounciness."
|
||||||
|
|
|
@ -1133,7 +1133,13 @@ const GROUPS = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Color Spread",
|
label: "Color Spread",
|
||||||
type: "color",
|
type: "vec3rgb",
|
||||||
|
vec3Type: "vec3rgb",
|
||||||
|
min: 0,
|
||||||
|
max: 255,
|
||||||
|
step: 1,
|
||||||
|
decimals: 0,
|
||||||
|
subLabels: [ "r", "g", "b" ],
|
||||||
propertyID: "colorSpread",
|
propertyID: "colorSpread",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1651,16 +1657,6 @@ const GROUPS = [
|
||||||
decimals: 4,
|
decimals: 4,
|
||||||
unit: "m/s<sup>2</sup>",
|
unit: "m/s<sup>2</sup>",
|
||||||
propertyID: "gravity",
|
propertyID: "gravity",
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Acceleration",
|
|
||||||
type: "vec3",
|
|
||||||
vec3Type: "xyz",
|
|
||||||
subLabels: [ "x", "y", "z" ],
|
|
||||||
step: 0.1,
|
|
||||||
decimals: 4,
|
|
||||||
unit: "m/s<sup>2</sup>",
|
|
||||||
propertyID: "acceleration",
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1791,6 +1787,8 @@ function getPropertyInputElement(propertyID) {
|
||||||
return { x: property.elNumberX.elInput, y: property.elNumberY.elInput, z: property.elNumberZ.elInput };
|
return { x: property.elNumberX.elInput, y: property.elNumberY.elInput, z: property.elNumberZ.elInput };
|
||||||
case 'color':
|
case 'color':
|
||||||
return { red: property.elNumberR.elInput, green: property.elNumberG.elInput, blue: property.elNumberB.elInput };
|
return { red: property.elNumberR.elInput, green: property.elNumberG.elInput, blue: property.elNumberB.elInput };
|
||||||
|
case 'vec3rgb':
|
||||||
|
return { red: property.elNumberR.elInput, green: property.elNumberG.elInput, blue: property.elNumberB.elInput };
|
||||||
case 'icon':
|
case 'icon':
|
||||||
return property.elLabel;
|
return property.elLabel;
|
||||||
case 'dynamic-multiselect':
|
case 'dynamic-multiselect':
|
||||||
|
@ -1889,6 +1887,12 @@ function resetProperties() {
|
||||||
property.elNumberB.setValue("", false);
|
property.elNumberB.setValue("", false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'vec3rgb': {
|
||||||
|
property.elNumberR.setValue("", false);
|
||||||
|
property.elNumberG.setValue("", false);
|
||||||
|
property.elNumberB.setValue("", false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'dropdown': {
|
case 'dropdown': {
|
||||||
property.elInput.classList.remove('multi-diff');
|
property.elInput.classList.remove('multi-diff');
|
||||||
property.elInput.value = "";
|
property.elInput.value = "";
|
||||||
|
@ -1995,7 +1999,7 @@ function isCurrentlyDraggingProperty(propertyName) {
|
||||||
return properties[propertyName] && properties[propertyName].dragging === true;
|
return properties[propertyName] && properties[propertyName].dragging === true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SUPPORTED_FALLBACK_TYPES = ['number', 'number-draggable', 'rect', 'vec3', 'vec2', 'color'];
|
const SUPPORTED_FALLBACK_TYPES = ['number', 'number-draggable', 'rect', 'vec3', 'vec2', 'color', 'vec3rgb'];
|
||||||
|
|
||||||
function getMultiplePropertyValue(originalPropertyName) {
|
function getMultiplePropertyValue(originalPropertyName) {
|
||||||
// if this is a compound property name (i.e. animation.running)
|
// if this is a compound property name (i.e. animation.running)
|
||||||
|
@ -2051,6 +2055,9 @@ function getMultiplePropertyValue(originalPropertyName) {
|
||||||
case 'color':
|
case 'color':
|
||||||
isPropertyNotNumber = isNaN(propertyValue.red) || propertyValue.red === null;
|
isPropertyNotNumber = isNaN(propertyValue.red) || propertyValue.red === null;
|
||||||
break;
|
break;
|
||||||
|
case 'vec3rgb':
|
||||||
|
isPropertyNotNumber = isNaN(propertyValue.red) || propertyValue.red === null;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (isPropertyNotNumber) {
|
if (isPropertyNotNumber) {
|
||||||
if (fallbackMultiValue === null) {
|
if (fallbackMultiValue === null) {
|
||||||
|
@ -2662,6 +2669,33 @@ function createVec3Property(property, elProperty) {
|
||||||
return elResult;
|
return elResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createVec3rgbProperty(property, elProperty) {
|
||||||
|
let propertyData = property.data;
|
||||||
|
|
||||||
|
elProperty.className = propertyData.vec3Type + " fstuple";
|
||||||
|
|
||||||
|
let elNumberR = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.X_NUMBER]);
|
||||||
|
let elNumberG = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.Y_NUMBER]);
|
||||||
|
let elNumberB = createTupleNumberInput(property, propertyData.subLabels[VECTOR_ELEMENTS.Z_NUMBER]);
|
||||||
|
elProperty.appendChild(elNumberR.elDiv);
|
||||||
|
elProperty.appendChild(elNumberG.elDiv);
|
||||||
|
elProperty.appendChild(elNumberB.elDiv);
|
||||||
|
|
||||||
|
elNumberR.setValueChangeFunction(createEmitNumberPropertyComponentUpdateFunction(property, 'red'));
|
||||||
|
elNumberG.setValueChangeFunction(createEmitNumberPropertyComponentUpdateFunction(property, 'green'));
|
||||||
|
elNumberB.setValueChangeFunction(createEmitNumberPropertyComponentUpdateFunction(property, 'blue'));
|
||||||
|
|
||||||
|
elNumberR.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'red'));
|
||||||
|
elNumberG.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'green'));
|
||||||
|
elNumberB.setMultiDiffStepFunction(createMultiDiffStepFunction(property, 'blue'));
|
||||||
|
|
||||||
|
let elResult = [];
|
||||||
|
elResult[VECTOR_ELEMENTS.X_NUMBER] = elNumberR;
|
||||||
|
elResult[VECTOR_ELEMENTS.Y_NUMBER] = elNumberG;
|
||||||
|
elResult[VECTOR_ELEMENTS.Z_NUMBER] = elNumberB;
|
||||||
|
return elResult;
|
||||||
|
}
|
||||||
|
|
||||||
function createVec2Property(property, elProperty) {
|
function createVec2Property(property, elProperty) {
|
||||||
let propertyData = property.data;
|
let propertyData = property.data;
|
||||||
|
|
||||||
|
@ -2856,7 +2890,7 @@ function createTextureProperty(property, elProperty) {
|
||||||
|
|
||||||
let imageLoad = function(url) {
|
let imageLoad = function(url) {
|
||||||
elDiv.style.display = null;
|
elDiv.style.display = null;
|
||||||
if (url.slice(0, 5).toLowerCase() === "atp:/") {
|
if (url.slice(0, 5).toLowerCase() === "atp:/" || url.slice(0, 9).toLowerCase() === "file:///~") {
|
||||||
elImage.src = "";
|
elImage.src = "";
|
||||||
elImage.style.display = "none";
|
elImage.style.display = "none";
|
||||||
elDiv.classList.remove("with-texture");
|
elDiv.classList.remove("with-texture");
|
||||||
|
@ -3048,6 +3082,13 @@ function createProperty(propertyData, propertyElementID, propertyName, propertyI
|
||||||
property.elNumberB = elColor[COLOR_ELEMENTS.BLUE_NUMBER];
|
property.elNumberB = elColor[COLOR_ELEMENTS.BLUE_NUMBER];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'vec3rgb': {
|
||||||
|
let elVec3 = createVec3rgbProperty(property, elProperty);
|
||||||
|
property.elNumberR = elVec3[VECTOR_ELEMENTS.X_NUMBER];
|
||||||
|
property.elNumberG = elVec3[VECTOR_ELEMENTS.Y_NUMBER];
|
||||||
|
property.elNumberB = elVec3[VECTOR_ELEMENTS.Z_NUMBER];
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'dropdown': {
|
case 'dropdown': {
|
||||||
property.elInput = createDropdownProperty(property, propertyID, elProperty);
|
property.elInput = createDropdownProperty(property, propertyID, elProperty);
|
||||||
break;
|
break;
|
||||||
|
@ -4096,6 +4137,13 @@ function handleEntitySelectionUpdate(selections, isPropertiesToolUpdate) {
|
||||||
property.elNumberB.setValue(displayColor.blue);
|
property.elNumberB.setValue(displayColor.blue);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'vec3rgb': {
|
||||||
|
let detailedNumberDiff = getDetailedNumberMPVDiff(propertyMultiValue, propertyData);
|
||||||
|
property.elNumberR.setValue(detailedNumberDiff.averagePerPropertyComponent.red, detailedNumberDiff.propertyComponentDiff.red);
|
||||||
|
property.elNumberG.setValue(detailedNumberDiff.averagePerPropertyComponent.green, detailedNumberDiff.propertyComponentDiff.green);
|
||||||
|
property.elNumberB.setValue(detailedNumberDiff.averagePerPropertyComponent.blue, detailedNumberDiff.propertyComponentDiff.blue);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'dropdown': {
|
case 'dropdown': {
|
||||||
property.elInput.classList.toggle('multi-diff', isMultiDiffValue);
|
property.elInput.classList.toggle('multi-diff', isMultiDiffValue);
|
||||||
property.elInput.value = isMultiDiffValue ? "" : propertyValue;
|
property.elInput.value = isMultiDiffValue ? "" : propertyValue;
|
||||||
|
@ -4350,7 +4398,8 @@ function loaded() {
|
||||||
properties[propertyID] = property;
|
properties[propertyID] = property;
|
||||||
}
|
}
|
||||||
if (propertyData.type === 'number' || propertyData.type === 'number-draggable' ||
|
if (propertyData.type === 'number' || propertyData.type === 'number-draggable' ||
|
||||||
propertyData.type === 'vec2' || propertyData.type === 'vec3' || propertyData.type === 'rect') {
|
propertyData.type === 'vec2' || propertyData.type === 'vec3' ||
|
||||||
|
propertyData.type === 'rect' || propertyData.type === 'vec3rgb') {
|
||||||
propertyRangeRequests.push(propertyID);
|
propertyRangeRequests.push(propertyID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4435,6 +4484,9 @@ function loaded() {
|
||||||
case 'vec2':
|
case 'vec2':
|
||||||
updateVectorMinMax(properties[property]);
|
updateVectorMinMax(properties[property]);
|
||||||
break;
|
break;
|
||||||
|
case 'vec3rgb':
|
||||||
|
updateVectorMinMax(properties[property]);
|
||||||
|
break;
|
||||||
case 'rect':
|
case 'rect':
|
||||||
updateRectMinMax(properties[property]);
|
updateRectMinMax(properties[property]);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1688,17 +1688,17 @@ input.rename-entity {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
.fstuple label.red, .fstuple label.x, .fstuple label.w {
|
.fstuple label.red, .fstuple label.r, .fstuple label.x, .fstuple label.w {
|
||||||
color: #C62147;
|
color: #C62147;
|
||||||
}
|
}
|
||||||
.fstuple label.green, .fstuple label.y, .fstuple label.h {
|
.fstuple label.green, .fstuple label.g, .fstuple label.y, .fstuple label.h {
|
||||||
color: #359D85;
|
color: #359D85;
|
||||||
}
|
}
|
||||||
.fstuple label.blue, .fstuple label.z {
|
.fstuple label.blue, .fstuple label.b, .fstuple label.z {
|
||||||
color: #0093C5;
|
color: #0093C5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.xyz.fstuple, .pyr.fstuple {
|
.xyz.fstuple, .pyr.fstuple, .vec3rgb.fstuple {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: -12px;
|
left: -12px;
|
||||||
min-width: 50px;
|
min-width: 50px;
|
||||||
|
|
Loading…
Reference in a new issue