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