mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:00:36 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into unit-scaled-address-bar
This commit is contained in:
commit
0dd5c65036
33 changed files with 338 additions and 33 deletions
|
@ -246,6 +246,16 @@ Item {
|
||||||
text: "Triangles: " + root.triangles +
|
text: "Triangles: " + root.triangles +
|
||||||
" / Material Switches: " + root.materialSwitches
|
" / Material Switches: " + root.materialSwitches
|
||||||
}
|
}
|
||||||
|
Text {
|
||||||
|
color: root.fontColor;
|
||||||
|
font.pixelSize: root.fontSize
|
||||||
|
text: "GPU Textures: " + root.gpuTextures;
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
color: root.fontColor;
|
||||||
|
font.pixelSize: root.fontSize
|
||||||
|
text: "GPU Buffers: " + root.gpuBuffers;
|
||||||
|
}
|
||||||
Text {
|
Text {
|
||||||
color: root.fontColor;
|
color: root.fontColor;
|
||||||
font.pixelSize: root.fontSize
|
font.pixelSize: root.fontSize
|
||||||
|
|
|
@ -87,6 +87,8 @@ ModalWindow {
|
||||||
|
|
||||||
if (selectDirectory) {
|
if (selectDirectory) {
|
||||||
currentSelection.text = d.capitalizeDrive(helper.urlToPath(initialFolder));
|
currentSelection.text = d.capitalizeDrive(helper.urlToPath(initialFolder));
|
||||||
|
d.currentSelectionIsFolder = true;
|
||||||
|
d.currentSelectionUrl = initialFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.contentsChanged.connect(function() {
|
helper.contentsChanged.connect(function() {
|
||||||
|
|
|
@ -3701,7 +3701,18 @@ void Application::setKeyboardFocusEntity(QUuid id) {
|
||||||
void Application::setKeyboardFocusEntity(EntityItemID entityItemID) {
|
void Application::setKeyboardFocusEntity(EntityItemID entityItemID) {
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
if (_keyboardFocusedItem.get() != entityItemID) {
|
if (_keyboardFocusedItem.get() != entityItemID) {
|
||||||
|
// reset focused entity
|
||||||
_keyboardFocusedItem.set(UNKNOWN_ENTITY_ID);
|
_keyboardFocusedItem.set(UNKNOWN_ENTITY_ID);
|
||||||
|
if (_keyboardFocusHighlight) {
|
||||||
|
_keyboardFocusHighlight->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if invalid, return without expensive (locking) operations
|
||||||
|
if (entityItemID == UNKNOWN_ENTITY_ID) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if valid, query properties
|
||||||
auto properties = entityScriptingInterface->getEntityProperties(entityItemID);
|
auto properties = entityScriptingInterface->getEntityProperties(entityItemID);
|
||||||
if (!properties.getLocked() && properties.getVisible()) {
|
if (!properties.getLocked() && properties.getVisible()) {
|
||||||
auto entity = getEntities()->getTree()->findEntityByID(entityItemID);
|
auto entity = getEntities()->getTree()->findEntityByID(entityItemID);
|
||||||
|
@ -3712,6 +3723,8 @@ void Application::setKeyboardFocusEntity(EntityItemID entityItemID) {
|
||||||
}
|
}
|
||||||
_keyboardFocusedItem.set(entityItemID);
|
_keyboardFocusedItem.set(entityItemID);
|
||||||
_lastAcceptedKeyPress = usecTimestampNow();
|
_lastAcceptedKeyPress = usecTimestampNow();
|
||||||
|
|
||||||
|
// create a focus
|
||||||
if (_keyboardFocusHighlightID < 0 || !getOverlays().isAddedOverlay(_keyboardFocusHighlightID)) {
|
if (_keyboardFocusHighlightID < 0 || !getOverlays().isAddedOverlay(_keyboardFocusHighlightID)) {
|
||||||
_keyboardFocusHighlight = std::make_shared<Cube3DOverlay>();
|
_keyboardFocusHighlight = std::make_shared<Cube3DOverlay>();
|
||||||
_keyboardFocusHighlight->setAlpha(1.0f);
|
_keyboardFocusHighlight->setAlpha(1.0f);
|
||||||
|
@ -3723,17 +3736,16 @@ void Application::setKeyboardFocusEntity(EntityItemID entityItemID) {
|
||||||
_keyboardFocusHighlight->setColorPulse(1.0);
|
_keyboardFocusHighlight->setColorPulse(1.0);
|
||||||
_keyboardFocusHighlight->setIgnoreRayIntersection(true);
|
_keyboardFocusHighlight->setIgnoreRayIntersection(true);
|
||||||
_keyboardFocusHighlight->setDrawInFront(false);
|
_keyboardFocusHighlight->setDrawInFront(false);
|
||||||
|
_keyboardFocusHighlightID = getOverlays().addOverlay(_keyboardFocusHighlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// position the focus
|
||||||
_keyboardFocusHighlight->setRotation(entity->getRotation());
|
_keyboardFocusHighlight->setRotation(entity->getRotation());
|
||||||
_keyboardFocusHighlight->setPosition(entity->getPosition());
|
_keyboardFocusHighlight->setPosition(entity->getPosition());
|
||||||
_keyboardFocusHighlight->setDimensions(entity->getDimensions() * 1.05f);
|
_keyboardFocusHighlight->setDimensions(entity->getDimensions() * 1.05f);
|
||||||
_keyboardFocusHighlight->setVisible(true);
|
_keyboardFocusHighlight->setVisible(true);
|
||||||
_keyboardFocusHighlightID = getOverlays().addOverlay(_keyboardFocusHighlight);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_keyboardFocusedItem.get() == UNKNOWN_ENTITY_ID && _keyboardFocusHighlight) {
|
|
||||||
_keyboardFocusHighlight->setVisible(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ void ConnectionMonitor::init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||||
connect(&_timer, &QTimer::timeout, dialogsManager.data(), &DialogsManager::showAddressBar);
|
connect(&_timer, &QTimer::timeout, dialogsManager.data(), &DialogsManager::indicateDomainConnectionFailure);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionMonitor::disconnectedFromDomain() {
|
void ConnectionMonitor::disconnectedFromDomain() {
|
||||||
|
|
|
@ -59,6 +59,10 @@ void DialogsManager::showFeed() {
|
||||||
emit setUseFeed(true);
|
emit setUseFeed(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogsManager::indicateDomainConnectionFailure() {
|
||||||
|
OffscreenUi::information("No Connection", "Unable to connect to this domain. Click the 'GO TO' button on the toolbar to visit another domain.");
|
||||||
|
}
|
||||||
|
|
||||||
void DialogsManager::toggleDiskCacheEditor() {
|
void DialogsManager::toggleDiskCacheEditor() {
|
||||||
maybeCreateDialog(_diskCacheEditor);
|
maybeCreateDialog(_diskCacheEditor);
|
||||||
_diskCacheEditor->toggle();
|
_diskCacheEditor->toggle();
|
||||||
|
|
|
@ -46,6 +46,7 @@ public slots:
|
||||||
void toggleAddressBar();
|
void toggleAddressBar();
|
||||||
void showAddressBar();
|
void showAddressBar();
|
||||||
void showFeed();
|
void showFeed();
|
||||||
|
void indicateDomainConnectionFailure();
|
||||||
void toggleDiskCacheEditor();
|
void toggleDiskCacheEditor();
|
||||||
void toggleLoginDialog();
|
void toggleLoginDialog();
|
||||||
void showLoginDialog();
|
void showLoginDialog();
|
||||||
|
|
|
@ -285,6 +285,9 @@ void Stats::updateStats(bool force) {
|
||||||
STAT_UPDATE(sendingMode, sendingModeResult);
|
STAT_UPDATE(sendingMode, sendingModeResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STAT_UPDATE(gpuBuffers, (int)gpu::Context::getBufferGPUCount());
|
||||||
|
STAT_UPDATE(gpuTextures, (int)gpu::Context::getTextureGPUCount());
|
||||||
|
|
||||||
// Incoming packets
|
// Incoming packets
|
||||||
QLocale locale(QLocale::English);
|
QLocale locale(QLocale::English);
|
||||||
auto voxelPacketsToProcess = qApp->getOctreePacketProcessor().packetsToProcessCount();
|
auto voxelPacketsToProcess = qApp->getOctreePacketProcessor().packetsToProcessCount();
|
||||||
|
|
|
@ -89,6 +89,8 @@ class Stats : public QQuickItem {
|
||||||
STATS_PROPERTY(int, localElements, 0)
|
STATS_PROPERTY(int, localElements, 0)
|
||||||
STATS_PROPERTY(int, localInternal, 0)
|
STATS_PROPERTY(int, localInternal, 0)
|
||||||
STATS_PROPERTY(int, localLeaves, 0)
|
STATS_PROPERTY(int, localLeaves, 0)
|
||||||
|
STATS_PROPERTY(int, gpuBuffers, 0)
|
||||||
|
STATS_PROPERTY(int, gpuTextures, 0)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Stats* getInstance();
|
static Stats* getInstance();
|
||||||
|
@ -177,6 +179,8 @@ signals:
|
||||||
void localInternalChanged();
|
void localInternalChanged();
|
||||||
void localLeavesChanged();
|
void localLeavesChanged();
|
||||||
void timingStatsChanged();
|
void timingStatsChanged();
|
||||||
|
void gpuBuffersChanged();
|
||||||
|
void gpuTexturesChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int _recentMaxPackets{ 0 } ; // recent max incoming voxel packets to process
|
int _recentMaxPackets{ 0 } ; // recent max incoming voxel packets to process
|
||||||
|
|
|
@ -19,6 +19,7 @@ QString const Circle3DOverlay::TYPE = "circle3d";
|
||||||
Circle3DOverlay::Circle3DOverlay() {
|
Circle3DOverlay::Circle3DOverlay() {
|
||||||
memset(&_minorTickMarksColor, 0, sizeof(_minorTickMarksColor));
|
memset(&_minorTickMarksColor, 0, sizeof(_minorTickMarksColor));
|
||||||
memset(&_majorTickMarksColor, 0, sizeof(_majorTickMarksColor));
|
memset(&_majorTickMarksColor, 0, sizeof(_majorTickMarksColor));
|
||||||
|
qDebug() << "Building circle3d overlay";
|
||||||
}
|
}
|
||||||
|
|
||||||
Circle3DOverlay::Circle3DOverlay(const Circle3DOverlay* circle3DOverlay) :
|
Circle3DOverlay::Circle3DOverlay(const Circle3DOverlay* circle3DOverlay) :
|
||||||
|
@ -39,8 +40,27 @@ Circle3DOverlay::Circle3DOverlay(const Circle3DOverlay* circle3DOverlay) :
|
||||||
_majorTicksVerticesID(GeometryCache::UNKNOWN_ID),
|
_majorTicksVerticesID(GeometryCache::UNKNOWN_ID),
|
||||||
_minorTicksVerticesID(GeometryCache::UNKNOWN_ID)
|
_minorTicksVerticesID(GeometryCache::UNKNOWN_ID)
|
||||||
{
|
{
|
||||||
|
qDebug() << "Building circle3d overlay";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Circle3DOverlay::~Circle3DOverlay() {
|
||||||
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
|
if (geometryCache) {
|
||||||
|
if (_quadVerticesID) {
|
||||||
|
geometryCache->releaseID(_quadVerticesID);
|
||||||
|
}
|
||||||
|
if (_lineVerticesID) {
|
||||||
|
geometryCache->releaseID(_lineVerticesID);
|
||||||
|
}
|
||||||
|
if (_majorTicksVerticesID) {
|
||||||
|
geometryCache->releaseID(_majorTicksVerticesID);
|
||||||
|
}
|
||||||
|
if (_minorTicksVerticesID) {
|
||||||
|
geometryCache->releaseID(_minorTicksVerticesID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
qDebug() << "Destroying circle3d overlay";
|
||||||
|
}
|
||||||
void Circle3DOverlay::render(RenderArgs* args) {
|
void Circle3DOverlay::render(RenderArgs* args) {
|
||||||
if (!_visible) {
|
if (!_visible) {
|
||||||
return; // do nothing if we're not visible
|
return; // do nothing if we're not visible
|
||||||
|
|
|
@ -23,6 +23,7 @@ public:
|
||||||
|
|
||||||
Circle3DOverlay();
|
Circle3DOverlay();
|
||||||
Circle3DOverlay(const Circle3DOverlay* circle3DOverlay);
|
Circle3DOverlay(const Circle3DOverlay* circle3DOverlay);
|
||||||
|
~Circle3DOverlay();
|
||||||
|
|
||||||
virtual void render(RenderArgs* args) override;
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
|
|
|
@ -19,6 +19,7 @@ QString const Line3DOverlay::TYPE = "line3d";
|
||||||
Line3DOverlay::Line3DOverlay() :
|
Line3DOverlay::Line3DOverlay() :
|
||||||
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
|
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
|
||||||
{
|
{
|
||||||
|
qDebug() << "Building line3D overlay";
|
||||||
}
|
}
|
||||||
|
|
||||||
Line3DOverlay::Line3DOverlay(const Line3DOverlay* line3DOverlay) :
|
Line3DOverlay::Line3DOverlay(const Line3DOverlay* line3DOverlay) :
|
||||||
|
@ -27,9 +28,15 @@ Line3DOverlay::Line3DOverlay(const Line3DOverlay* line3DOverlay) :
|
||||||
_end(line3DOverlay->_end),
|
_end(line3DOverlay->_end),
|
||||||
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
|
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
|
||||||
{
|
{
|
||||||
|
qDebug() << "Building line3D overlay";
|
||||||
}
|
}
|
||||||
|
|
||||||
Line3DOverlay::~Line3DOverlay() {
|
Line3DOverlay::~Line3DOverlay() {
|
||||||
|
qDebug() << "Destryoing line3D overlay";
|
||||||
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
|
if (_geometryCacheID && geometryCache) {
|
||||||
|
geometryCache->releaseID(_geometryCacheID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 Line3DOverlay::getStart() const {
|
glm::vec3 Line3DOverlay::getStart() const {
|
||||||
|
@ -84,7 +91,6 @@ void Line3DOverlay::render(RenderArgs* args) {
|
||||||
xColor color = getColor();
|
xColor color = getColor();
|
||||||
const float MAX_COLOR = 255.0f;
|
const float MAX_COLOR = 255.0f;
|
||||||
glm::vec4 colorv4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
glm::vec4 colorv4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
||||||
|
|
||||||
auto batch = args->_batch;
|
auto batch = args->_batch;
|
||||||
if (batch) {
|
if (batch) {
|
||||||
batch->setModelTransform(getTransform());
|
batch->setModelTransform(getTransform());
|
||||||
|
|
|
@ -19,15 +19,22 @@ QString const Rectangle3DOverlay::TYPE = "rectangle3d";
|
||||||
Rectangle3DOverlay::Rectangle3DOverlay() :
|
Rectangle3DOverlay::Rectangle3DOverlay() :
|
||||||
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
|
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
|
||||||
{
|
{
|
||||||
|
qDebug() << "Building rect3d overlay";
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle3DOverlay::Rectangle3DOverlay(const Rectangle3DOverlay* rectangle3DOverlay) :
|
Rectangle3DOverlay::Rectangle3DOverlay(const Rectangle3DOverlay* rectangle3DOverlay) :
|
||||||
Planar3DOverlay(rectangle3DOverlay),
|
Planar3DOverlay(rectangle3DOverlay),
|
||||||
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
|
_geometryCacheID(DependencyManager::get<GeometryCache>()->allocateID())
|
||||||
{
|
{
|
||||||
|
qDebug() << "Building rect3d overlay";
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle3DOverlay::~Rectangle3DOverlay() {
|
Rectangle3DOverlay::~Rectangle3DOverlay() {
|
||||||
|
qDebug() << "Destryoing rect3d overlay";
|
||||||
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
|
if (_geometryCacheID && geometryCache) {
|
||||||
|
geometryCache->releaseID(_geometryCacheID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Rectangle3DOverlay::render(RenderArgs* args) {
|
void Rectangle3DOverlay::render(RenderArgs* args) {
|
||||||
|
|
|
@ -1778,7 +1778,7 @@ void AvatarData::setAvatarEntityData(const AvatarEntityMap& avatarEntityData) {
|
||||||
AvatarEntityIDs AvatarData::getAndClearRecentlyDetachedIDs() {
|
AvatarEntityIDs AvatarData::getAndClearRecentlyDetachedIDs() {
|
||||||
AvatarEntityIDs result;
|
AvatarEntityIDs result;
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
QMetaObject::invokeMethod(const_cast<AvatarData*>(this), "getRecentlyDetachedIDs", Qt::BlockingQueuedConnection,
|
QMetaObject::invokeMethod(const_cast<AvatarData*>(this), "getAndClearRecentlyDetachedIDs", Qt::BlockingQueuedConnection,
|
||||||
Q_RETURN_ARG(AvatarEntityIDs, result));
|
Q_RETURN_ARG(AvatarEntityIDs, result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ void AnimationPropertyGroup::copyToScriptValue(const EntityPropertyFlags& desire
|
||||||
|
|
||||||
if (_animationLoop) {
|
if (_animationLoop) {
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_FPS, Animation, animation, FPS, fps, _animationLoop->getFPS);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_FPS, Animation, animation, FPS, fps, _animationLoop->getFPS);
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_FRAME_INDEX, Animation, animation, CurrentFrame, currentFrame, _animationLoop->getFPS);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_FRAME_INDEX, Animation, animation, CurrentFrame, currentFrame, _animationLoop->getCurrentFrame);
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_PLAYING, Animation, animation, Running, running, _animationLoop->getRunning);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_PLAYING, Animation, animation, Running, running, _animationLoop->getRunning);
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_LOOP, Animation, animation, Loop, loop, _animationLoop->getLoop);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_LOOP, Animation, animation, Loop, loop, _animationLoop->getLoop);
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_FIRST_FRAME, Animation, animation, FirstFrame, firstFrame, _animationLoop->getFirstFrame);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ANIMATION_FIRST_FRAME, Animation, animation, FirstFrame, firstFrame, _animationLoop->getFirstFrame);
|
||||||
|
@ -79,6 +79,27 @@ void AnimationPropertyGroup::copyFromScriptValue(const QScriptValue& object, boo
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AnimationPropertyGroup::merge(const AnimationPropertyGroup& other) {
|
||||||
|
COPY_PROPERTY_IF_CHANGED(url);
|
||||||
|
if (_animationLoop) {
|
||||||
|
_fps = _animationLoop->getFPS();
|
||||||
|
_currentFrame = _animationLoop->getCurrentFrame();
|
||||||
|
_running = _animationLoop->getRunning();
|
||||||
|
_loop = _animationLoop->getLoop();
|
||||||
|
_firstFrame = _animationLoop->getFirstFrame();
|
||||||
|
_lastFrame = _animationLoop->getLastFrame();
|
||||||
|
_hold = _animationLoop->getHold();
|
||||||
|
} else {
|
||||||
|
COPY_PROPERTY_IF_CHANGED(fps);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(currentFrame);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(running);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(loop);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(firstFrame);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(lastFrame);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(hold);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void AnimationPropertyGroup::setFromOldAnimationSettings(const QString& value) {
|
void AnimationPropertyGroup::setFromOldAnimationSettings(const QString& value) {
|
||||||
// the animations setting is a JSON string that may contain various animation settings.
|
// the animations setting is a JSON string that may contain various animation settings.
|
||||||
// if it includes fps, currentFrame, or running, those values will be parsed out and
|
// if it includes fps, currentFrame, or running, those values will be parsed out and
|
||||||
|
|
|
@ -38,6 +38,9 @@ public:
|
||||||
QScriptEngine* engine, bool skipDefaults,
|
QScriptEngine* engine, bool skipDefaults,
|
||||||
EntityItemProperties& defaultEntityProperties) const override;
|
EntityItemProperties& defaultEntityProperties) const override;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
|
||||||
|
|
||||||
|
void merge(const AnimationPropertyGroup& other);
|
||||||
|
|
||||||
virtual void debugDump() const override;
|
virtual void debugDump() const override;
|
||||||
virtual void listChangedProperties(QList<QString>& out) override;
|
virtual void listChangedProperties(QList<QString>& out) override;
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,8 @@ void EntityEditPacketSender::queueEditAvatarEntityMessage(PacketType type,
|
||||||
|
|
||||||
// the properties that get serialized into the avatar identity packet should be the entire set
|
// the properties that get serialized into the avatar identity packet should be the entire set
|
||||||
// rather than just the ones being edited.
|
// rather than just the ones being edited.
|
||||||
entity->setProperties(properties);
|
|
||||||
EntityItemProperties entityProperties = entity->getProperties();
|
EntityItemProperties entityProperties = entity->getProperties();
|
||||||
|
entityProperties.merge(properties);
|
||||||
|
|
||||||
QScriptValue scriptProperties = EntityItemNonDefaultPropertiesToScriptValue(&_scriptEngine, entityProperties);
|
QScriptValue scriptProperties = EntityItemNonDefaultPropertiesToScriptValue(&_scriptEngine, entityProperties);
|
||||||
QVariant variantProperties = scriptProperties.toVariant();
|
QVariant variantProperties = scriptProperties.toVariant();
|
||||||
|
|
|
@ -749,6 +749,133 @@ void EntityItemProperties::copyFromScriptValue(const QScriptValue& object, bool
|
||||||
_lastEdited = usecTimestampNow();
|
_lastEdited = usecTimestampNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EntityItemProperties::merge(const EntityItemProperties& other) {
|
||||||
|
COPY_PROPERTY_IF_CHANGED(position);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(dimensions);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(rotation);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(density);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(velocity);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(gravity);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(acceleration);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(damping);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(restitution);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(friction);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(lifetime);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(script);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(scriptTimestamp);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(registrationPoint);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(angularVelocity);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(angularDamping);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(visible);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(color);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(colorSpread);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(colorStart);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(colorFinish);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(alpha);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(alphaSpread);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(alphaStart);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(alphaFinish);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(emitterShouldTrail);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(modelURL);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(compoundShapeURL);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(localRenderAlpha);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(collisionless);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(collisionMask);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(dynamic);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(isSpotlight);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(intensity);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(falloffRadius);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(exponent);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(cutoff);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(locked);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(textures);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(userData);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(text);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(lineHeight);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(textColor);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(backgroundColor);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(shapeType);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(maxParticles);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(lifespan);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(isEmitting);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(emitRate);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(emitSpeed);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(speedSpread);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(emitOrientation);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(emitDimensions);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(emitRadiusStart);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(polarStart);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(polarFinish);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(azimuthStart);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(azimuthFinish);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(emitAcceleration);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(accelerationSpread);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(particleRadius);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(radiusSpread);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(radiusStart);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(radiusFinish);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(marketplaceID);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(name);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(collisionSoundURL);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(backgroundMode);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(sourceUrl);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(voxelVolumeSize);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(voxelData);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(voxelSurfaceStyle);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(lineWidth);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(linePoints);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(href);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(description);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(faceCamera);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(actionData);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(normals);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(strokeWidths);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(created);
|
||||||
|
|
||||||
|
_animation.merge(other._animation);
|
||||||
|
_keyLight.merge(other._keyLight);
|
||||||
|
_skybox.merge(other._skybox);
|
||||||
|
_stage.merge(other._stage);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(xTextureURL);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(yTextureURL);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(zTextureURL);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(xNNeighborID);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(yNNeighborID);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(zNNeighborID);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(xPNeighborID);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(yPNeighborID);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(zPNeighborID);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(parentID);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(parentJointIndex);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(queryAACube);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(localPosition);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(localRotation);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(localVelocity);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(localAngularVelocity);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(jointRotationsSet);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(jointRotations);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(jointTranslationsSet);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(jointTranslations);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(shape);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(flyingAllowed);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(ghostingAllowed);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(clientOnly);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(owningAvatarID);
|
||||||
|
|
||||||
|
COPY_PROPERTY_IF_CHANGED(dpi);
|
||||||
|
|
||||||
|
_lastEdited = usecTimestampNow();
|
||||||
|
}
|
||||||
|
|
||||||
QScriptValue EntityItemPropertiesToScriptValue(QScriptEngine* engine, const EntityItemProperties& properties) {
|
QScriptValue EntityItemPropertiesToScriptValue(QScriptEngine* engine, const EntityItemProperties& properties) {
|
||||||
return properties.copyToScriptValue(engine, false);
|
return properties.copyToScriptValue(engine, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,8 @@ public:
|
||||||
EntityItemProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags());
|
EntityItemProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags());
|
||||||
virtual ~EntityItemProperties() = default;
|
virtual ~EntityItemProperties() = default;
|
||||||
|
|
||||||
|
void merge(const EntityItemProperties& other);
|
||||||
|
|
||||||
EntityTypes::EntityType getType() const { return _type; }
|
EntityTypes::EntityType getType() const { return _type; }
|
||||||
void setType(EntityTypes::EntityType type) { _type = type; }
|
void setType(EntityTypes::EntityType type) { _type = type; }
|
||||||
|
|
||||||
|
|
|
@ -305,7 +305,16 @@ inline xColor xColor_convertFromScriptValue(const QScriptValue& v, bool& isValid
|
||||||
}
|
}
|
||||||
return newValue;
|
return newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define COPY_PROPERTY_IF_CHANGED(P) \
|
||||||
|
{ \
|
||||||
|
if (other._##P##Changed) { \
|
||||||
|
_##P = other._##P; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define COPY_PROPERTY_FROM_QSCRIPTVALUE(P, T, S) \
|
#define COPY_PROPERTY_FROM_QSCRIPTVALUE(P, T, S) \
|
||||||
{ \
|
{ \
|
||||||
|
|
|
@ -49,6 +49,15 @@ void KeyLightPropertyGroup::copyFromScriptValue(const QScriptValue& object, bool
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightDirection, glmVec3, setDirection, getDirection);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(keyLightDirection, glmVec3, setDirection, getDirection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KeyLightPropertyGroup::merge(const KeyLightPropertyGroup& other) {
|
||||||
|
COPY_PROPERTY_IF_CHANGED(color);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(intensity);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(ambientIntensity);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(direction);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(ambientURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void KeyLightPropertyGroup::debugDump() const {
|
void KeyLightPropertyGroup::debugDump() const {
|
||||||
qDebug() << " KeyLightPropertyGroup: ---------------------------------------------";
|
qDebug() << " KeyLightPropertyGroup: ---------------------------------------------";
|
||||||
|
|
|
@ -34,6 +34,9 @@ public:
|
||||||
QScriptEngine* engine, bool skipDefaults,
|
QScriptEngine* engine, bool skipDefaults,
|
||||||
EntityItemProperties& defaultEntityProperties) const override;
|
EntityItemProperties& defaultEntityProperties) const override;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
|
||||||
|
|
||||||
|
void merge(const KeyLightPropertyGroup& other);
|
||||||
|
|
||||||
virtual void debugDump() const override;
|
virtual void debugDump() const override;
|
||||||
virtual void listChangedProperties(QList<QString>& out) override;
|
virtual void listChangedProperties(QList<QString>& out) override;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,12 @@ void SkyboxPropertyGroup::copyFromScriptValue(const QScriptValue& object, bool&
|
||||||
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(skybox, url, QString, setURL);
|
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(skybox, url, QString, setURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SkyboxPropertyGroup::merge(const SkyboxPropertyGroup& other) {
|
||||||
|
COPY_PROPERTY_IF_CHANGED(color);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SkyboxPropertyGroup::debugDump() const {
|
void SkyboxPropertyGroup::debugDump() const {
|
||||||
qDebug() << " SkyboxPropertyGroup: ---------------------------------------------";
|
qDebug() << " SkyboxPropertyGroup: ---------------------------------------------";
|
||||||
qDebug() << " Color:" << getColor() << " has changed:" << colorChanged();
|
qDebug() << " Color:" << getColor() << " has changed:" << colorChanged();
|
||||||
|
|
|
@ -34,6 +34,9 @@ public:
|
||||||
QScriptEngine* engine, bool skipDefaults,
|
QScriptEngine* engine, bool skipDefaults,
|
||||||
EntityItemProperties& defaultEntityProperties) const override;
|
EntityItemProperties& defaultEntityProperties) const override;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
|
||||||
|
|
||||||
|
void merge(const SkyboxPropertyGroup& other);
|
||||||
|
|
||||||
virtual void debugDump() const override;
|
virtual void debugDump() const override;
|
||||||
virtual void listChangedProperties(QList<QString>& out) override;
|
virtual void listChangedProperties(QList<QString>& out) override;
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,17 @@ void StagePropertyGroup::copyFromScriptValue(const QScriptValue& object, bool& _
|
||||||
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(stage, automaticHourDay, bool, setAutomaticHourDay);
|
COPY_GROUP_PROPERTY_FROM_QSCRIPTVALUE(stage, automaticHourDay, bool, setAutomaticHourDay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StagePropertyGroup::merge(const StagePropertyGroup& other) {
|
||||||
|
COPY_PROPERTY_IF_CHANGED(sunModelEnabled);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(latitude);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(longitude);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(altitude);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(day);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(hour);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(automaticHourDay);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void StagePropertyGroup::debugDump() const {
|
void StagePropertyGroup::debugDump() const {
|
||||||
qDebug() << " StagePropertyGroup: ---------------------------------------------";
|
qDebug() << " StagePropertyGroup: ---------------------------------------------";
|
||||||
qDebug() << " _sunModelEnabled:" << _sunModelEnabled;
|
qDebug() << " _sunModelEnabled:" << _sunModelEnabled;
|
||||||
|
|
|
@ -34,6 +34,9 @@ public:
|
||||||
QScriptEngine* engine, bool skipDefaults,
|
QScriptEngine* engine, bool skipDefaults,
|
||||||
EntityItemProperties& defaultEntityProperties) const override;
|
EntityItemProperties& defaultEntityProperties) const override;
|
||||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
|
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) override;
|
||||||
|
|
||||||
|
void merge(const StagePropertyGroup& other);
|
||||||
|
|
||||||
virtual void debugDump() const override;
|
virtual void debugDump() const override;
|
||||||
virtual void listChangedProperties(QList<QString>& out) override;
|
virtual void listChangedProperties(QList<QString>& out) override;
|
||||||
|
|
||||||
|
|
|
@ -773,23 +773,29 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS
|
||||||
} else if (object.name == "Texture") {
|
} else if (object.name == "Texture") {
|
||||||
TextureParam tex;
|
TextureParam tex;
|
||||||
foreach (const FBXNode& subobject, object.children) {
|
foreach (const FBXNode& subobject, object.children) {
|
||||||
if (subobject.name == "RelativeFilename") {
|
const int RELATIVE_FILENAME_MIN_SIZE = 1;
|
||||||
|
const int TEXTURE_NAME_MIN_SIZE = 1;
|
||||||
|
const int TEXTURE_ALPHA_SOURCE_MIN_SIZE = 1;
|
||||||
|
const int MODEL_UV_TRANSLATION_MIN_SIZE = 2;
|
||||||
|
const int MODEL_UV_SCALING_MIN_SIZE = 2;
|
||||||
|
const int CROPPING_MIN_SIZE = 4;
|
||||||
|
if (subobject.name == "RelativeFilename" && subobject.properties.length() >= RELATIVE_FILENAME_MIN_SIZE) {
|
||||||
QByteArray filename = subobject.properties.at(0).toByteArray();
|
QByteArray filename = subobject.properties.at(0).toByteArray();
|
||||||
QByteArray filepath = filename.replace('\\', '/');
|
QByteArray filepath = filename.replace('\\', '/');
|
||||||
filename = fileOnUrl(filepath, url);
|
filename = fileOnUrl(filepath, url);
|
||||||
_textureFilepaths.insert(getID(object.properties), filepath);
|
_textureFilepaths.insert(getID(object.properties), filepath);
|
||||||
_textureFilenames.insert(getID(object.properties), filename);
|
_textureFilenames.insert(getID(object.properties), filename);
|
||||||
} else if (subobject.name == "TextureName") {
|
} else if (subobject.name == "TextureName" && subobject.properties.length() >= TEXTURE_NAME_MIN_SIZE) {
|
||||||
// trim the name from the timestamp
|
// trim the name from the timestamp
|
||||||
QString name = QString(subobject.properties.at(0).toByteArray());
|
QString name = QString(subobject.properties.at(0).toByteArray());
|
||||||
name = name.left(name.indexOf('['));
|
name = name.left(name.indexOf('['));
|
||||||
_textureNames.insert(getID(object.properties), name);
|
_textureNames.insert(getID(object.properties), name);
|
||||||
} else if (subobject.name == "Texture_Alpha_Source") {
|
} else if (subobject.name == "Texture_Alpha_Source" && subobject.properties.length() >= TEXTURE_ALPHA_SOURCE_MIN_SIZE) {
|
||||||
tex.assign<uint8_t>(tex.alphaSource, subobject.properties.at(0).value<int>());
|
tex.assign<uint8_t>(tex.alphaSource, subobject.properties.at(0).value<int>());
|
||||||
} else if (subobject.name == "ModelUVTranslation") {
|
} else if (subobject.name == "ModelUVTranslation" && subobject.properties.length() >= MODEL_UV_TRANSLATION_MIN_SIZE) {
|
||||||
tex.assign(tex.UVTranslation, glm::vec2(subobject.properties.at(0).value<double>(),
|
tex.assign(tex.UVTranslation, glm::vec2(subobject.properties.at(0).value<double>(),
|
||||||
subobject.properties.at(1).value<double>()));
|
subobject.properties.at(1).value<double>()));
|
||||||
} else if (subobject.name == "ModelUVScaling") {
|
} else if (subobject.name == "ModelUVScaling" && subobject.properties.length() >= MODEL_UV_SCALING_MIN_SIZE) {
|
||||||
tex.assign(tex.UVScaling, glm::vec2(subobject.properties.at(0).value<double>(),
|
tex.assign(tex.UVScaling, glm::vec2(subobject.properties.at(0).value<double>(),
|
||||||
subobject.properties.at(1).value<double>()));
|
subobject.properties.at(1).value<double>()));
|
||||||
if (tex.UVScaling.x == 0.0f) {
|
if (tex.UVScaling.x == 0.0f) {
|
||||||
|
@ -798,7 +804,7 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS
|
||||||
if (tex.UVScaling.y == 0.0f) {
|
if (tex.UVScaling.y == 0.0f) {
|
||||||
tex.UVScaling.y = 1.0f;
|
tex.UVScaling.y = 1.0f;
|
||||||
}
|
}
|
||||||
} else if (subobject.name == "Cropping") {
|
} else if (subobject.name == "Cropping" && subobject.properties.length() >= CROPPING_MIN_SIZE) {
|
||||||
tex.assign(tex.cropping, glm::vec4(subobject.properties.at(0).value<int>(),
|
tex.assign(tex.cropping, glm::vec4(subobject.properties.at(0).value<int>(),
|
||||||
subobject.properties.at(1).value<int>(),
|
subobject.properties.at(1).value<int>(),
|
||||||
subobject.properties.at(2).value<int>(),
|
subobject.properties.at(2).value<int>(),
|
||||||
|
|
|
@ -415,7 +415,7 @@ void AddressManager::goToAddressFromObject(const QVariantMap& dataObject, const
|
||||||
// check if we had a path to override the path returned
|
// check if we had a path to override the path returned
|
||||||
QString overridePath = reply.property(OVERRIDE_PATH_KEY).toString();
|
QString overridePath = reply.property(OVERRIDE_PATH_KEY).toString();
|
||||||
|
|
||||||
if (!overridePath.isEmpty()) {
|
if (!overridePath.isEmpty() && overridePath != "/") {
|
||||||
// make sure we don't re-handle an overriden path if this was a refresh of info from API
|
// make sure we don't re-handle an overriden path if this was a refresh of info from API
|
||||||
if (trigger != LookupTrigger::AttemptedRefresh) {
|
if (trigger != LookupTrigger::AttemptedRefresh) {
|
||||||
handlePath(overridePath, trigger);
|
handlePath(overridePath, trigger);
|
||||||
|
|
|
@ -441,6 +441,34 @@ GeometryCache::~GeometryCache() {
|
||||||
#endif //def WANT_DEBUG
|
#endif //def WANT_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeometryCache::releaseID(int id) {
|
||||||
|
_registeredQuad3DTextures.remove(id);
|
||||||
|
_lastRegisteredQuad2DTexture.remove(id);
|
||||||
|
_registeredQuad2DTextures.remove(id);
|
||||||
|
_lastRegisteredQuad3D.remove(id);
|
||||||
|
_registeredQuad3D.remove(id);
|
||||||
|
|
||||||
|
_lastRegisteredQuad2D.remove(id);
|
||||||
|
_registeredQuad2D.remove(id);
|
||||||
|
|
||||||
|
_lastRegisteredBevelRects.remove(id);
|
||||||
|
_registeredBevelRects.remove(id);
|
||||||
|
|
||||||
|
_lastRegisteredLine3D.remove(id);
|
||||||
|
_registeredLine3DVBOs.remove(id);
|
||||||
|
|
||||||
|
_lastRegisteredLine2D.remove(id);
|
||||||
|
_registeredLine2DVBOs.remove(id);
|
||||||
|
|
||||||
|
_registeredVertices.remove(id);
|
||||||
|
|
||||||
|
_lastRegisteredDashedLines.remove(id);
|
||||||
|
_registeredDashedLines.remove(id);
|
||||||
|
|
||||||
|
_lastRegisteredGridBuffer.remove(id);
|
||||||
|
_registeredGridBuffers.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
void setupBatchInstance(gpu::Batch& batch, gpu::BufferPointer colorBuffer) {
|
void setupBatchInstance(gpu::Batch& batch, gpu::BufferPointer colorBuffer) {
|
||||||
gpu::BufferView colorView(colorBuffer, COLOR_ELEMENT);
|
gpu::BufferView colorView(colorBuffer, COLOR_ELEMENT);
|
||||||
batch.setInputBuffer(gpu::Stream::COLOR, colorView);
|
batch.setInputBuffer(gpu::Stream::COLOR, colorView);
|
||||||
|
|
|
@ -148,6 +148,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
int allocateID() { return _nextID++; }
|
int allocateID() { return _nextID++; }
|
||||||
|
void releaseID(int id);
|
||||||
static const int UNKNOWN_ID;
|
static const int UNKNOWN_ID;
|
||||||
|
|
||||||
// Bind the pipeline and get the state to render static geometry
|
// Bind the pipeline and get the state to render static geometry
|
||||||
|
|
|
@ -48,6 +48,11 @@ void BatchLoader::start() {
|
||||||
if (!self) {
|
if (!self) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Because the ScriptCache may call this callback from differents threads,
|
||||||
|
// we need to make sure this is thread-safe.
|
||||||
|
std::lock_guard<std::mutex> lock(_dataLock);
|
||||||
|
|
||||||
if (isURL && success) {
|
if (isURL && success) {
|
||||||
_data.insert(url, contents);
|
_data.insert(url, contents);
|
||||||
qCDebug(scriptengine) << "Loaded: " << url;
|
qCDebug(scriptengine) << "Loaded: " << url;
|
||||||
|
@ -55,16 +60,11 @@ void BatchLoader::start() {
|
||||||
_data.insert(url, QString());
|
_data.insert(url, QString());
|
||||||
qCDebug(scriptengine) << "Could not load" << url;
|
qCDebug(scriptengine) << "Could not load" << url;
|
||||||
}
|
}
|
||||||
checkFinished();
|
|
||||||
|
if (!_finished && _urls.size() == _data.size()) {
|
||||||
|
_finished = true;
|
||||||
|
emit finished(_data);
|
||||||
|
}
|
||||||
}, false);
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkFinished();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BatchLoader::checkFinished() {
|
|
||||||
if (!_finished && _urls.size() == _data.size()) {
|
|
||||||
_finished = true;
|
|
||||||
emit finished(_data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
class BatchLoader : public QObject {
|
class BatchLoader : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -37,6 +39,7 @@ private:
|
||||||
bool _finished;
|
bool _finished;
|
||||||
QSet<QUrl> _urls;
|
QSet<QUrl> _urls;
|
||||||
QMap<QUrl, QString> _data;
|
QMap<QUrl, QString> _data;
|
||||||
|
std::mutex _dataLock;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_BatchLoader_h
|
#endif // hifi_BatchLoader_h
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var baseURL = "https://hifi-production.s3.amazonaws.com/hifi-production/DomainContent/CellScience/";
|
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
var self = this;
|
var self = this;
|
||||||
this.buttonImageURL = baseURL + "GUI/play_audio.svg?2";
|
this.buttonImageURL = baseURL + "GUI/play_audio.svg?2";
|
||||||
|
|
||||||
|
@ -116,4 +116,4 @@
|
||||||
Controller.mousePressEvent.connect(this.onClick);
|
Controller.mousePressEvent.connect(this.onClick);
|
||||||
Script.update.connect(this.update);
|
Script.update.connect(this.update);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -47,8 +47,7 @@
|
||||||
stereo: true,
|
stereo: true,
|
||||||
loop: false,
|
loop: false,
|
||||||
localOnly: true,
|
localOnly: true,
|
||||||
volume: 0.035,
|
volume: 0.45,
|
||||||
position: properties.position
|
|
||||||
};
|
};
|
||||||
self.sound = SoundCache.getSound(self.soundURL);
|
self.sound = SoundCache.getSound(self.soundURL);
|
||||||
self.buttonImageURL = baseURL + "GUI/GUI_audio.png?" + version;
|
self.buttonImageURL = baseURL + "GUI/GUI_audio.png?" + version;
|
||||||
|
@ -142,6 +141,7 @@
|
||||||
Overlays.editOverlay(self.button, {
|
Overlays.editOverlay(self.button, {
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
|
self.soundOptions.position = MyAvatar.position;
|
||||||
this.soundPlaying = Audio.playSound(self.sound, self.soundOptions);
|
this.soundPlaying = Audio.playSound(self.sound, self.soundOptions);
|
||||||
} else {
|
} else {
|
||||||
// print("not downloaded");
|
// print("not downloaded");
|
||||||
|
@ -162,4 +162,4 @@
|
||||||
|
|
||||||
Controller.mousePressEvent.connect(this.onClick);
|
Controller.mousePressEvent.connect(this.onClick);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue