mirror of
https://github.com/overte-org/overte.git
synced 2025-04-17 14:46:40 +02:00
Merge branch 'head-controller' of github.com:sethalves/hifi into head-controller
This commit is contained in:
commit
b83620f7c5
20 changed files with 120 additions and 168 deletions
|
@ -410,6 +410,7 @@ void Agent::executeScript() {
|
|||
bool openedInLastBlock = !_audioGateOpen && audioGateOpen; // the gate just opened
|
||||
bool closedInLastBlock = _audioGateOpen && !audioGateOpen; // the gate just closed
|
||||
_audioGateOpen = audioGateOpen;
|
||||
Q_UNUSED(openedInLastBlock);
|
||||
|
||||
// the codec must be flushed to silence before sending silent packets,
|
||||
// so delay the transition to silent packets by one packet after becoming silent.
|
||||
|
|
BIN
interface/resources/snapshot/img/no-image.jpg
Normal file
BIN
interface/resources/snapshot/img/no-image.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
|
@ -3992,7 +3992,7 @@ void Application::updateMyAvatarLookAtPosition() {
|
|||
// I am not looking at anyone else, so just look forward
|
||||
if (isHMD) {
|
||||
glm::mat4 worldHMDMat = myAvatar->getSensorToWorldMatrix() *
|
||||
(glm::mat4)myAvatar->getHeadControllerPoseInSensorFrame() * Matrices::Y_180;
|
||||
myAvatar->getHeadControllerPoseInSensorFrame().getMatrix() * Matrices::Y_180;
|
||||
lookAtSpot = transformPoint(worldHMDMat, glm::vec3(0.0f, 0.0f, -TREE_SCALE));
|
||||
} else {
|
||||
lookAtSpot = myAvatar->getHead()->getEyePosition() +
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <QThread>
|
||||
|
||||
const Discoverability::Mode DEFAULT_DISCOVERABILITY_MODE = Discoverability::Friends;
|
||||
const Discoverability::Mode DEFAULT_DISCOVERABILITY_MODE = Discoverability::Connections;
|
||||
|
||||
DiscoverabilityManager::DiscoverabilityManager() :
|
||||
_mode("discoverabilityMode", DEFAULT_DISCOVERABILITY_MODE)
|
||||
|
|
|
@ -1885,7 +1885,7 @@ void MyAvatar::updateOrientation(float deltaTime) {
|
|||
getHead()->setBasePitch(getHead()->getBasePitch() + getDriveKey(PITCH) * _pitchSpeed * deltaTime);
|
||||
|
||||
if (qApp->isHeadControllerEnabled()) {
|
||||
glm::quat localOrientation = getHeadControllerPoseInAvatarFrame();
|
||||
glm::quat localOrientation = getHeadControllerPoseInAvatarFrame().rotation;
|
||||
// these angles will be in radians
|
||||
// ... so they need to be converted to degrees before we do math...
|
||||
glm::vec3 euler = glm::eulerAngles(localOrientation) * DEGREES_PER_RADIAN;
|
||||
|
@ -2328,8 +2328,8 @@ glm::quat MyAvatar::getWorldBodyOrientation() const {
|
|||
glm::mat4 MyAvatar::deriveBodyFromHMDSensor() const {
|
||||
|
||||
// HMD is in sensor space.
|
||||
const glm::vec3 headPosition = getHeadControllerPoseInSensorFrame();
|
||||
const glm::quat headOrientation = (glm::quat)getHeadControllerPoseInSensorFrame() * Quaternions::Y_180;
|
||||
const glm::vec3 headPosition = getHeadControllerPoseInSensorFrame().translation;
|
||||
const glm::quat headOrientation = getHeadControllerPoseInSensorFrame().rotation * Quaternions::Y_180;
|
||||
const glm::quat headOrientationYawOnly = cancelOutRollAndPitch(headOrientation);
|
||||
|
||||
const Rig& rig = _skeletonModel->getRig();
|
||||
|
@ -2765,7 +2765,7 @@ glm::mat4 MyAvatar::getLeftFootCalibrationMat() const {
|
|||
auto leftFootRot = getAbsoluteDefaultJointRotationInObjectFrame(leftFootIndex);
|
||||
return createMatFromQuatAndPos(leftFootRot, leftFootPos);
|
||||
} else {
|
||||
return createMatFromQuatAndPos(DEFAULT_AVATAR_LEFTFOOT_POS, DEFAULT_AVATAR_LEFTFOOT_POS);
|
||||
return createMatFromQuatAndPos(DEFAULT_AVATAR_LEFTFOOT_ROT, DEFAULT_AVATAR_LEFTFOOT_POS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2777,7 +2777,7 @@ glm::mat4 MyAvatar::getRightFootCalibrationMat() const {
|
|||
auto rightFootRot = getAbsoluteDefaultJointRotationInObjectFrame(rightFootIndex);
|
||||
return createMatFromQuatAndPos(rightFootRot, rightFootPos);
|
||||
} else {
|
||||
return createMatFromQuatAndPos(DEFAULT_AVATAR_RIGHTFOOT_POS, DEFAULT_AVATAR_RIGHTFOOT_POS);
|
||||
return createMatFromQuatAndPos(DEFAULT_AVATAR_RIGHTFOOT_ROT, DEFAULT_AVATAR_RIGHTFOOT_POS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2800,7 +2800,7 @@ glm::mat4 MyAvatar::getLeftArmCalibrationMat() const {
|
|||
auto leftArmRot = getAbsoluteDefaultJointRotationInObjectFrame(leftArmIndex);
|
||||
return createMatFromQuatAndPos(leftArmRot, leftArmPos);
|
||||
} else {
|
||||
return createMatFromQuatAndPos(DEFAULT_AVATAR_LEFTARM_ROT, DEFAULT_AVATAR_RIGHTARM_POS);
|
||||
return createMatFromQuatAndPos(DEFAULT_AVATAR_LEFTARM_ROT, DEFAULT_AVATAR_LEFTARM_POS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -850,7 +850,10 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
glm::quat sensorToWorldQuat;
|
||||
unpackOrientationQuatFromSixBytes(data->sensorToWorldQuat, sensorToWorldQuat);
|
||||
float sensorToWorldScale;
|
||||
unpackFloatScalarFromSignedTwoByteFixed((int16_t*)&data->sensorToWorldScale, &sensorToWorldScale, SENSOR_TO_WORLD_SCALE_RADIX);
|
||||
// Grab a local copy of sensorToWorldScale to be able to use the unpack function with a pointer on it,
|
||||
// a direct pointer on the struct attribute triggers warnings because of potential misalignement.
|
||||
auto srcSensorToWorldScale = data->sensorToWorldScale;
|
||||
unpackFloatScalarFromSignedTwoByteFixed((int16_t*)&srcSensorToWorldScale, &sensorToWorldScale, SENSOR_TO_WORLD_SCALE_RADIX);
|
||||
glm::vec3 sensorToWorldTrans(data->sensorToWorldTrans[0], data->sensorToWorldTrans[1], data->sensorToWorldTrans[2]);
|
||||
glm::mat4 sensorToWorldMatrix = createMatFromScaleQuatAndPos(glm::vec3(sensorToWorldScale), sensorToWorldQuat, sensorToWorldTrans);
|
||||
if (_sensorToWorldMatrixCache.get() != sensorToWorldMatrix) {
|
||||
|
|
|
@ -39,14 +39,11 @@ namespace controller {
|
|||
quat getRotation() const { return rotation; }
|
||||
vec3 getVelocity() const { return velocity; }
|
||||
vec3 getAngularVelocity() const { return angularVelocity; }
|
||||
mat4 getMatrix() const { return createMatFromQuatAndPos(rotation, translation); }
|
||||
|
||||
Pose transform(const glm::mat4& mat) const;
|
||||
Pose postTransform(const glm::mat4& mat) const;
|
||||
|
||||
operator glm::mat4() const { return createMatFromQuatAndPos(rotation, translation); }
|
||||
operator glm::quat() const { return rotation; }
|
||||
operator glm::vec3() const { return translation; }
|
||||
|
||||
static QScriptValue toScriptValue(QScriptEngine* engine, const Pose& event);
|
||||
static void fromScriptValue(const QScriptValue& object, Pose& event);
|
||||
};
|
||||
|
|
|
@ -21,9 +21,9 @@ namespace controller {
|
|||
LowVelocityFilter(float rotationConstant, float translationConstant) :
|
||||
_translationConstant(translationConstant), _rotationConstant(rotationConstant) {}
|
||||
|
||||
virtual float apply(float value) const override { return value; }
|
||||
virtual Pose apply(Pose newPose) const override;
|
||||
virtual bool parseParameters(const QJsonValue& parameters) override;
|
||||
float apply(float value) const override { return value; }
|
||||
Pose apply(Pose newPose) const override;
|
||||
bool parseParameters(const QJsonValue& parameters) override;
|
||||
|
||||
private:
|
||||
float _translationConstant { 0.1f };
|
||||
|
|
|
@ -192,7 +192,7 @@ void EntityTreeRenderer::update() {
|
|||
tree->update();
|
||||
|
||||
// Handle enter/leave entity logic
|
||||
bool updated = checkEnterLeaveEntities();
|
||||
checkEnterLeaveEntities();
|
||||
|
||||
// Even if we're not moving the mouse, if we started clicking on an entity and we have
|
||||
// not yet released the hold then this is still considered a holdingClickOnEntity event
|
||||
|
|
|
@ -367,7 +367,6 @@ void RenderableZoneEntityItem::sceneUpdateRenderItemFromEntity(render::Transacti
|
|||
|
||||
bool sunChanged = _keyLightPropertiesChanged;
|
||||
bool backgroundChanged = _backgroundPropertiesChanged;
|
||||
bool stageChanged = _stagePropertiesChanged;
|
||||
bool skyboxChanged = _skyboxPropertiesChanged;
|
||||
|
||||
transaction.updateItem<RenderableZoneEntityItemMeta>(_myMetaItem, [=](RenderableZoneEntityItemMeta& data) {
|
||||
|
|
|
@ -211,6 +211,7 @@ GLenum GLTexelFormat::evalGLTexelFormatInternal(const gpu::Element& dstFormat) {
|
|||
break;
|
||||
case gpu::NUINT32:
|
||||
case gpu::NINT32:
|
||||
case gpu::COMPRESSED:
|
||||
case gpu::NUM_TYPES: // quiet compiler
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
@ -484,6 +485,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
|
|||
texel.internalFormat = GL_R8_SNORM;
|
||||
break;
|
||||
}
|
||||
case gpu::COMPRESSED:
|
||||
case gpu::NUM_TYPES: { // quiet compiler
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
@ -527,6 +529,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
|
|||
texel.internalFormat = GL_DEPTH_COMPONENT24;
|
||||
break;
|
||||
}
|
||||
case gpu::COMPRESSED:
|
||||
case gpu::NUM_TYPES: { // quiet compiler
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
@ -641,6 +644,7 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
|
|||
break;
|
||||
case gpu::NUINT32:
|
||||
case gpu::NINT32:
|
||||
case gpu::COMPRESSED:
|
||||
case gpu::NUM_TYPES: // quiet compiler
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ namespace ktx {
|
|||
} else {
|
||||
Image::FaceBytes faceBytes(NUM_CUBEMAPFACES);
|
||||
auto faceSize = srcImages[l]._faceSize;
|
||||
for (int face = 0; face < NUM_CUBEMAPFACES; face++) {
|
||||
for (uint32_t face = 0; face < NUM_CUBEMAPFACES; face++) {
|
||||
memcpy(currentPtr, srcImages[l]._faceBytes[face], faceSize);
|
||||
faceBytes[face] = currentPtr;
|
||||
currentPtr += faceSize;
|
||||
|
|
|
@ -112,7 +112,6 @@ void DrawBackgroundStage::run(const render::RenderContextPointer& renderContext,
|
|||
skybox->render(batch, args->getViewFrustum());
|
||||
});
|
||||
args->_batch = nullptr;
|
||||
gpu::Batch& batch = *args->_batch;
|
||||
|
||||
// break;
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ void DebugZoneLighting::run(const render::RenderContextPointer& context, const I
|
|||
batch.setUniformBuffer(ZONE_DEFERRED_TRANSFORM_BUFFER, deferredTransform->getFrameTransformBuffer());
|
||||
|
||||
batch.setPipeline(getKeyLightPipeline());
|
||||
auto numKeys = keyLightStack.size();
|
||||
auto numKeys = (int) keyLightStack.size();
|
||||
for (int i = numKeys - 1; i >= 0; i--) {
|
||||
model.setTranslation(glm::vec3(-4.0, -3.0 + (i * 1.0), -10.0 - (i * 3.0)));
|
||||
batch.setModelTransform(model);
|
||||
|
@ -180,7 +180,7 @@ void DebugZoneLighting::run(const render::RenderContextPointer& context, const I
|
|||
}
|
||||
|
||||
batch.setPipeline(getAmbientPipeline());
|
||||
auto numAmbients = ambientLightStack.size();
|
||||
auto numAmbients = (int) ambientLightStack.size();
|
||||
for (int i = numAmbients - 1; i >= 0; i--) {
|
||||
model.setTranslation(glm::vec3(0.0, -3.0 + (i * 1.0), -10.0 - (i * 3.0)));
|
||||
batch.setModelTransform(model);
|
||||
|
@ -194,7 +194,7 @@ void DebugZoneLighting::run(const render::RenderContextPointer& context, const I
|
|||
}
|
||||
|
||||
batch.setPipeline(getBackgroundPipeline());
|
||||
auto numBackgrounds = skyboxStack.size();
|
||||
auto numBackgrounds = (int) skyboxStack.size();
|
||||
for (int i = numBackgrounds - 1; i >= 0; i--) {
|
||||
model.setTranslation(glm::vec3(4.0, -3.0 + (i * 1.0), -10.0 - (i * 3.0)));
|
||||
batch.setModelTransform(model);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <gl/QOpenGLContextWrapper.h>
|
||||
#include <PerfStat.h>
|
||||
#include <ViewFrustum.h>
|
||||
#include <gpu/gl/GLbackend.h>
|
||||
#include <gpu/gl/GLBackend.h>
|
||||
|
||||
#include <ui-plugins/PluginContainer.h>
|
||||
|
||||
|
|
|
@ -293,19 +293,25 @@ function addImage(image_data, isLoggedIn, canShare, isGifLoading, isShowingPrevi
|
|||
isGif = img.src.split('.').pop().toLowerCase() === "gif";
|
||||
imageContainer.appendChild(img);
|
||||
document.getElementById("snapshot-images").appendChild(imageContainer);
|
||||
paths.push(image_data.localPath);
|
||||
if (isGif) {
|
||||
imageContainer.innerHTML += '<span class="gifLabel">GIF</span>';
|
||||
}
|
||||
if (!isGifLoading) {
|
||||
appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast);
|
||||
}
|
||||
if (!isGifLoading || (isShowingPreviousImages && !image_data.story_id)) {
|
||||
shareForUrl(id);
|
||||
}
|
||||
if (isShowingPreviousImages && isLoggedIn && image_data.story_id) {
|
||||
updateShareInfo(id, image_data.story_id);
|
||||
}
|
||||
img.onload = function () {
|
||||
paths.push(image_data.localPath);
|
||||
if (isGif) {
|
||||
imageContainer.innerHTML += '<span class="gifLabel">GIF</span>';
|
||||
}
|
||||
if (!isGifLoading) {
|
||||
appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast);
|
||||
}
|
||||
if (!isGifLoading || (isShowingPreviousImages && !image_data.story_id)) {
|
||||
shareForUrl(id);
|
||||
}
|
||||
if (isShowingPreviousImages && isLoggedIn && image_data.story_id) {
|
||||
updateShareInfo(id, image_data.story_id);
|
||||
}
|
||||
};
|
||||
img.onerror = function () {
|
||||
img.onload = null;
|
||||
img.src = image_data.errorPath;
|
||||
};
|
||||
}
|
||||
function showConfirmationMessage(selectedID, destination) {
|
||||
if (selectedID.id) {
|
||||
|
|
|
@ -82,11 +82,23 @@ function showElements(els, show) {
|
|||
}
|
||||
}
|
||||
|
||||
function updateProperty(propertyName, propertyValue) {
|
||||
var properties = {};
|
||||
properties[propertyName] = propertyValue;
|
||||
updateProperties(properties);
|
||||
}
|
||||
|
||||
function updateProperties(properties) {
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: properties
|
||||
}));
|
||||
}
|
||||
|
||||
function createEmitCheckedPropertyUpdateFunction(propertyName) {
|
||||
return function() {
|
||||
EventBridge.emitWebEvent(
|
||||
'{"id":' + lastEntityID + ', "type":"update", "properties":{"' + propertyName + '":' + this.checked + '}}'
|
||||
);
|
||||
updateProperty(propertyName, this.checked);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -105,13 +117,7 @@ function createEmitGroupCheckedPropertyUpdateFunction(group, propertyName) {
|
|||
var properties = {};
|
||||
properties[group] = {};
|
||||
properties[group][propertyName] = this.checked;
|
||||
EventBridge.emitWebEvent(
|
||||
JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: properties
|
||||
})
|
||||
);
|
||||
updateProperties(properties);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -119,10 +125,7 @@ function createEmitNumberPropertyUpdateFunction(propertyName, decimals) {
|
|||
decimals = decimals == undefined ? 4 : decimals;
|
||||
return function() {
|
||||
var value = parseFloat(this.value).toFixed(decimals);
|
||||
|
||||
EventBridge.emitWebEvent(
|
||||
'{"id":' + lastEntityID + ', "type":"update", "properties":{"' + propertyName + '":' + value + '}}'
|
||||
);
|
||||
updateProperty(propertyName, value);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -131,28 +134,14 @@ function createEmitGroupNumberPropertyUpdateFunction(group, propertyName) {
|
|||
var properties = {};
|
||||
properties[group] = {};
|
||||
properties[group][propertyName] = this.value;
|
||||
EventBridge.emitWebEvent(
|
||||
JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: properties,
|
||||
})
|
||||
);
|
||||
updateProperties(properties);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function createEmitTextPropertyUpdateFunction(propertyName) {
|
||||
return function() {
|
||||
var properties = {};
|
||||
properties[propertyName] = this.value;
|
||||
EventBridge.emitWebEvent(
|
||||
JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: properties,
|
||||
})
|
||||
);
|
||||
updateProperty(propertyName, this.value);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -161,62 +150,44 @@ function createEmitGroupTextPropertyUpdateFunction(group, propertyName) {
|
|||
var properties = {};
|
||||
properties[group] = {};
|
||||
properties[group][propertyName] = this.value;
|
||||
EventBridge.emitWebEvent(
|
||||
JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: properties,
|
||||
})
|
||||
);
|
||||
updateProperties(properties);
|
||||
};
|
||||
}
|
||||
|
||||
function createEmitVec3PropertyUpdateFunction(property, elX, elY, elZ) {
|
||||
return function() {
|
||||
var data = {
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: {}
|
||||
};
|
||||
data.properties[property] = {
|
||||
var properties = {};
|
||||
properties[property] = {
|
||||
x: elX.value,
|
||||
y: elY.value,
|
||||
z: elZ.value,
|
||||
};
|
||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
||||
updateProperties(properties);
|
||||
}
|
||||
};
|
||||
|
||||
function createEmitGroupVec3PropertyUpdateFunction(group, property, elX, elY, elZ) {
|
||||
return function() {
|
||||
var data = {
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: {}
|
||||
};
|
||||
data.properties[group] = {};
|
||||
data.properties[group][property] = {
|
||||
var properties = {};
|
||||
properties[group] = {};
|
||||
properties[group][property] = {
|
||||
x: elX.value,
|
||||
y: elY.value,
|
||||
z: elZ ? elZ.value : 0,
|
||||
};
|
||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
||||
updateProperties(properties);
|
||||
}
|
||||
};
|
||||
|
||||
function createEmitVec3PropertyUpdateFunctionWithMultiplier(property, elX, elY, elZ, multiplier) {
|
||||
return function() {
|
||||
var data = {
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: {}
|
||||
};
|
||||
data.properties[property] = {
|
||||
var properties = {};
|
||||
properties[property] = {
|
||||
x: elX.value * multiplier,
|
||||
y: elY.value * multiplier,
|
||||
z: elZ.value * multiplier,
|
||||
};
|
||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
||||
updateProperties(properties);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -227,44 +198,35 @@ function createEmitColorPropertyUpdateFunction(property, elRed, elGreen, elBlue)
|
|||
};
|
||||
|
||||
function emitColorPropertyUpdate(property, red, green, blue, group) {
|
||||
var data = {
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: {}
|
||||
};
|
||||
var properties = {};
|
||||
if (group) {
|
||||
data.properties[group] = {};
|
||||
data.properties[group][property] = {
|
||||
properties[group] = {};
|
||||
properties[group][property] = {
|
||||
red: red,
|
||||
green: green,
|
||||
blue: blue,
|
||||
};
|
||||
} else {
|
||||
data.properties[property] = {
|
||||
properties[property] = {
|
||||
red: red,
|
||||
green: green,
|
||||
blue: blue,
|
||||
};
|
||||
}
|
||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
||||
updateProperties(properties);
|
||||
};
|
||||
|
||||
|
||||
function createEmitGroupColorPropertyUpdateFunction(group, property, elRed, elGreen, elBlue) {
|
||||
return function() {
|
||||
var data = {
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: {}
|
||||
};
|
||||
data.properties[group] = {};
|
||||
|
||||
data.properties[group][property] = {
|
||||
var properties = {};
|
||||
properties[group] = {};
|
||||
properties[group][property] = {
|
||||
red: elRed.value,
|
||||
green: elGreen.value,
|
||||
blue: elBlue.value,
|
||||
};
|
||||
EventBridge.emitWebEvent(JSON.stringify(data));
|
||||
updateProperties(properties);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -277,18 +239,7 @@ function updateCheckedSubProperty(propertyName, propertyValue, subPropertyElemen
|
|||
// We've unchecked, so remove
|
||||
propertyValue = propertyValue.replace(subPropertyString + ",", "");
|
||||
}
|
||||
|
||||
var _properties = {}
|
||||
_properties[propertyName] = propertyValue;
|
||||
|
||||
EventBridge.emitWebEvent(
|
||||
JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: _properties
|
||||
})
|
||||
);
|
||||
|
||||
updateProperty(propertyName, propertyValue);
|
||||
}
|
||||
|
||||
function setUserDataFromEditor(noUpdate) {
|
||||
|
@ -314,18 +265,11 @@ function setUserDataFromEditor(noUpdate) {
|
|||
);
|
||||
return;
|
||||
} else {
|
||||
EventBridge.emitWebEvent(
|
||||
JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: {
|
||||
userData: text
|
||||
},
|
||||
})
|
||||
);
|
||||
updateProperty('userData', text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function multiDataUpdater(groupName, updateKeyPair, userDataElement, defaults) {
|
||||
var properties = {};
|
||||
var parsedData = {};
|
||||
|
@ -372,13 +316,7 @@ function multiDataUpdater(groupName, updateKeyPair, userDataElement, defaults) {
|
|||
|
||||
userDataElement.value = properties['userData'];
|
||||
|
||||
EventBridge.emitWebEvent(
|
||||
JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: properties,
|
||||
})
|
||||
);
|
||||
updateProperties(properties);
|
||||
}
|
||||
function userDataChanger(groupName, keyName, values, userDataElement, defaultValue) {
|
||||
var val = {}, def = {};
|
||||
|
@ -900,7 +838,6 @@ function loaded() {
|
|||
elCloneable.checked = parsedUserData["grabbableKey"].cloneable;
|
||||
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
||||
elCloneableDynamic.checked = parsedUserData["grabbableKey"].cloneDynamic ? parsedUserData["grabbableKey"].cloneDynamic : properties.dynamic;
|
||||
elDynamic.checked = elCloneable.checked ? false: properties.dynamic;
|
||||
if (elCloneable.checked) {
|
||||
if ("cloneLifetime" in parsedUserData["grabbableKey"]) {
|
||||
elCloneableLifetime.value = parsedUserData["grabbableKey"].cloneLifetime ? parsedUserData["grabbableKey"].cloneLifetime : 300;
|
||||
|
@ -1202,8 +1139,8 @@ function loaded() {
|
|||
});
|
||||
|
||||
elGrabbable.addEventListener('change', function() {
|
||||
if(elCloneable.checked) {
|
||||
elGrabbable.checked = false;
|
||||
if (elCloneable.checked) {
|
||||
elGrabbable.checked = false;
|
||||
}
|
||||
userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, properties.dynamic);
|
||||
});
|
||||
|
@ -1213,17 +1150,22 @@ function loaded() {
|
|||
elCloneable.addEventListener('change', function (event) {
|
||||
var checked = event.target.checked;
|
||||
if (checked) {
|
||||
multiDataUpdater("grabbableKey",
|
||||
{cloneLifetime: elCloneableLifetime, cloneLimit: elCloneableLimit, cloneDynamic: elCloneableDynamic, cloneable: event.target},
|
||||
elUserData, {});
|
||||
multiDataUpdater("grabbableKey", {
|
||||
cloneLifetime: elCloneableLifetime,
|
||||
cloneLimit: elCloneableLimit,
|
||||
cloneDynamic: elCloneableDynamic,
|
||||
cloneable: event.target,
|
||||
grabbable: null
|
||||
}, elUserData, {});
|
||||
elCloneableGroup.style.display = "block";
|
||||
EventBridge.emitWebEvent(
|
||||
'{"id":' + lastEntityID + ', "type":"update", "properties":{"dynamic":false, "grabbable": false}}'
|
||||
);
|
||||
updateProperty('dynamic', false);
|
||||
} else {
|
||||
multiDataUpdater("grabbableKey",
|
||||
{cloneLifetime: null, cloneLimit: null, cloneDynamic: null, cloneable: false},
|
||||
elUserData, {});
|
||||
multiDataUpdater("grabbableKey", {
|
||||
cloneLifetime: null,
|
||||
cloneLimit: null,
|
||||
cloneDynamic: null,
|
||||
cloneable: false
|
||||
}, elUserData, {});
|
||||
elCloneableGroup.style.display = "none";
|
||||
}
|
||||
});
|
||||
|
@ -1258,15 +1200,7 @@ function loaded() {
|
|||
showUserDataTextArea();
|
||||
showNewJSONEditorButton();
|
||||
hideSaveUserDataButton();
|
||||
var properties = {};
|
||||
properties['userData'] = elUserData.value;
|
||||
EventBridge.emitWebEvent(
|
||||
JSON.stringify({
|
||||
id: lastEntityID,
|
||||
type: "update",
|
||||
properties: properties,
|
||||
})
|
||||
);
|
||||
updateProperty('userData', elUserData.value)
|
||||
});
|
||||
|
||||
elSaveUserData.addEventListener("click", function() {
|
||||
|
|
|
@ -613,7 +613,6 @@
|
|||
error = "All participants must be logged in to connect.";
|
||||
}
|
||||
result = error ? {status: 'error', connection: error} : response;
|
||||
UserActivityLogger.makeUserConnection(connectingId, false, error || response);
|
||||
connectionRequestCompleted();
|
||||
} else {
|
||||
result = response;
|
||||
|
@ -668,8 +667,8 @@
|
|||
// to be sure the hand is still close enough. If not, we terminate
|
||||
// the interval, go back to the waiting state. If we make it
|
||||
// the entire CONNECTING_TIME, we make the connection. We pass in
|
||||
// whether or not the connecting id is actually logged in, as now we
|
||||
// will allow to start the connection process but have it stop with a
|
||||
// whether or not the connecting id is actually logged in, as now we
|
||||
// will allow to start the connection process but have it stop with a
|
||||
// fail message before trying to call the backend if the other guy isn't
|
||||
// logged in.
|
||||
function startConnecting(id, jointIndex, isLoggedIn) {
|
||||
|
|
|
@ -273,7 +273,8 @@ function fillImageDataFromPrevious() {
|
|||
localPath: previousStillSnapPath,
|
||||
story_id: previousStillSnapStoryID,
|
||||
blastButtonDisabled: previousStillSnapBlastingDisabled,
|
||||
hifiButtonDisabled: previousStillSnapHifiSharingDisabled
|
||||
hifiButtonDisabled: previousStillSnapHifiSharingDisabled,
|
||||
errorPath: Script.resolvePath(Script.resourcesPath() + 'snapshot/img/no-image.jpg')
|
||||
});
|
||||
}
|
||||
if (previousAnimatedSnapPath !== "") {
|
||||
|
@ -281,7 +282,8 @@ function fillImageDataFromPrevious() {
|
|||
localPath: previousAnimatedSnapPath,
|
||||
story_id: previousAnimatedSnapStoryID,
|
||||
blastButtonDisabled: previousAnimatedSnapBlastingDisabled,
|
||||
hifiButtonDisabled: previousAnimatedSnapHifiSharingDisabled
|
||||
hifiButtonDisabled: previousAnimatedSnapHifiSharingDisabled,
|
||||
errorPath: Script.resolvePath(Script.resourcesPath() + 'snapshot/img/no-image.jpg')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,6 +122,10 @@ int main(int argc, char** argv) {
|
|||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4()
|
||||
};
|
||||
|
||||
|
@ -144,6 +148,10 @@ int main(int argc, char** argv) {
|
|||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4(),
|
||||
glm::mat4()
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue