mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 14:53:24 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into blue
This commit is contained in:
commit
52c403e980
21 changed files with 115 additions and 83 deletions
libraries
entities-renderer/src
entities/src
networking/src
scripts
defaultScripts.js
developer/utilities/templates/entityScripts
exampleSelfCallingTimeoutNoCleanup.jsexampleTimeoutNoCleanup.jsexampleUpdate.jsexampleUpdateNoDisconnect.js
system
unpublishedScripts/DomainContent/Home/kineticObjects
|
@ -339,15 +339,16 @@ void RenderableModelEntityItem::updateModelBounds() {
|
|||
return;
|
||||
}
|
||||
bool movingOrAnimating = isMovingRelativeToParent() || isAnimatingSomething();
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
if ((movingOrAnimating ||
|
||||
_needsInitialSimulation ||
|
||||
_needsJointSimulation ||
|
||||
_model->getTranslation() != getPosition() ||
|
||||
_model->getScaleToFitDimensions() != getDimensions() ||
|
||||
_model->getScaleToFitDimensions() != dimensions ||
|
||||
_model->getRotation() != getRotation() ||
|
||||
_model->getRegistrationPoint() != getRegistrationPoint())
|
||||
&& _model->isActive() && _dimensionsInitialized) {
|
||||
_model->setScaleToFit(true, getDimensions());
|
||||
_model->setScaleToFit(true, dimensions);
|
||||
_model->setSnapModelToRegistrationPoint(true, getRegistrationPoint());
|
||||
_model->setRotation(getRotation());
|
||||
_model->setTranslation(getPosition());
|
||||
|
|
|
@ -206,13 +206,14 @@ glm::mat4 RenderablePolyVoxEntityItem::voxelToLocalMatrix() const {
|
|||
voxelVolumeSize = _voxelVolumeSize;
|
||||
});
|
||||
|
||||
glm::vec3 scale = getDimensions() / voxelVolumeSize; // meters / voxel-units
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
glm::vec3 scale = dimensions / voxelVolumeSize; // meters / voxel-units
|
||||
bool success; // TODO -- Does this actually have to happen in world space?
|
||||
glm::vec3 center = getCenterPosition(success); // this handles registrationPoint changes
|
||||
glm::vec3 position = getPosition(success);
|
||||
glm::vec3 positionToCenter = center - position;
|
||||
|
||||
positionToCenter -= getDimensions() * Vectors::HALF - getSurfacePositionAdjustment();
|
||||
positionToCenter -= dimensions * Vectors::HALF - getSurfacePositionAdjustment();
|
||||
glm::mat4 centerToCorner = glm::translate(glm::mat4(), positionToCenter);
|
||||
glm::mat4 scaled = glm::scale(centerToCorner, scale);
|
||||
return scaled;
|
||||
|
@ -445,7 +446,8 @@ bool RenderablePolyVoxEntityItem::findDetailedRayIntersection(const glm::vec3& o
|
|||
// the PolyVox ray intersection code requires a near and far point.
|
||||
// set ray cast length to long enough to cover all of the voxel space
|
||||
float distanceToEntity = glm::distance(origin, getPosition());
|
||||
float largestDimension = glm::max(getDimensions().x, getDimensions().y, getDimensions().z) * 2.0f;
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
float largestDimension = glm::max(dimensions.x, dimensions.y, dimensions.z) * 2.0f;
|
||||
glm::vec3 farPoint = origin + normDirection * (distanceToEntity + largestDimension);
|
||||
|
||||
glm::vec4 originInVoxel = wtvMatrix * glm::vec4(origin, 1.0f);
|
||||
|
|
|
@ -119,12 +119,13 @@ bool RenderableWebEntityItem::buildWebSurface(EntityTreeRenderer* renderer) {
|
|||
|
||||
// Map the intersection point to an actual offscreen pixel
|
||||
glm::vec3 point = intersection.intersection;
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
point -= getPosition();
|
||||
point = glm::inverse(getRotation()) * point;
|
||||
point /= getDimensions();
|
||||
point /= dimensions;
|
||||
point += 0.5f;
|
||||
point.y = 1.0f - point.y;
|
||||
point *= getDimensions() * METERS_TO_INCHES * DPI;
|
||||
point *= dimensions * (METERS_TO_INCHES * DPI);
|
||||
|
||||
if (event->button() == Qt::MouseButton::LeftButton) {
|
||||
if (event->type() == QEvent::MouseButtonPress) {
|
||||
|
|
|
@ -781,7 +781,8 @@ void EntityItem::adjustEditPacketForClockSkew(QByteArray& buffer, qint64 clockSk
|
|||
}
|
||||
|
||||
float EntityItem::computeMass() const {
|
||||
return _density * _volumeMultiplier * getDimensions().x * getDimensions().y * getDimensions().z;
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
return _density * _volumeMultiplier * dimensions.x * dimensions.y * dimensions.z;
|
||||
}
|
||||
|
||||
void EntityItem::setDensity(float density) {
|
||||
|
@ -801,7 +802,8 @@ void EntityItem::setMass(float mass) {
|
|||
// we must protect the density range to help maintain stability of physics simulation
|
||||
// therefore this method might not accept the mass that is supplied.
|
||||
|
||||
float volume = _volumeMultiplier * getDimensions().x * getDimensions().y * getDimensions().z;
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
float volume = _volumeMultiplier * dimensions.x * dimensions.y * dimensions.z;
|
||||
|
||||
// compute new density
|
||||
const float MIN_VOLUME = 1.0e-6f; // 0.001mm^3
|
||||
|
@ -1222,11 +1224,13 @@ AACube EntityItem::getMaximumAACube(bool& success) const {
|
|||
// * we know that the position is the center of rotation
|
||||
glm::vec3 centerOfRotation = getPosition(success); // also where _registration point is
|
||||
if (success) {
|
||||
_recalcMaxAACube = false;
|
||||
// * we know that the registration point is the center of rotation
|
||||
// * we can calculate the length of the furthest extent from the registration point
|
||||
// as the dimensions * max (registrationPoint, (1.0,1.0,1.0) - registrationPoint)
|
||||
glm::vec3 registrationPoint = (getDimensions() * getRegistrationPoint());
|
||||
glm::vec3 registrationRemainder = (getDimensions() * (glm::vec3(1.0f, 1.0f, 1.0f) - getRegistrationPoint()));
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
glm::vec3 registrationPoint = (dimensions * _registrationPoint);
|
||||
glm::vec3 registrationRemainder = (dimensions * (glm::vec3(1.0f, 1.0f, 1.0f) - _registrationPoint));
|
||||
glm::vec3 furthestExtentFromRegistration = glm::max(registrationPoint, registrationRemainder);
|
||||
|
||||
// * we know that if you rotate in any direction you would create a sphere
|
||||
|
@ -1238,7 +1242,6 @@ AACube EntityItem::getMaximumAACube(bool& success) const {
|
|||
glm::vec3 minimumCorner = centerOfRotation - glm::vec3(radius, radius, radius);
|
||||
|
||||
_maxAACube = AACube(minimumCorner, radius * 2.0f);
|
||||
_recalcMaxAACube = false;
|
||||
}
|
||||
} else {
|
||||
success = true;
|
||||
|
@ -1251,28 +1254,27 @@ AACube EntityItem::getMaximumAACube(bool& success) const {
|
|||
///
|
||||
AACube EntityItem::getMinimumAACube(bool& success) const {
|
||||
if (_recalcMinAACube) {
|
||||
// _position represents the position of the registration point.
|
||||
glm::vec3 registrationRemainder = glm::vec3(1.0f, 1.0f, 1.0f) - _registrationPoint;
|
||||
|
||||
glm::vec3 unrotatedMinRelativeToEntity = - (getDimensions() * getRegistrationPoint());
|
||||
glm::vec3 unrotatedMaxRelativeToEntity = getDimensions() * registrationRemainder;
|
||||
Extents unrotatedExtentsRelativeToRegistrationPoint = { unrotatedMinRelativeToEntity, unrotatedMaxRelativeToEntity };
|
||||
Extents rotatedExtentsRelativeToRegistrationPoint =
|
||||
unrotatedExtentsRelativeToRegistrationPoint.getRotated(getRotation());
|
||||
|
||||
// shift the extents to be relative to the position/registration point
|
||||
rotatedExtentsRelativeToRegistrationPoint.shiftBy(getPosition(success));
|
||||
|
||||
// position represents the position of the registration point.
|
||||
glm::vec3 position = getPosition(success);
|
||||
if (success) {
|
||||
_recalcMinAACube = false;
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
glm::vec3 unrotatedMinRelativeToEntity = - (dimensions * _registrationPoint);
|
||||
glm::vec3 unrotatedMaxRelativeToEntity = dimensions * (glm::vec3(1.0f, 1.0f, 1.0f) - _registrationPoint);
|
||||
Extents extents = { unrotatedMinRelativeToEntity, unrotatedMaxRelativeToEntity };
|
||||
extents.rotate(getRotation());
|
||||
|
||||
// shift the extents to be relative to the position/registration point
|
||||
extents.shiftBy(position);
|
||||
|
||||
// the cube that best encompasses extents is...
|
||||
AABox box(rotatedExtentsRelativeToRegistrationPoint);
|
||||
AABox box(extents);
|
||||
glm::vec3 centerOfBox = box.calcCenter();
|
||||
float longestSide = box.getLargestDimension();
|
||||
float halfLongestSide = longestSide / 2.0f;
|
||||
glm::vec3 cornerOfCube = centerOfBox - glm::vec3(halfLongestSide, halfLongestSide, halfLongestSide);
|
||||
|
||||
_minAACube = AACube(cornerOfCube, longestSide);
|
||||
_recalcMinAACube = false;
|
||||
}
|
||||
} else {
|
||||
success = true;
|
||||
|
@ -1282,21 +1284,20 @@ AACube EntityItem::getMinimumAACube(bool& success) const {
|
|||
|
||||
AABox EntityItem::getAABox(bool& success) const {
|
||||
if (_recalcAABox) {
|
||||
// _position represents the position of the registration point.
|
||||
glm::vec3 registrationRemainder = glm::vec3(1.0f, 1.0f, 1.0f) - _registrationPoint;
|
||||
|
||||
glm::vec3 unrotatedMinRelativeToEntity = - (getDimensions() * _registrationPoint);
|
||||
glm::vec3 unrotatedMaxRelativeToEntity = getDimensions() * registrationRemainder;
|
||||
Extents unrotatedExtentsRelativeToRegistrationPoint = { unrotatedMinRelativeToEntity, unrotatedMaxRelativeToEntity };
|
||||
Extents rotatedExtentsRelativeToRegistrationPoint =
|
||||
unrotatedExtentsRelativeToRegistrationPoint.getRotated(getRotation());
|
||||
|
||||
// shift the extents to be relative to the position/registration point
|
||||
rotatedExtentsRelativeToRegistrationPoint.shiftBy(getPosition(success));
|
||||
|
||||
// position represents the position of the registration point.
|
||||
glm::vec3 position = getPosition(success);
|
||||
if (success) {
|
||||
_cachedAABox = AABox(rotatedExtentsRelativeToRegistrationPoint);
|
||||
_recalcAABox = false;
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
glm::vec3 unrotatedMinRelativeToEntity = - (dimensions * _registrationPoint);
|
||||
glm::vec3 unrotatedMaxRelativeToEntity = dimensions * (glm::vec3(1.0f, 1.0f, 1.0f) - _registrationPoint);
|
||||
Extents extents = { unrotatedMinRelativeToEntity, unrotatedMaxRelativeToEntity };
|
||||
extents.rotate(getRotation());
|
||||
|
||||
// shift the extents to be relative to the position/registration point
|
||||
extents.shiftBy(position);
|
||||
|
||||
_cachedAABox = AABox(extents);
|
||||
}
|
||||
} else {
|
||||
success = true;
|
||||
|
@ -1373,6 +1374,11 @@ void EntityItem::computeShapeInfo(ShapeInfo& info) {
|
|||
adjustShapeInfoByRegistration(info);
|
||||
}
|
||||
|
||||
float EntityItem::getVolumeEstimate() const {
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
return dimensions.x * dimensions.y * dimensions.z;
|
||||
}
|
||||
|
||||
void EntityItem::updateRegistrationPoint(const glm::vec3& value) {
|
||||
if (value != _registrationPoint) {
|
||||
setRegistrationPoint(value);
|
||||
|
@ -1433,7 +1439,8 @@ void EntityItem::updateMass(float mass) {
|
|||
// we must protect the density range to help maintain stability of physics simulation
|
||||
// therefore this method might not accept the mass that is supplied.
|
||||
|
||||
float volume = _volumeMultiplier * getDimensions().x * getDimensions().y * getDimensions().z;
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
float volume = _volumeMultiplier * dimensions.x * dimensions.y * dimensions.z;
|
||||
|
||||
// compute new density
|
||||
float newDensity = _density;
|
||||
|
|
|
@ -314,7 +314,7 @@ public:
|
|||
|
||||
virtual bool isReadyToComputeShape() { return !isDead(); }
|
||||
virtual void computeShapeInfo(ShapeInfo& info);
|
||||
virtual float getVolumeEstimate() const { return getDimensions().x * getDimensions().y * getDimensions().z; }
|
||||
virtual float getVolumeEstimate() const;
|
||||
|
||||
/// return preferred shape type (actual physical shape may differ)
|
||||
virtual ShapeType getShapeType() const { return SHAPE_TYPE_NONE; }
|
||||
|
|
|
@ -76,12 +76,13 @@ void LightEntityItem::setIsSpotlight(bool value) {
|
|||
if (value != _isSpotlight) {
|
||||
_isSpotlight = value;
|
||||
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
if (_isSpotlight) {
|
||||
const float length = getDimensions().z;
|
||||
const float length = dimensions.z;
|
||||
const float width = length * glm::sin(glm::radians(_cutoff));
|
||||
setDimensions(glm::vec3(width, width, length));
|
||||
} else {
|
||||
float maxDimension = glm::max(getDimensions().x, getDimensions().y, getDimensions().z);
|
||||
float maxDimension = glm::max(dimensions.x, dimensions.y, dimensions.z);
|
||||
setDimensions(glm::vec3(maxDimension, maxDimension, maxDimension));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,15 +101,13 @@ bool LineEntityItem::setLinePoints(const QVector<glm::vec3>& points) {
|
|||
if (points.size() > MAX_POINTS_PER_LINE) {
|
||||
return false;
|
||||
}
|
||||
glm::vec3 halfBox = getDimensions() * 0.5f;
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
glm::vec3 point = points.at(i);
|
||||
// glm::vec3 pos = getPosition();
|
||||
glm::vec3 halfBox = getDimensions() * 0.5f;
|
||||
if ( (point.x < - halfBox.x || point.x > halfBox.x) || (point.y < -halfBox.y || point.y > halfBox.y) || (point.z < - halfBox.z || point.z > halfBox.z) ) {
|
||||
qDebug() << "Point is outside entity's bounding box";
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
_points = points;
|
||||
_pointsChanged = true;
|
||||
|
|
|
@ -25,15 +25,12 @@ UserActivityLogger& UserActivityLogger::getInstance() {
|
|||
return sharedInstance;
|
||||
}
|
||||
|
||||
UserActivityLogger::UserActivityLogger() : _disabled(false) {
|
||||
}
|
||||
|
||||
void UserActivityLogger::disable(bool disable) {
|
||||
_disabled = disable;
|
||||
_disabled.set(disable);
|
||||
}
|
||||
|
||||
void UserActivityLogger::logAction(QString action, QJsonObject details, JSONCallbackParameters params) {
|
||||
if (_disabled) {
|
||||
if (_disabled.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -63,7 +60,7 @@ void UserActivityLogger::logAction(QString action, QJsonObject details, JSONCall
|
|||
}
|
||||
|
||||
accountManager.sendRequest(USER_ACTIVITY_URL,
|
||||
AccountManagerAuth::Required,
|
||||
AccountManagerAuth::Optional,
|
||||
QNetworkAccessManager::PostOperation,
|
||||
params, NULL, multipart);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include <QJsonObject>
|
||||
#include <QNetworkReply>
|
||||
|
||||
#include <SettingHandle.h>
|
||||
|
||||
class UserActivityLogger : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -44,8 +46,8 @@ private slots:
|
|||
void requestError(QNetworkReply& errorReply);
|
||||
|
||||
private:
|
||||
UserActivityLogger();
|
||||
bool _disabled;
|
||||
UserActivityLogger() {};
|
||||
Setting::Handle<bool> _disabled { "UserActivityLoggerDisabled", false };
|
||||
};
|
||||
|
||||
#endif // hifi_UserActivityLogger_h
|
||||
|
|
|
@ -17,7 +17,5 @@ Script.load("system/notifications.js");
|
|||
Script.load("system/controllers/handControllerGrab.js");
|
||||
Script.load("system/controllers/squeezeHands.js");
|
||||
Script.load("system/controllers/grab.js");
|
||||
Script.load("system/directory.js");
|
||||
Script.load("system/dialTone.js");
|
||||
// Script.load("attachedEntitiesManager.js");
|
||||
Script.load("system/depthReticle.js");
|
|
@ -26,7 +26,7 @@ var directoryWindow = new OverlayWebWindow({
|
|||
|
||||
var toolHeight = 50;
|
||||
var toolWidth = 50;
|
||||
var TOOLBAR_MARGIN_Y = 25;
|
||||
var TOOLBAR_MARGIN_Y = 0;
|
||||
|
||||
|
||||
function showDirectory() {
|
||||
|
|
|
@ -48,12 +48,12 @@ var entityListTool = EntityListTool();
|
|||
selectionManager.addEventListener(function() {
|
||||
selectionDisplay.updateHandles();
|
||||
lightOverlayManager.updatePositions();
|
||||
});
|
||||
});
|
||||
|
||||
var toolIconUrl = Script.resolvePath("assets/images/tools/");
|
||||
var toolHeight = 50;
|
||||
var toolWidth = 50;
|
||||
var TOOLBAR_MARGIN_Y = 25;
|
||||
var TOOLBAR_MARGIN_Y = 0;
|
||||
|
||||
var DEGREES_TO_RADIANS = Math.PI / 180.0;
|
||||
var RADIANS_TO_DEGREES = 180.0 / Math.PI;
|
||||
|
@ -191,7 +191,7 @@ var toolBar = (function() {
|
|||
});
|
||||
|
||||
activeButton = toolBar.addTool({
|
||||
imageURL: toolIconUrl + "edit-01.svg",
|
||||
imageURL: toolIconUrl + "edit-01.svg",
|
||||
subImage: {
|
||||
x: 0,
|
||||
y: Tool.IMAGE_WIDTH,
|
||||
|
@ -205,7 +205,7 @@ var toolBar = (function() {
|
|||
}, true, false);
|
||||
|
||||
newModelButton = toolBar.addTool({
|
||||
imageURL:toolIconUrl + "model-01.svg",
|
||||
imageURL: toolIconUrl + "model-01.svg",
|
||||
subImage: {
|
||||
x: 0,
|
||||
y: Tool.IMAGE_WIDTH,
|
||||
|
@ -220,7 +220,7 @@ var toolBar = (function() {
|
|||
});
|
||||
|
||||
newCubeButton = toolBar.addTool({
|
||||
imageURL:toolIconUrl + "cube-01.svg",
|
||||
imageURL: toolIconUrl + "cube-01.svg",
|
||||
subImage: {
|
||||
x: 0,
|
||||
y: Tool.IMAGE_WIDTH,
|
||||
|
@ -336,7 +336,9 @@ var toolBar = (function() {
|
|||
if (active && !Entities.canAdjustLocks()) {
|
||||
Window.alert(INSUFFICIENT_PERMISSIONS_ERROR_MSG);
|
||||
} else {
|
||||
Messages.sendLocalMessage("edit-events", JSON.stringify({enabled: active}));
|
||||
Messages.sendLocalMessage("edit-events", JSON.stringify({
|
||||
enabled: active
|
||||
}));
|
||||
isActive = active;
|
||||
if (!isActive) {
|
||||
entityListTool.setVisible(false);
|
||||
|
@ -549,8 +551,16 @@ var toolBar = (function() {
|
|||
type: "ParticleEffect",
|
||||
isEmitting: true,
|
||||
particleRadius: 0.1,
|
||||
emitAcceleration: {x: 0, y: -1, z: 0},
|
||||
accelerationSpread: {x: 5, y: 0, z: 5},
|
||||
emitAcceleration: {
|
||||
x: 0,
|
||||
y: -1,
|
||||
z: 0
|
||||
},
|
||||
accelerationSpread: {
|
||||
x: 5,
|
||||
y: 0,
|
||||
z: 5
|
||||
},
|
||||
emitSpeed: 1,
|
||||
lifespan: 1,
|
||||
particleRadius: 0.025,
|
||||
|
@ -563,7 +573,7 @@ var toolBar = (function() {
|
|||
return false;
|
||||
};
|
||||
|
||||
that.mouseReleaseEvent = function (event) {
|
||||
that.mouseReleaseEvent = function(event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -604,7 +614,7 @@ var intersection;
|
|||
|
||||
var SCALE_FACTOR = 200.0;
|
||||
|
||||
function rayPlaneIntersection(pickRay, point, normal) { //
|
||||
function rayPlaneIntersection(pickRay, point, normal) { //
|
||||
//
|
||||
// This version of the test returns the intersection of a line with a plane
|
||||
//
|
||||
|
@ -1207,7 +1217,9 @@ function toggleSelectedEntitiesLocked() {
|
|||
var locked = !Entities.getEntityProperties(SelectionManager.selections[0], ["locked"]).locked;
|
||||
for (var i = 0; i < selectionManager.selections.length; i++) {
|
||||
var entityID = SelectionManager.selections[i];
|
||||
Entities.editEntity(entityID, { locked: locked });
|
||||
Entities.editEntity(entityID, {
|
||||
locked: locked
|
||||
});
|
||||
}
|
||||
entityListTool.sendUpdate();
|
||||
selectionManager._update();
|
||||
|
@ -1219,7 +1231,9 @@ function toggleSelectedEntitiesVisible() {
|
|||
var visible = !Entities.getEntityProperties(SelectionManager.selections[0], ["visible"]).visible;
|
||||
for (var i = 0; i < selectionManager.selections.length; i++) {
|
||||
var entityID = SelectionManager.selections[i];
|
||||
Entities.editEntity(entityID, { visible: visible });
|
||||
Entities.editEntity(entityID, {
|
||||
visible: visible
|
||||
});
|
||||
}
|
||||
entityListTool.sendUpdate();
|
||||
selectionManager._update();
|
||||
|
@ -1554,8 +1568,7 @@ PropertiesTool = function(opts) {
|
|||
data.properties.keyLight.direction.x * DEGREES_TO_RADIANS, data.properties.keyLight.direction.y * DEGREES_TO_RADIANS);
|
||||
}
|
||||
Entities.editEntity(selectionManager.selections[0], data.properties);
|
||||
if (data.properties.name !== undefined || data.properties.modelURL !== undefined
|
||||
|| data.properties.visible !== undefined || data.properties.locked !== undefined) {
|
||||
if (data.properties.name !== undefined || data.properties.modelURL !== undefined || data.properties.visible !== undefined || data.properties.locked !== undefined) {
|
||||
entityListTool.sendUpdate();
|
||||
}
|
||||
}
|
||||
|
@ -1835,15 +1848,15 @@ entityListTool.webView.webEventReceived.connect(function(data) {
|
|||
var data = JSON.parse(data);
|
||||
if (data.type == "selectionUpdate") {
|
||||
var ids = data.entityIds;
|
||||
if(ids.length === 1) {
|
||||
if (Entities.getEntityProperties(ids[0], "type").type === "ParticleEffect" ) {
|
||||
if (ids.length === 1) {
|
||||
if (Entities.getEntityProperties(ids[0], "type").type === "ParticleEffect") {
|
||||
if (JSON.stringify(selectedParticleEntity) === JSON.stringify(ids[0])) {
|
||||
// This particle entity is already selected, so return
|
||||
return;
|
||||
}
|
||||
// Destroy the old particles web view first
|
||||
particleExplorerTool.destroyWebView();
|
||||
particleExplorerTool.createWebView();
|
||||
particleExplorerTool.destroyWebView();
|
||||
particleExplorerTool.createWebView();
|
||||
var properties = Entities.getEntityProperties(ids[0]);
|
||||
var particleData = {
|
||||
messageType: "particle_settings",
|
||||
|
@ -1855,7 +1868,7 @@ entityListTool.webView.webEventReceived.connect(function(data) {
|
|||
particleExplorerTool.webView.webEventReceived.connect(function(data) {
|
||||
var data = JSON.parse(data);
|
||||
if (data.messageType === "page_loaded") {
|
||||
particleExplorerTool.webView.emitScriptEvent(JSON.stringify(particleData));
|
||||
particleExplorerTool.webView.emitScriptEvent(JSON.stringify(particleData));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -1864,4 +1877,4 @@ entityListTool.webView.webEventReceived.connect(function(data) {
|
|||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
|
@ -26,7 +26,7 @@ var examplesWindow = new OverlayWebWindow({
|
|||
|
||||
var toolHeight = 50;
|
||||
var toolWidth = 50;
|
||||
var TOOLBAR_MARGIN_Y = 25;
|
||||
var TOOLBAR_MARGIN_Y = 0;
|
||||
|
||||
|
||||
function showExamples(marketplaceID) {
|
||||
|
@ -58,7 +58,7 @@ var toolBar = (function() {
|
|||
browseExamplesButton;
|
||||
|
||||
function initialize() {
|
||||
toolBar = new ToolBar(0, 0, ToolBar.HORIXONTAL, "highfidelity.examples.toolbar", function(windowDimensions, toolbar) {
|
||||
toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.examples.toolbar", function(windowDimensions, toolbar) {
|
||||
return {
|
||||
x: windowDimensions.x / 2,
|
||||
y: windowDimensions.y
|
||||
|
|
|
@ -378,4 +378,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
|
@ -59,6 +59,8 @@ EntityListTool = function(opts) {
|
|||
name: properties.name,
|
||||
type: properties.type,
|
||||
url: properties.type == "Model" ? properties.modelURL : "",
|
||||
locked: properties.locked,
|
||||
visible: properties.visible
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -99,6 +101,10 @@ EntityListTool = function(opts) {
|
|||
}
|
||||
} else if (data.type == "delete") {
|
||||
deleteSelectedEntities();
|
||||
} else if (data.type == "toggleLocked") {
|
||||
toggleSelectedEntitiesLocked();
|
||||
} else if (data.type == "toggleVisible") {
|
||||
toggleSelectedEntitiesVisible();
|
||||
} else if (data.type === "radius") {
|
||||
searchRadius = data.radius;
|
||||
that.sendUpdate();
|
||||
|
@ -112,4 +118,4 @@ EntityListTool = function(opts) {
|
|||
});
|
||||
|
||||
return that;
|
||||
};
|
||||
};
|
|
@ -383,6 +383,9 @@ ToolBar = function(x, y, direction, optionalPersistenceKey, optionalInitialPosit
|
|||
};
|
||||
if (optionalPersistenceKey) {
|
||||
this.fractionKey = optionalPersistenceKey + '.fraction';
|
||||
// FIXME: New default position in RC8 is bottom center of screen instead of right. Can remove this key and associated
|
||||
// code once the new toolbar position is well established with users.
|
||||
this.isNewPositionKey = optionalPersistenceKey + '.isNewPosition';
|
||||
this.save = function () {
|
||||
var recommendedRect = Controller.getRecommendedOverlayRect();
|
||||
var screenSize = { x: recommendedRect.width, y: recommendedRect.height };
|
||||
|
@ -452,7 +455,10 @@ ToolBar = function(x, y, direction, optionalPersistenceKey, optionalInitialPosit
|
|||
return id;
|
||||
}
|
||||
if (this.fractionKey || optionalInitialPositionFunction) {
|
||||
var savedFraction = JSON.parse(Settings.getValue(this.fractionKey) || '0'); // getValue can answer empty string
|
||||
var isNewPosition = Settings.getValue(this.isNewPositionKey);
|
||||
var savedFraction = isNewPosition ? JSON.parse(Settings.getValue(this.fractionKey) || "0") : 0;
|
||||
Settings.setValue(this.isNewPositionKey, true);
|
||||
|
||||
var recommendedRect = Controller.getRecommendedOverlayRect();
|
||||
var screenSize = { x: recommendedRect.width, y: recommendedRect.height };
|
||||
if (savedFraction) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"parentID": "{f59b50d8-13fb-4ceb-b80a-62cd03428a7c}",
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": -0.075,
|
||||
"y": 0.11,
|
||||
"z": 0
|
||||
},
|
||||
"queryAACube": {
|
||||
|
|
Loading…
Reference in a new issue