mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 07:32:10 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi
This commit is contained in:
commit
1f4b149f75
18 changed files with 371 additions and 27 deletions
BIN
interface/resources/avatar/animations/sitting_idle.fbx
Normal file
BIN
interface/resources/avatar/animations/sitting_idle.fbx
Normal file
Binary file not shown.
|
@ -583,6 +583,28 @@
|
|||
"outputJoints": ["LeftFoot", "RightFoot"],
|
||||
"currentState": "idle",
|
||||
"states": [
|
||||
{
|
||||
"id": "seated",
|
||||
"interpTarget": 20,
|
||||
"interpDuration": 8,
|
||||
"interpType": "snapshotPrev",
|
||||
"transitions": [
|
||||
{ "var": "isNotMoving", "state": "idle" },
|
||||
{ "var": "isMovingForward", "state": "WALKFWD" },
|
||||
{ "var": "isMovingBackward", "state": "WALKBWD" },
|
||||
{ "var": "isMovingRight", "state": "STRAFERIGHT" },
|
||||
{ "var": "isMovingLeft", "state": "STRAFELEFT" },
|
||||
{ "var": "isTurningRight", "state": "turnRight" },
|
||||
{ "var": "isTurningLeft", "state": "turnLeft" },
|
||||
{ "var": "isFlying", "state": "fly" },
|
||||
{ "var": "isTakeoffStand", "state": "takeoffStand" },
|
||||
{ "var": "isTakeoffRun", "state": "TAKEOFFRUN" },
|
||||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "idle",
|
||||
"interpTarget": 20,
|
||||
|
@ -601,7 +623,8 @@
|
|||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -622,7 +645,8 @@
|
|||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -644,7 +668,8 @@
|
|||
{ "var": "isTakeoffStand", "state": "takeoffStand" },
|
||||
{ "var": "isTakeoffRun", "state": "TAKEOFFRUN" },
|
||||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" }
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -665,7 +690,8 @@
|
|||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -686,7 +712,8 @@
|
|||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -707,7 +734,8 @@
|
|||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -728,7 +756,8 @@
|
|||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -748,7 +777,8 @@
|
|||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -768,7 +798,8 @@
|
|||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -789,7 +820,8 @@
|
|||
{ "var": "isTakeoffStand", "state": "takeoffStand" },
|
||||
{ "var": "isTakeoffRun", "state": "TAKEOFFRUN" },
|
||||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" }
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -810,7 +842,8 @@
|
|||
{ "var": "isTakeoffStand", "state": "takeoffStand" },
|
||||
{ "var": "isTakeoffRun", "state": "TAKEOFFRUN" },
|
||||
{ "var": "isInAirStand", "state": "inAirStand" },
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" }
|
||||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -884,7 +917,8 @@
|
|||
{ "var": "isInAirRun", "state": "INAIRRUN" },
|
||||
{ "var": "landStandOnDone", "state": "idle" },
|
||||
{ "var": "isMovingRightHmd", "state": "strafeRightHmd" },
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" }
|
||||
{ "var": "isMovingLeftHmd", "state": "strafeLeftHmd" },
|
||||
{ "var": "isSeated", "state": "seated" }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -901,6 +935,18 @@
|
|||
]
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"id": "seated",
|
||||
"type": "clip",
|
||||
"data": {
|
||||
"url": "qrc:///avatar/animations/sitting_idle.fbx",
|
||||
"startFrame": 1.0,
|
||||
"endFrame": 350.0,
|
||||
"timeScale": 1.0,
|
||||
"loopFlag": true
|
||||
},
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": "idle",
|
||||
"type": "stateMachine",
|
||||
|
|
|
@ -14,7 +14,6 @@ Item {
|
|||
HifiStyles.HifiConstants { id: hifistyles }
|
||||
|
||||
height: 600
|
||||
property variant permissionsBar: {'securityOrigin':'none','feature':'none'}
|
||||
property alias url: webview.url
|
||||
|
||||
property bool canGoBack: webview.canGoBack
|
||||
|
@ -30,6 +29,10 @@ Item {
|
|||
webview.profile = profile;
|
||||
}
|
||||
|
||||
onUrlChanged: {
|
||||
permissionPopupBackground.visible = false;
|
||||
}
|
||||
|
||||
WebEngineView {
|
||||
id: webview
|
||||
objectName: "webEngineView"
|
||||
|
@ -84,7 +87,14 @@ Item {
|
|||
}
|
||||
|
||||
onFeaturePermissionRequested: {
|
||||
grantFeaturePermission(securityOrigin, feature, false);
|
||||
if (permissionPopupBackground.visible === true) {
|
||||
console.log("Browser engine requested a new permission, but user is already being presented with a different permission request. Aborting request for new permission...");
|
||||
return;
|
||||
}
|
||||
permissionPopupBackground.securityOrigin = securityOrigin;
|
||||
permissionPopupBackground.feature = feature;
|
||||
|
||||
permissionPopupBackground.visible = true;
|
||||
}
|
||||
|
||||
onLoadingChanged: {
|
||||
|
@ -122,4 +132,11 @@ Item {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HifiControls.PermissionPopupBackground {
|
||||
id: permissionPopupBackground
|
||||
onSendPermission: {
|
||||
webview.grantFeaturePermission(securityOrigin, feature, shouldGivePermission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import QtWebChannel 1.0
|
|||
import QtQuick.Controls 2.2
|
||||
|
||||
import stylesUit 1.0 as StylesUIt
|
||||
import controlsUit 1.0 as ControlsUit
|
||||
|
||||
Item {
|
||||
id: flick
|
||||
|
@ -28,6 +29,10 @@ Item {
|
|||
|
||||
property bool blurOnCtrlShift: true
|
||||
|
||||
onUrlChanged: {
|
||||
permissionPopupBackground.visible = false;
|
||||
}
|
||||
|
||||
StylesUIt.HifiConstants {
|
||||
id: hifi
|
||||
}
|
||||
|
@ -141,7 +146,15 @@ Item {
|
|||
}
|
||||
|
||||
onFeaturePermissionRequested: {
|
||||
grantFeaturePermission(securityOrigin, feature, false);
|
||||
if (permissionPopupBackground.visible === true) {
|
||||
console.log("Browser engine requested a new permission, but user is already being presented with a different permission request. Aborting request for new permission...");
|
||||
return;
|
||||
}
|
||||
|
||||
permissionPopupBackground.securityOrigin = securityOrigin;
|
||||
permissionPopupBackground.feature = feature;
|
||||
|
||||
permissionPopupBackground.visible = true;
|
||||
}
|
||||
|
||||
//disable popup
|
||||
|
@ -186,4 +199,12 @@ Item {
|
|||
webViewCore.focus = false;
|
||||
}
|
||||
}
|
||||
|
||||
ControlsUit.PermissionPopupBackground {
|
||||
id: permissionPopupBackground
|
||||
onSendPermission: {
|
||||
webViewCore.grantFeaturePermission(securityOrigin, feature, shouldGivePermission);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
|
||||
import QtQuick 2.7
|
||||
import QtWebEngine 1.5
|
||||
import controlsUit 1.0 as ControlsUit
|
||||
|
||||
WebEngineView {
|
||||
id: root
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("Connecting JS messaging to Hifi Logging")
|
||||
// Ensure the JS from the web-engine makes it to our logging
|
||||
|
@ -22,6 +22,10 @@ WebEngineView {
|
|||
});
|
||||
}
|
||||
|
||||
onUrlChanged: {
|
||||
permissionPopupBackground.visible = false;
|
||||
}
|
||||
|
||||
onLoadingChanged: {
|
||||
// Required to support clicking on "hifi://" links
|
||||
if (WebEngineView.LoadStartedStatus == loadRequest.status) {
|
||||
|
@ -37,6 +41,21 @@ WebEngineView {
|
|||
WebSpinner { }
|
||||
|
||||
onFeaturePermissionRequested: {
|
||||
grantFeaturePermission(securityOrigin, feature, false);
|
||||
if (permissionPopupBackground.visible === true) {
|
||||
console.log("Browser engine requested a new permission, but user is already being presented with a different permission request. Aborting request for new permission...");
|
||||
return;
|
||||
}
|
||||
permissionPopupBackground.securityOrigin = securityOrigin;
|
||||
permissionPopupBackground.feature = feature;
|
||||
|
||||
permissionPopupBackground.visible = true;
|
||||
}
|
||||
|
||||
ControlsUit.PermissionPopupBackground {
|
||||
id: permissionPopupBackground
|
||||
z: 100
|
||||
onSendPermission: {
|
||||
root.grantFeaturePermission(securityOrigin, feature, shouldGivePermission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
90
interface/resources/qml/controlsUit/PermissionPopup.qml
Normal file
90
interface/resources/qml/controlsUit/PermissionPopup.qml
Normal file
|
@ -0,0 +1,90 @@
|
|||
import QtQuick 2.5
|
||||
import QtWebEngine 1.5
|
||||
import QtQuick.Layouts 1.3
|
||||
import controlsUit 1.0 as HifiControls
|
||||
import stylesUit 1.0 as HifiStyles
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
width: 750
|
||||
height: 210
|
||||
color: hifi.colors.white
|
||||
|
||||
anchors.centerIn: parent
|
||||
readonly property var permissionLanguage: ({
|
||||
[WebEngineView.MediaAudioCapture]: "access an audio input device",
|
||||
[WebEngineView.MediaVideoCapture]: "access a video device, like your webcam",
|
||||
[WebEngineView.MediaAudioVideoCapture]: "access an audio input device and video device",
|
||||
[WebEngineView.Geolocation]: "access your location",
|
||||
[WebEngineView.DesktopVideoCapture]: "capture video from your desktop",
|
||||
[WebEngineView.DesktopAudioVideoCapture]: "capture audio and video from your desktop",
|
||||
"none": "Undefined permission being requested"
|
||||
})
|
||||
property string currentRequestedPermission
|
||||
signal permissionButtonPressed(int buttonNumber)
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
Rectangle {
|
||||
Layout.preferredHeight: 75
|
||||
Layout.preferredWidth: parent.width
|
||||
|
||||
HifiStyles.RalewayBold {
|
||||
text: "REQUEST FOR DEVICE ACCESS"
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
wrapMode: Text.WordWrap
|
||||
color: hifi.colors.black
|
||||
size: 30
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.preferredHeight: 35
|
||||
Layout.preferredWidth: parent.width
|
||||
|
||||
HifiStyles.RalewayLight {
|
||||
text: "This website is attempting to " + root.permissionLanguage[root.currentRequestedPermission] + "."
|
||||
|
||||
anchors.centerIn: parent
|
||||
wrapMode: Text.Wrap
|
||||
size: 20
|
||||
color: hifi.colors.black
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.preferredHeight: 100
|
||||
Layout.preferredWidth: parent.width
|
||||
Layout.topMargin: 35
|
||||
property int space: 8
|
||||
|
||||
HifiControls.Button {
|
||||
text: "Don't Allow"
|
||||
|
||||
anchors.right: parent.horizontalCenter
|
||||
anchors.rightMargin: parent.space
|
||||
width: 125
|
||||
color: hifi.buttons.red
|
||||
height: 38
|
||||
onClicked: {
|
||||
root.permissionButtonPressed(0);
|
||||
}
|
||||
}
|
||||
HifiControls.Button {
|
||||
text: "Yes allow access"
|
||||
|
||||
anchors.left: parent.horizontalCenter
|
||||
anchors.leftMargin: parent.space
|
||||
color: hifi.buttons.blue
|
||||
width: 155
|
||||
height: 38
|
||||
onClicked: {
|
||||
root.permissionButtonPressed(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
import QtQuick 2.5
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
color: Qt.rgba(0, 0, 0, 0.5);
|
||||
visible: false
|
||||
property string securityOrigin: 'none'
|
||||
property string feature: 'none'
|
||||
signal sendPermission(string securityOrigin, string feature, bool shouldGivePermission)
|
||||
|
||||
onFeatureChanged: {
|
||||
permissionPopupItem.currentRequestedPermission = feature;
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: false
|
||||
}
|
||||
|
||||
PermissionPopup {
|
||||
id: permissionPopupItem
|
||||
onPermissionButtonPressed: {
|
||||
if (buttonNumber === 0) {
|
||||
root.sendPermission(securityOrigin, feature, false);
|
||||
} else {
|
||||
root.sendPermission(securityOrigin, feature, true);
|
||||
}
|
||||
root.visible = false;
|
||||
securityOrigin = 'none';
|
||||
feature = 'none';
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,6 +15,8 @@ Key 1.0 Key.qml
|
|||
Keyboard 1.0 Keyboard.qml
|
||||
Label 1.0 Label.qml
|
||||
QueuedButton 1.0 QueuedButton.qml
|
||||
PermissionPopup 1.0 PermissionPopup.qml
|
||||
PermissionPopupBackground 1.0 PermissionPopupBackground.qml
|
||||
RadioButton 1.0 RadioButton.qml
|
||||
ScrollBar 1.0 ScrollBar.qml
|
||||
Separator 1.0 Separator.qml
|
||||
|
|
|
@ -6207,3 +6207,51 @@ void MyAvatar::sendPacket(const QUuid& entityID) const {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
void MyAvatar::setSitDriveKeysStatus(bool enabled) {
|
||||
const std::vector<DriveKeys> DISABLED_DRIVE_KEYS_DURING_SIT = {
|
||||
DriveKeys::TRANSLATE_X,
|
||||
DriveKeys::TRANSLATE_Y,
|
||||
DriveKeys::TRANSLATE_Z,
|
||||
DriveKeys::STEP_TRANSLATE_X,
|
||||
DriveKeys::STEP_TRANSLATE_Y,
|
||||
DriveKeys::STEP_TRANSLATE_Z
|
||||
};
|
||||
for (auto key : DISABLED_DRIVE_KEYS_DURING_SIT) {
|
||||
if (enabled) {
|
||||
enableDriveKey(key);
|
||||
} else {
|
||||
disableDriveKey(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MyAvatar::beginSit(const glm::vec3& position, const glm::quat& rotation) {
|
||||
_characterController.setSeated(true);
|
||||
setCollisionsEnabled(false);
|
||||
setHMDLeanRecenterEnabled(false);
|
||||
// Disable movement
|
||||
setSitDriveKeysStatus(false);
|
||||
centerBody();
|
||||
int hipIndex = getJointIndex("Hips");
|
||||
clearPinOnJoint(hipIndex);
|
||||
goToLocation(position, true, rotation, false, false);
|
||||
pinJoint(hipIndex, position, rotation);
|
||||
}
|
||||
|
||||
void MyAvatar::endSit(const glm::vec3& position, const glm::quat& rotation) {
|
||||
if (_characterController.getSeated()) {
|
||||
clearPinOnJoint(getJointIndex("Hips"));
|
||||
_characterController.setSeated(false);
|
||||
setCollisionsEnabled(true);
|
||||
setHMDLeanRecenterEnabled(true);
|
||||
centerBody();
|
||||
goToLocation(position, true, rotation, false, false);
|
||||
float TIME_BEFORE_DRIVE_ENABLED_MS = 150.0f;
|
||||
QTimer::singleShot(TIME_BEFORE_DRIVE_ENABLED_MS, [this]() {
|
||||
// Enable movement again
|
||||
setSitDriveKeysStatus(true);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -1835,6 +1835,22 @@ public:
|
|||
*/
|
||||
Q_INVOKABLE QVariantList getCollidingFlowJoints();
|
||||
|
||||
/**jsdoc
|
||||
* Starts a sitting action for the avatar
|
||||
* @function MyAvatar.beginSit
|
||||
* @param {Vec3} position - The point in space where the avatar will sit.
|
||||
* @param {Quat} rotation - Initial absolute orientation of the avatar once is seated.
|
||||
*/
|
||||
Q_INVOKABLE void beginSit(const glm::vec3& position, const glm::quat& rotation);
|
||||
|
||||
/**jsdoc
|
||||
* Ends a sitting action for the avatar
|
||||
* @function MyAvatar.endSit
|
||||
* @param {Vec3} position - The position of the avatar when standing up.
|
||||
* @param {Quat} rotation - The absolute rotation of the avatar once the sitting action ends.
|
||||
*/
|
||||
Q_INVOKABLE void endSit(const glm::vec3& position, const glm::quat& rotation);
|
||||
|
||||
int getOverrideJointCount() const;
|
||||
bool getFlowActive() const;
|
||||
bool getNetworkGraphActive() const;
|
||||
|
@ -2521,6 +2537,7 @@ private:
|
|||
|
||||
virtual void updatePalms() override {}
|
||||
void lateUpdatePalms();
|
||||
void setSitDriveKeysStatus(bool enabled);
|
||||
|
||||
void clampTargetScaleToDomainLimits();
|
||||
void clampScaleChangeToDomainLimits(float desiredScale);
|
||||
|
|
|
@ -32,6 +32,8 @@ Rig::CharacterControllerState convertCharacterControllerState(CharacterControlle
|
|||
return Rig::CharacterControllerState::InAir;
|
||||
case CharacterController::State::Hover:
|
||||
return Rig::CharacterControllerState::Hover;
|
||||
case CharacterController::State::Seated:
|
||||
return Rig::CharacterControllerState::Seated;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -410,8 +410,8 @@ void LauncherManager::getMostRecentBuilds(CString& launcherUrlOut, CString& laun
|
|||
error = LauncherUtils::ResponseError::ParsingJSON;
|
||||
}
|
||||
}
|
||||
onMostRecentBuildsReceived(response, error);
|
||||
}
|
||||
onMostRecentBuildsReceived(response, error);
|
||||
};
|
||||
LauncherUtils::httpCallOnThread(L"HQ Launcher",
|
||||
L"thunder.highfidelity.com",
|
||||
|
|
|
@ -1092,6 +1092,11 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
_desiredStateAge = 0.0f;
|
||||
}
|
||||
_desiredState = RigRole::Takeoff;
|
||||
} else if (ccState == CharacterControllerState::Seated) {
|
||||
if (_desiredState != RigRole::Seated) {
|
||||
_desiredStateAge = 0.0f;
|
||||
}
|
||||
_desiredState = RigRole::Seated;
|
||||
} else {
|
||||
float moveThresh;
|
||||
if (_state != RigRole::Move) {
|
||||
|
@ -1216,6 +1221,7 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
_animVars.set("isInAirStand", false);
|
||||
_animVars.set("isInAirRun", false);
|
||||
_animVars.set("isNotInAir", true);
|
||||
_animVars.set("isSeated", false);
|
||||
|
||||
} else if (_state == RigRole::Turn) {
|
||||
if (turningSpeed > 0.0f) {
|
||||
|
@ -1244,6 +1250,7 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
_animVars.set("isInAirStand", false);
|
||||
_animVars.set("isInAirRun", false);
|
||||
_animVars.set("isNotInAir", true);
|
||||
_animVars.set("isSeated", false);
|
||||
|
||||
} else if (_state == RigRole::Idle) {
|
||||
// default anim vars to notMoving and notTurning
|
||||
|
@ -1265,6 +1272,7 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
_animVars.set("isInAirStand", false);
|
||||
_animVars.set("isInAirRun", false);
|
||||
_animVars.set("isNotInAir", true);
|
||||
_animVars.set("isSeated", false);
|
||||
|
||||
} else if (_state == RigRole::Hover) {
|
||||
// flying.
|
||||
|
@ -1286,6 +1294,7 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
_animVars.set("isInAirStand", false);
|
||||
_animVars.set("isInAirRun", false);
|
||||
_animVars.set("isNotInAir", true);
|
||||
_animVars.set("isSeated", false);
|
||||
|
||||
} else if (_state == RigRole::Takeoff) {
|
||||
// jumping in-air
|
||||
|
@ -1315,6 +1324,7 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
_animVars.set("isInAirStand", false);
|
||||
_animVars.set("isInAirRun", false);
|
||||
_animVars.set("isNotInAir", false);
|
||||
_animVars.set("isSeated", false);
|
||||
|
||||
} else if (_state == RigRole::InAir) {
|
||||
// jumping in-air
|
||||
|
@ -1333,6 +1343,7 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
_animVars.set("isTakeoffStand", false);
|
||||
_animVars.set("isTakeoffRun", false);
|
||||
_animVars.set("isNotTakeoff", true);
|
||||
_animVars.set("isSeated", false);
|
||||
|
||||
bool inAirRun = forwardSpeed > 0.1f;
|
||||
if (inAirRun) {
|
||||
|
@ -1354,6 +1365,26 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
float alpha = glm::clamp((-workingVelocity.y * sensorToWorldScale) / jumpSpeed, -1.0f, 1.0f) + 1.0f;
|
||||
|
||||
_animVars.set("inAirAlpha", alpha);
|
||||
} else if (_state == RigRole::Seated) {
|
||||
_animVars.set("isMovingForward", false);
|
||||
_animVars.set("isMovingBackward", false);
|
||||
_animVars.set("isMovingRight", false);
|
||||
_animVars.set("isMovingLeft", false);
|
||||
_animVars.set("isMovingRightHmd", false);
|
||||
_animVars.set("isMovingLeftHmd", false);
|
||||
_animVars.set("isNotMoving", false);
|
||||
_animVars.set("isTurningRight", false);
|
||||
_animVars.set("isTurningLeft", false);
|
||||
_animVars.set("isNotTurning", true);
|
||||
_animVars.set("isFlying", false);
|
||||
_animVars.set("isNotFlying", true);
|
||||
_animVars.set("isTakeoffStand", false);
|
||||
_animVars.set("isTakeoffRun", false);
|
||||
_animVars.set("isNotTakeoff", true);
|
||||
_animVars.set("isInAirStand", false);
|
||||
_animVars.set("isInAirRun", false);
|
||||
_animVars.set("isNotInAir", true);
|
||||
_animVars.set("isSeated", true);
|
||||
}
|
||||
|
||||
t += deltaTime;
|
||||
|
|
|
@ -109,7 +109,8 @@ public:
|
|||
Ground = 0,
|
||||
Takeoff,
|
||||
InAir,
|
||||
Hover
|
||||
Hover,
|
||||
Seated
|
||||
};
|
||||
|
||||
Rig();
|
||||
|
@ -339,7 +340,8 @@ protected:
|
|||
Move,
|
||||
Hover,
|
||||
Takeoff,
|
||||
InAir
|
||||
InAir,
|
||||
Seated
|
||||
};
|
||||
RigRole _state { RigRole::Idle };
|
||||
RigRole _desiredState { RigRole::Idle };
|
||||
|
|
|
@ -384,6 +384,8 @@ static const char* stateToStr(CharacterController::State state) {
|
|||
return "InAir";
|
||||
case CharacterController::State::Hover:
|
||||
return "Hover";
|
||||
case CharacterController::State::Seated:
|
||||
return "Seated";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
|
@ -739,9 +741,11 @@ void CharacterController::updateState() {
|
|||
// disable normal state transitions while collisionless
|
||||
const btScalar MAX_WALKING_SPEED = 2.65f;
|
||||
if (collisionMask == BULLET_COLLISION_MASK_COLLISIONLESS) {
|
||||
// when collisionless: only switch between State::Ground and State::Hover
|
||||
// when collisionless: only switch between State::Ground, State::Hover and State::Seated
|
||||
// and bypass state debugging
|
||||
if (rayHasHit) {
|
||||
if (_isSeated) {
|
||||
_state = State::Seated;
|
||||
} else if (rayHasHit) {
|
||||
if (velocity.length() > (MAX_WALKING_SPEED)) {
|
||||
_state = State::Hover;
|
||||
} else {
|
||||
|
@ -802,7 +806,7 @@ void CharacterController::updateState() {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case State::Hover:
|
||||
case State::Hover: {
|
||||
btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length();
|
||||
bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f);
|
||||
if (!_zoneFlyingAllowed) {
|
||||
|
@ -815,6 +819,11 @@ void CharacterController::updateState() {
|
|||
SET_STATE(State::Ground, "touching ground");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case State::Seated: {
|
||||
SET_STATE(State::Ground, "Standing up");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,8 @@ public:
|
|||
Ground = 0,
|
||||
Takeoff,
|
||||
InAir,
|
||||
Hover
|
||||
Hover,
|
||||
Seated
|
||||
};
|
||||
|
||||
State getState() const { return _state; }
|
||||
|
@ -135,6 +136,8 @@ public:
|
|||
void setCollisionlessAllowed(bool value);
|
||||
|
||||
void setPendingFlagsUpdateCollisionMask(){ _pendingFlags |= PENDING_FLAG_UPDATE_COLLISION_MASK; }
|
||||
void setSeated(bool isSeated) { _isSeated = isSeated; }
|
||||
bool getSeated() { return _isSeated; }
|
||||
|
||||
protected:
|
||||
#ifdef DEBUG_STATE_CHANGE
|
||||
|
@ -208,6 +211,7 @@ protected:
|
|||
State _state;
|
||||
bool _isPushingUp;
|
||||
bool _isStuck { false };
|
||||
bool _isSeated { false };
|
||||
|
||||
btDynamicsWorld* _dynamicsWorld { nullptr };
|
||||
btRigidBody* _rigidBody { nullptr };
|
||||
|
|
|
@ -97,8 +97,8 @@ bool filterOnProcessors(const platform::json& computer, const platform::json& cp
|
|||
|
||||
// intel integrated graphics
|
||||
if (gpuVendor.find(keys::gpu::vendor_Intel) != std::string::npos) {
|
||||
// go mid because GPU
|
||||
tier = Profiler::Tier::MID;
|
||||
// go LOW because Intel GPU
|
||||
tier = Profiler::Tier::LOW;
|
||||
return true;
|
||||
}
|
||||
// AMD gpu
|
||||
|
|
|
@ -59,6 +59,7 @@ var DISTANCE_SCALER_ALWAYS_ON = 0.45;
|
|||
var distanceScaler = DISTANCE_SCALER_ON;
|
||||
var userScaler = 1.0;
|
||||
var DEFAULT_LINE_HEIGHT = entityProps.lineHeight;
|
||||
var ADDITIONAL_PADDING = 1.06;
|
||||
function calculateInitialProperties(uuid) {
|
||||
var adjustedScaler = null;
|
||||
var distance = null;
|
||||
|
@ -82,7 +83,7 @@ function calculateInitialProperties(uuid) {
|
|||
distanceScaler = avatarNametagMode === "on" ? DISTANCE_SCALER_ON : DISTANCE_SCALER_ALWAYS_ON;
|
||||
adjustedScaler = distance * distanceScaler;
|
||||
// Get the new dimensions from the text helper
|
||||
dimensions = [textHelper.getTotalTextLength(), DEFAULT_LINE_HEIGHT, Z_SIZE];
|
||||
dimensions = [textHelper.getTotalTextLength() * ADDITIONAL_PADDING, DEFAULT_LINE_HEIGHT, Z_SIZE];
|
||||
// Adjust the dimensions by the modified distance scaler
|
||||
scaledDimensions = Vec3.multiply(dimensions, adjustedScaler);
|
||||
|
||||
|
|
Loading…
Reference in a new issue