mirror of
https://github.com/overte-org/overte.git
synced 2025-07-04 08:09:22 +02:00
adding constants, removing entity creation in cpp
This commit is contained in:
parent
44ed9e607b
commit
ee1a14505a
2 changed files with 19 additions and 15 deletions
|
@ -1298,15 +1298,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
connect(this, &Application::activeDisplayPluginChanged, this, [&](){
|
connect(this, &Application::activeDisplayPluginChanged, this, [&](){
|
||||||
#if !defined(Q_OS_ANDROID)
|
#if !defined(Q_OS_ANDROID)
|
||||||
if (!getLoginDialogPoppedUp() && _desktopRootItemCreated) {
|
if (!getLoginDialogPoppedUp() && _desktopRootItemCreated) {
|
||||||
if (isHMDMode()) {
|
/* if (isHMDMode()) {*/
|
||||||
createAvatarInputsBar();
|
//createAvatarInputsBar();
|
||||||
auto offscreenUi = getOffscreenUI();
|
//auto offscreenUi = getOffscreenUI();
|
||||||
offscreenUi->hide(AVATAR_INPUTS_BAR_QML.toString());
|
//offscreenUi->hide(AVATAR_INPUTS_BAR_QML.toString());
|
||||||
} else {
|
//} else {
|
||||||
destroyAvatarInputsBar();
|
//destroyAvatarInputsBar();
|
||||||
auto offscreenUi = getOffscreenUI();
|
//auto offscreenUi = getOffscreenUI();
|
||||||
offscreenUi->show(AVATAR_INPUTS_BAR_QML.toString(), "AvatarInputsBar");
|
//offscreenUi->show(AVATAR_INPUTS_BAR_QML.toString(), "AvatarInputsBar");
|
||||||
}
|
/*}*/
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,10 +11,16 @@
|
||||||
function onClicked(){
|
function onClicked(){
|
||||||
onCreateAvatarInputsBarEntity = !onCreateAvatarInputsBarEntity;
|
onCreateAvatarInputsBarEntity = !onCreateAvatarInputsBarEntity;
|
||||||
button.editProperties({isActive: onCreateAvatarInputsBarEntity});
|
button.editProperties({isActive: onCreateAvatarInputsBarEntity});
|
||||||
var micBarDimensions = {x: 0.036, y: 0.048, z: 0.3};
|
// QML NATURAL DIMENSIONS
|
||||||
var bubbleIconDimensions = {x: 0.036, y: 0.036, z: 0.3};
|
var MIC_BAR_DIMENSIONS = {x: 0.036, y: 0.048, z: 0.3};
|
||||||
var micBarLocalPosition = {x: (-(micBarDimensions.x / 2)) - 0.2, y: -0.125, z: -0.5};
|
var BUBBLE_ICON_DIMENSIONS = {x: 0.036, y: 0.036, z: 0.3};
|
||||||
var bubbleIconLocalPosition = {x: (micBarDimensions.x * 1.2 / 2) - 0.2, y: ((micBarDimensions.y - bubbleIconDimensions.y) / 2 - 0.125), z: -0.5};
|
// CONSTANTS
|
||||||
|
var LOCAL_POSITION_X_OFFSET = -0.2;
|
||||||
|
var LOCAL_POSITION_Y_OFFSET = -0.125;
|
||||||
|
var LOCAL_POSITION_Z_OFFSET = -0.5;
|
||||||
|
// POSITIONS
|
||||||
|
var micBarLocalPosition = {x: (-(micBarDimensions.x / 2)) + LOCAL_POSITION_X_OFFSET, y: LOCAL_POSITION_Y_OFFSET, z: LOCAL_POSITION_Z_OFFSET};
|
||||||
|
var bubbleIconLocalPosition = {x: (micBarDimensions.x * 1.2 / 2) + LOCAL_POSITION_X_OFFSET, y: ((micBarDimensions.y - bubbleIconDimensions.y) / 2 + LOCAL_POSITION_Y_OFFSET), z: LOCAL_POSITION_Z_OFFSET};
|
||||||
if (onCreateAvatarInputsBarEntity) {
|
if (onCreateAvatarInputsBarEntity) {
|
||||||
var props = {
|
var props = {
|
||||||
type: "Web",
|
type: "Web",
|
||||||
|
@ -33,8 +39,6 @@
|
||||||
type: "Web",
|
type: "Web",
|
||||||
parentID: MyAvatar.SELF_ID,
|
parentID: MyAvatar.SELF_ID,
|
||||||
parentJointIndex: MyAvatar.getJointIndex("_CAMERA_MATRIX"),
|
parentJointIndex: MyAvatar.getJointIndex("_CAMERA_MATRIX"),
|
||||||
// y is 0.01 - (0.048 + 0.036) / 2
|
|
||||||
// have 10% spacing separation between the entities
|
|
||||||
localPosition: bubbleIconLocalPosition,
|
localPosition: bubbleIconLocalPosition,
|
||||||
localRotation: Quat.cancelOutRollAndPitch(Quat.lookAtSimple(Camera.orientation, bubbleIconLocalPosition)),
|
localRotation: Quat.cancelOutRollAndPitch(Quat.lookAtSimple(Camera.orientation, bubbleIconLocalPosition)),
|
||||||
sourceUrl: Script.resourcesPath() + "qml/BubbleIcon.qml",
|
sourceUrl: Script.resourcesPath() + "qml/BubbleIcon.qml",
|
||||||
|
|
Loading…
Reference in a new issue