mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 02:07:24 +02:00
Merge branch 'master' into login_dialog_rework
This commit is contained in:
commit
07ba2cce5b
6 changed files with 132 additions and 114 deletions
|
@ -76,6 +76,8 @@ Item {
|
||||||
height: 50;
|
height: 50;
|
||||||
echoMode: TextInput.Password;
|
echoMode: TextInput.Password;
|
||||||
placeholderText: "enter current passphrase";
|
placeholderText: "enter current passphrase";
|
||||||
|
activeFocusOnPress: true;
|
||||||
|
activeFocusOnTab: true;
|
||||||
|
|
||||||
onFocusChanged: {
|
onFocusChanged: {
|
||||||
if (focus) {
|
if (focus) {
|
||||||
|
@ -87,9 +89,9 @@ Item {
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent;
|
anchors.fill: parent;
|
||||||
onClicked: {
|
onPressed: {
|
||||||
parent.focus = true;
|
|
||||||
sendSignalToWallet({method: 'walletSetup_raiseKeyboard'});
|
sendSignalToWallet({method: 'walletSetup_raiseKeyboard'});
|
||||||
|
mouse.accepted = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +111,16 @@ Item {
|
||||||
height: 50;
|
height: 50;
|
||||||
echoMode: TextInput.Password;
|
echoMode: TextInput.Password;
|
||||||
placeholderText: root.isShowingTip ? "" : "enter new passphrase";
|
placeholderText: root.isShowingTip ? "" : "enter new passphrase";
|
||||||
|
activeFocusOnPress: true;
|
||||||
|
activeFocusOnTab: true;
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent;
|
||||||
|
onPressed: {
|
||||||
|
sendSignalToWallet({method: 'walletSetup_raiseKeyboard'});
|
||||||
|
mouse.accepted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onFocusChanged: {
|
onFocusChanged: {
|
||||||
if (focus) {
|
if (focus) {
|
||||||
|
@ -118,18 +130,11 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent;
|
|
||||||
onClicked: {
|
|
||||||
parent.focus = true;
|
|
||||||
sendMessageToLightbox({method: 'walletSetup_raiseKeyboard'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
passphraseFieldAgain.focus = true;
|
passphraseFieldAgain.focus = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiControlsUit.TextField {
|
HifiControlsUit.TextField {
|
||||||
id: passphraseFieldAgain;
|
id: passphraseFieldAgain;
|
||||||
colorScheme: hifi.colorSchemes.dark;
|
colorScheme: hifi.colorSchemes.dark;
|
||||||
|
@ -140,6 +145,16 @@ Item {
|
||||||
height: 50;
|
height: 50;
|
||||||
echoMode: TextInput.Password;
|
echoMode: TextInput.Password;
|
||||||
placeholderText: root.isShowingTip ? "" : "re-enter new passphrase";
|
placeholderText: root.isShowingTip ? "" : "re-enter new passphrase";
|
||||||
|
activeFocusOnPress: true;
|
||||||
|
activeFocusOnTab: true;
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent;
|
||||||
|
onPressed: {
|
||||||
|
sendSignalToWallet({method: 'walletSetup_raiseKeyboard'});
|
||||||
|
mouse.accepted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onFocusChanged: {
|
onFocusChanged: {
|
||||||
if (focus) {
|
if (focus) {
|
||||||
|
@ -149,14 +164,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent;
|
|
||||||
onClicked: {
|
|
||||||
parent.focus = true;
|
|
||||||
sendMessageToLightbox({method: 'walletSetup_raiseKeyboard'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
focus = false;
|
focus = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
void setIsSolid(bool isSolid) { _isSolid = isSolid; }
|
void setIsSolid(bool isSolid) { _isSolid = isSolid; }
|
||||||
void setIsDashedLine(bool isDashedLine) { _isDashedLine = isDashedLine; }
|
void setIsDashedLine(bool isDashedLine) { _isDashedLine = isDashedLine; }
|
||||||
void setIgnoreRayIntersection(bool value) { _ignoreRayIntersection = value; }
|
void setIgnoreRayIntersection(bool value) { _ignoreRayIntersection = value; }
|
||||||
void setDrawInFront(bool value) { _drawInFront = value; }
|
virtual void setDrawInFront(bool value) { _drawInFront = value; }
|
||||||
void setIsGrabbable(bool value) { _isGrabbable = value; }
|
void setIsGrabbable(bool value) { _isGrabbable = value; }
|
||||||
|
|
||||||
virtual AABox getBounds() const override = 0;
|
virtual AABox getBounds() const override = 0;
|
||||||
|
|
|
@ -72,6 +72,23 @@ void ModelOverlay::update(float deltatime) {
|
||||||
animate();
|
animate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check to see if when we added our model to the scene they were ready, if they were not ready, then
|
||||||
|
// fix them up in the scene
|
||||||
|
render::ScenePointer scene = qApp->getMain3DScene();
|
||||||
|
render::Transaction transaction;
|
||||||
|
if (_model->needsFixupInScene()) {
|
||||||
|
_model->removeFromScene(scene, transaction);
|
||||||
|
_model->addToScene(scene, transaction);
|
||||||
|
}
|
||||||
|
if (_visibleDirty) {
|
||||||
|
_visibleDirty = false;
|
||||||
|
_model->setVisibleInScene(getVisible(), scene);
|
||||||
|
}
|
||||||
|
if (_drawInFrontDirty) {
|
||||||
|
_drawInFrontDirty = false;
|
||||||
|
_model->setLayeredInFront(getDrawInFront(), scene);
|
||||||
|
}
|
||||||
|
scene->enqueueTransaction(transaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelOverlay::addToScene(Overlay::Pointer overlay, const render::ScenePointer& scene, render::Transaction& transaction) {
|
bool ModelOverlay::addToScene(Overlay::Pointer overlay, const render::ScenePointer& scene, render::Transaction& transaction) {
|
||||||
|
@ -85,21 +102,14 @@ void ModelOverlay::removeFromScene(Overlay::Pointer overlay, const render::Scene
|
||||||
_model->removeFromScene(scene, transaction);
|
_model->removeFromScene(scene, transaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelOverlay::render(RenderArgs* args) {
|
void ModelOverlay::setVisible(bool visible) {
|
||||||
|
Overlay::setVisible(visible);
|
||||||
|
_visibleDirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
// check to see if when we added our model to the scene they were ready, if they were not ready, then
|
void ModelOverlay::setDrawInFront(bool drawInFront) {
|
||||||
// fix them up in the scene
|
Base3DOverlay::setDrawInFront(drawInFront);
|
||||||
render::ScenePointer scene = qApp->getMain3DScene();
|
_drawInFrontDirty = true;
|
||||||
render::Transaction transaction;
|
|
||||||
if (_model->needsFixupInScene()) {
|
|
||||||
_model->removeFromScene(scene, transaction);
|
|
||||||
_model->addToScene(scene, transaction);
|
|
||||||
}
|
|
||||||
|
|
||||||
_model->setVisibleInScene(_visible, scene);
|
|
||||||
_model->setLayeredInFront(getDrawInFront(), scene);
|
|
||||||
|
|
||||||
scene->enqueueTransaction(transaction);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelOverlay::setProperties(const QVariantMap& properties) {
|
void ModelOverlay::setProperties(const QVariantMap& properties) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
ModelOverlay(const ModelOverlay* modelOverlay);
|
ModelOverlay(const ModelOverlay* modelOverlay);
|
||||||
|
|
||||||
virtual void update(float deltatime) override;
|
virtual void update(float deltatime) override;
|
||||||
virtual void render(RenderArgs* args) override;
|
virtual void render(RenderArgs* args) override {};
|
||||||
void setProperties(const QVariantMap& properties) override;
|
void setProperties(const QVariantMap& properties) override;
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
||||||
|
@ -49,6 +49,9 @@ public:
|
||||||
bool hasAnimation() const { return !_animationURL.isEmpty(); }
|
bool hasAnimation() const { return !_animationURL.isEmpty(); }
|
||||||
bool jointsMapped() const { return _jointMappingURL == _animationURL && _jointMappingCompleted; }
|
bool jointsMapped() const { return _jointMappingURL == _animationURL && _jointMappingCompleted; }
|
||||||
|
|
||||||
|
void setVisible(bool visible) override;
|
||||||
|
void setDrawInFront(bool drawInFront) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Transform evalRenderTransform() override;
|
Transform evalRenderTransform() override;
|
||||||
|
|
||||||
|
@ -93,6 +96,9 @@ private:
|
||||||
bool _jointMappingCompleted { false };
|
bool _jointMappingCompleted { false };
|
||||||
QVector<int> _jointMapping; // domain is index into model-joints, range is index into animation-joints
|
QVector<int> _jointMapping; // domain is index into model-joints, range is index into animation-joints
|
||||||
|
|
||||||
|
bool _visibleDirty { false };
|
||||||
|
bool _drawInFrontDirty { false };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ModelOverlay_h
|
#endif // hifi_ModelOverlay_h
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
float getAlphaPulse() const { return _alphaPulse; }
|
float getAlphaPulse() const { return _alphaPulse; }
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
void setVisible(bool visible) { _visible = visible; }
|
virtual void setVisible(bool visible) { _visible = visible; }
|
||||||
void setDrawHUDLayer(bool drawHUDLayer);
|
void setDrawHUDLayer(bool drawHUDLayer);
|
||||||
void setColor(const xColor& color) { _color = color; }
|
void setColor(const xColor& color) { _color = color; }
|
||||||
void setAlpha(float alpha) { _alpha = alpha; }
|
void setAlpha(float alpha) { _alpha = alpha; }
|
||||||
|
|
|
@ -49,6 +49,7 @@ createControllerDisplay = function(config) {
|
||||||
partOverlays: {},
|
partOverlays: {},
|
||||||
parts: {},
|
parts: {},
|
||||||
mappingName: "mapping-display-" + Math.random(),
|
mappingName: "mapping-display-" + Math.random(),
|
||||||
|
partValues: {},
|
||||||
|
|
||||||
setVisible: function(visible) {
|
setVisible: function(visible) {
|
||||||
for (var i = 0; i < this.overlays.length; ++i) {
|
for (var i = 0; i < this.overlays.length; ++i) {
|
||||||
|
@ -109,12 +110,53 @@ createControllerDisplay = function(config) {
|
||||||
for (var partName in controller.parts) {
|
for (var partName in controller.parts) {
|
||||||
overlayID = this.overlays[i++];
|
overlayID = this.overlays[i++];
|
||||||
var part = controller.parts[partName];
|
var part = controller.parts[partName];
|
||||||
var partPosition = Vec3.multiply(sensorScaleFactor, Vec3.sum(controller.position, Vec3.multiplyQbyV(controller.rotation, part.naturalPosition)));
|
localPosition = Vec3.sum(controller.position, Vec3.multiplyQbyV(controller.rotation, part.naturalPosition));
|
||||||
var partDimensions = Vec3.multiply(sensorScaleFactor, part.naturalDimensions);
|
var localRotation;
|
||||||
Overlays.editOverlay(overlayID, {
|
var value = this.partValues[partName];
|
||||||
dimensions: partDimensions,
|
var offset, rotation;
|
||||||
localPosition: partPosition
|
if (value !== undefined) {
|
||||||
});
|
if (part.type === "linear") {
|
||||||
|
var axis = Vec3.multiplyQbyV(controller.rotation, part.axis);
|
||||||
|
offset = Vec3.multiply(part.maxTranslation * value, axis);
|
||||||
|
localPosition = Vec3.sum(localPosition, offset);
|
||||||
|
localRotation = undefined;
|
||||||
|
} else if (part.type === "joystick") {
|
||||||
|
rotation = Quat.fromPitchYawRollDegrees(value.y * part.xHalfAngle, 0, value.x * part.yHalfAngle);
|
||||||
|
if (part.originOffset) {
|
||||||
|
offset = Vec3.multiplyQbyV(rotation, part.originOffset);
|
||||||
|
offset = Vec3.subtract(part.originOffset, offset);
|
||||||
|
} else {
|
||||||
|
offset = { x: 0, y: 0, z: 0 };
|
||||||
|
}
|
||||||
|
localPosition = Vec3.sum(controller.position, Vec3.multiplyQbyV(controller.rotation, Vec3.sum(offset, part.naturalPosition)));
|
||||||
|
localRotation = Quat.multiply(controller.rotation, rotation);
|
||||||
|
} else if (part.type === "rotational") {
|
||||||
|
value = clamp(value, part.minValue, part.maxValue);
|
||||||
|
var pct = (value - part.minValue) / part.maxValue;
|
||||||
|
var angle = pct * part.maxAngle;
|
||||||
|
rotation = Quat.angleAxis(angle, part.axis);
|
||||||
|
if (part.origin) {
|
||||||
|
offset = Vec3.multiplyQbyV(rotation, part.origin);
|
||||||
|
offset = Vec3.subtract(offset, part.origin);
|
||||||
|
} else {
|
||||||
|
offset = { x: 0, y: 0, z: 0 };
|
||||||
|
}
|
||||||
|
localPosition = Vec3.sum(controller.position, Vec3.multiplyQbyV(controller.rotation, Vec3.sum(offset, part.naturalPosition)));
|
||||||
|
localRotation = Quat.multiply(controller.rotation, rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (localRotation !== undefined) {
|
||||||
|
Overlays.editOverlay(overlayID, {
|
||||||
|
dimensions: Vec3.multiply(sensorScaleFactor, part.naturalDimensions),
|
||||||
|
localPosition: Vec3.multiply(sensorScaleFactor, localPosition),
|
||||||
|
localRotation: localRotation
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Overlays.editOverlay(overlayID, {
|
||||||
|
dimensions: Vec3.multiply(sensorScaleFactor, part.naturalDimensions),
|
||||||
|
localPosition: Vec3.multiply(sensorScaleFactor, localPosition)
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,29 +214,13 @@ createControllerDisplay = function(config) {
|
||||||
if (part.type === "rotational") {
|
if (part.type === "rotational") {
|
||||||
var input = resolveHardware(part.input);
|
var input = resolveHardware(part.input);
|
||||||
print("Mapping to: ", part.input, input);
|
print("Mapping to: ", part.input, input);
|
||||||
mapping.from([input]).peek().to(function(controller, overlayID, part) {
|
mapping.from([input]).peek().to(function(partName) {
|
||||||
return function(value) {
|
return function(value) {
|
||||||
value = clamp(value, part.minValue, part.maxValue);
|
// insert the most recent controller value into controllerDisplay.partValues.
|
||||||
|
controllerDisplay.partValues[partName] = value;
|
||||||
var pct = (value - part.minValue) / part.maxValue;
|
controllerDisplay.resize(MyAvatar.sensorToWorldScale);
|
||||||
var angle = pct * part.maxAngle;
|
|
||||||
var rotation = Quat.angleAxis(angle, part.axis);
|
|
||||||
|
|
||||||
var offset = { x: 0, y: 0, z: 0 };
|
|
||||||
if (part.origin) {
|
|
||||||
offset = Vec3.multiplyQbyV(rotation, part.origin);
|
|
||||||
offset = Vec3.subtract(offset, part.origin);
|
|
||||||
}
|
|
||||||
|
|
||||||
var partPosition = Vec3.sum(controller.position,
|
|
||||||
Vec3.multiplyQbyV(controller.rotation, Vec3.sum(offset, part.naturalPosition)));
|
|
||||||
|
|
||||||
Overlays.editOverlay(overlayID, {
|
|
||||||
localPosition: partPosition,
|
|
||||||
localRotation: Quat.multiply(controller.rotation, rotation)
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
}(controller, overlayID, part));
|
}(partName));
|
||||||
} else if (part.type === "touchpad") {
|
} else if (part.type === "touchpad") {
|
||||||
var visibleInput = resolveHardware(part.visibleInput);
|
var visibleInput = resolveHardware(part.visibleInput);
|
||||||
var xInput = resolveHardware(part.xInput);
|
var xInput = resolveHardware(part.xInput);
|
||||||
|
@ -210,69 +236,38 @@ createControllerDisplay = function(config) {
|
||||||
mapping.from([yInput]).peek().invert().to(function(value) {
|
mapping.from([yInput]).peek().invert().to(function(value) {
|
||||||
});
|
});
|
||||||
} else if (part.type === "joystick") {
|
} else if (part.type === "joystick") {
|
||||||
(function(controller, overlayID, part) {
|
(function(part, partName) {
|
||||||
var xInput = resolveHardware(part.xInput);
|
var xInput = resolveHardware(part.xInput);
|
||||||
var yInput = resolveHardware(part.yInput);
|
var yInput = resolveHardware(part.yInput);
|
||||||
|
|
||||||
var xvalue = 0;
|
|
||||||
var yvalue = 0;
|
|
||||||
|
|
||||||
function calculatePositionAndRotation(xValue, yValue) {
|
|
||||||
var rotation = Quat.fromPitchYawRollDegrees(yValue * part.xHalfAngle, 0, xValue * part.yHalfAngle);
|
|
||||||
|
|
||||||
var offset = { x: 0, y: 0, z: 0 };
|
|
||||||
if (part.originOffset) {
|
|
||||||
offset = Vec3.multiplyQbyV(rotation, part.originOffset);
|
|
||||||
offset = Vec3.subtract(part.originOffset, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
var partPosition = Vec3.sum(controller.position,
|
|
||||||
Vec3.multiplyQbyV(controller.rotation, Vec3.sum(offset, part.naturalPosition)));
|
|
||||||
|
|
||||||
var partRotation = Quat.multiply(controller.rotation, rotation);
|
|
||||||
|
|
||||||
return {
|
|
||||||
position: partPosition,
|
|
||||||
rotation: partRotation
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
mapping.from([xInput]).peek().to(function(value) {
|
mapping.from([xInput]).peek().to(function(value) {
|
||||||
xvalue = value;
|
// insert the most recent controller value into controllerDisplay.partValues.
|
||||||
var posRot = calculatePositionAndRotation(xvalue, yvalue);
|
if (controllerDisplay.partValues[partName]) {
|
||||||
Overlays.editOverlay(overlayID, {
|
controllerDisplay.partValues[partName].x = value;
|
||||||
localPosition: posRot.position,
|
} else {
|
||||||
localRotation: posRot.rotation
|
controllerDisplay.partValues[partName] = {x: value, y: 0};
|
||||||
});
|
}
|
||||||
|
controllerDisplay.resize(MyAvatar.sensorToWorldScale);
|
||||||
});
|
});
|
||||||
|
|
||||||
mapping.from([yInput]).peek().to(function(value) {
|
mapping.from([yInput]).peek().to(function(value) {
|
||||||
yvalue = value;
|
// insert the most recent controller value into controllerDisplay.partValues.
|
||||||
var posRot = calculatePositionAndRotation(xvalue, yvalue);
|
if (controllerDisplay.partValues[partName]) {
|
||||||
Overlays.editOverlay(overlayID, {
|
controllerDisplay.partValues[partName].y = value;
|
||||||
localPosition: posRot.position,
|
} else {
|
||||||
localRotation: posRot.rotation
|
controllerDisplay.partValues[partName] = {x: 0, y: value};
|
||||||
});
|
}
|
||||||
|
controllerDisplay.resize(MyAvatar.sensorToWorldScale);
|
||||||
});
|
});
|
||||||
})(controller, overlayID, part);
|
})(part, partName);
|
||||||
|
|
||||||
} else if (part.type === "linear") {
|
} else if (part.type === "linear") {
|
||||||
(function(controller, overlayID, part) {
|
(function(part, partName) {
|
||||||
var input = resolveHardware(part.input);
|
var input = resolveHardware(part.input);
|
||||||
|
|
||||||
mapping.from([input]).peek().to(function(value) {
|
mapping.from([input]).peek().to(function(value) {
|
||||||
var axis = Vec3.multiplyQbyV(controller.rotation, part.axis);
|
// insert the most recent controller value into controllerDisplay.partValues.
|
||||||
var offset = Vec3.multiply(part.maxTranslation * value, axis);
|
controllerDisplay.partValues[partName] = value;
|
||||||
|
controllerDisplay.resize(MyAvatar.sensorToWorldScale);
|
||||||
var partPosition = Vec3.sum(controller.position, Vec3.multiplyQbyV(controller.rotation, part.naturalPosition));
|
|
||||||
var position = Vec3.sum(partPosition, offset);
|
|
||||||
|
|
||||||
Overlays.editOverlay(overlayID, {
|
|
||||||
localPosition: position
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
})(part, partName);
|
||||||
})(controller, overlayID, part);
|
|
||||||
|
|
||||||
} else if (part.type === "static") {
|
} else if (part.type === "static") {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
|
Loading…
Reference in a new issue