mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 14:09:47 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into addViewFrustumToAvatarMixer
This commit is contained in:
commit
be62df2001
5 changed files with 52 additions and 36 deletions
|
@ -66,7 +66,6 @@
|
||||||
#include <ErrorDialog.h>
|
#include <ErrorDialog.h>
|
||||||
#include <FileScriptingInterface.h>
|
#include <FileScriptingInterface.h>
|
||||||
#include <Finally.h>
|
#include <Finally.h>
|
||||||
#include <FingerprintUtils.h>
|
|
||||||
#include <FramebufferCache.h>
|
#include <FramebufferCache.h>
|
||||||
#include <gpu/Batch.h>
|
#include <gpu/Batch.h>
|
||||||
#include <gpu/Context.h>
|
#include <gpu/Context.h>
|
||||||
|
@ -614,9 +613,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
|
|
||||||
Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
|
Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
|
||||||
|
|
||||||
// TODO: This is temporary, while developing
|
|
||||||
FingerprintUtils::getMachineFingerprint();
|
|
||||||
// End TODO
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
// Set up a watchdog thread to intentionally crash the application on deadlocks
|
// Set up a watchdog thread to intentionally crash the application on deadlocks
|
||||||
|
|
|
@ -134,12 +134,17 @@ void AvatarHashMap::processAvatarIdentityPacket(QSharedPointer<ReceivedMessage>
|
||||||
// make sure this isn't for an ignored avatar
|
// make sure this isn't for an ignored avatar
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
static auto EMPTY = QUuid();
|
static auto EMPTY = QUuid();
|
||||||
if (identity.uuid == _avatarHash.value(EMPTY)->getSessionUUID()) {
|
|
||||||
|
{
|
||||||
|
QReadLocker locker(&_hashLock);
|
||||||
|
auto me = _avatarHash.find(EMPTY);
|
||||||
|
if ((me != _avatarHash.end()) && (identity.uuid == me.value()->getSessionUUID())) {
|
||||||
// We add MyAvatar to _avatarHash with an empty UUID. Code relies on this. In order to correctly handle an
|
// We add MyAvatar to _avatarHash with an empty UUID. Code relies on this. In order to correctly handle an
|
||||||
// identity packet for ourself (such as when we are assigned a sessionDisplayName by the mixer upon joining),
|
// identity packet for ourself (such as when we are assigned a sessionDisplayName by the mixer upon joining),
|
||||||
// we make things match here.
|
// we make things match here.
|
||||||
identity.uuid = EMPTY;
|
identity.uuid = EMPTY;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!nodeList->isIgnoringNode(identity.uuid)) {
|
if (!nodeList->isIgnoringNode(identity.uuid)) {
|
||||||
// mesh URL for a UUID, find avatar in our list
|
// mesh URL for a UUID, find avatar in our list
|
||||||
auto avatar = newOrExistingAvatar(identity.uuid, sendingNode);
|
auto avatar = newOrExistingAvatar(identity.uuid, sendingNode);
|
||||||
|
|
|
@ -373,9 +373,9 @@ void NodeList::sendDomainServerCheckIn() {
|
||||||
|
|
||||||
packetStream << hardwareAddress;
|
packetStream << hardwareAddress;
|
||||||
|
|
||||||
// add in machine fingerprint
|
// now add the machine fingerprint - a null UUID if logged in, real one if not logged in
|
||||||
QUuid machineFingerprint = FingerprintUtils::getMachineFingerprint();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
packetStream << machineFingerprint;
|
packetStream << (accountManager->isLoggedIn() ? QUuid() : FingerprintUtils::getMachineFingerprint());
|
||||||
}
|
}
|
||||||
|
|
||||||
// pack our data to send to the domain-server including
|
// pack our data to send to the domain-server including
|
||||||
|
|
|
@ -1062,12 +1062,6 @@ function MyController(hand) {
|
||||||
|
|
||||||
this.secondaryPress = function(value) {
|
this.secondaryPress = function(value) {
|
||||||
_this.rawSecondaryValue = value;
|
_this.rawSecondaryValue = value;
|
||||||
|
|
||||||
// The value to check if we will allow the release function to be called
|
|
||||||
var allowReleaseValue = 0.1;
|
|
||||||
if (value > 0 && _this.state == STATE_HOLD) {
|
|
||||||
_this.release();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateSmoothedTrigger = function() {
|
this.updateSmoothedTrigger = function() {
|
||||||
|
@ -1118,18 +1112,17 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.off = function(deltaTime, timestamp) {
|
this.off = function(deltaTime, timestamp) {
|
||||||
if (this.triggerSmoothedReleased()) {
|
|
||||||
|
if (this.triggerSmoothedReleased() && this.secondaryReleased()) {
|
||||||
this.waitForTriggerRelease = false;
|
this.waitForTriggerRelease = false;
|
||||||
}
|
}
|
||||||
if (!this.waitForTriggerRelease && this.triggerSmoothedSqueezed()) {
|
if (!this.waitForTriggerRelease && (this.triggerSmoothedSqueezed() || this.secondarySqueezed())) {
|
||||||
this.lastPickTime = 0;
|
this.lastPickTime = 0;
|
||||||
this.startingHandRotation = getControllerWorldLocation(this.handToController(), true).orientation;
|
this.startingHandRotation = getControllerWorldLocation(this.handToController(), true).orientation;
|
||||||
if (this.triggerSmoothedSqueezed()) {
|
this.searchStartTime = Date.now();
|
||||||
this.setState(STATE_SEARCHING, "trigger squeeze detected");
|
this.setState(STATE_SEARCHING, "trigger squeeze detected");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
|
var controllerLocation = getControllerWorldLocation(this.handToController(), true);
|
||||||
var worldHandPosition = controllerLocation.position;
|
var worldHandPosition = controllerLocation.position;
|
||||||
|
@ -1469,15 +1462,19 @@ function MyController(hand) {
|
||||||
this.search = function(deltaTime, timestamp) {
|
this.search = function(deltaTime, timestamp) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var name;
|
var name;
|
||||||
|
var FAR_SEARCH_DELAY = 0; // msecs before search beam appears
|
||||||
|
|
||||||
|
var farSearching = this.triggerSmoothedSqueezed() && (Date.now() - this.searchStartTime > FAR_SEARCH_DELAY);
|
||||||
|
|
||||||
this.grabbedEntity = null;
|
this.grabbedEntity = null;
|
||||||
this.grabbedOverlay = null;
|
this.grabbedOverlay = null;
|
||||||
this.isInitialGrab = false;
|
this.isInitialGrab = false;
|
||||||
this.shouldResetParentOnRelease = false;
|
this.shouldResetParentOnRelease = false;
|
||||||
|
this.preparingHoldRelease = false;
|
||||||
|
|
||||||
this.checkForStrayChildren();
|
this.checkForStrayChildren();
|
||||||
|
|
||||||
if (this.triggerSmoothedReleased()) {
|
if ((this.triggerSmoothedReleased() && this.secondaryReleased())) {
|
||||||
this.setState(STATE_OFF, "trigger released");
|
this.setState(STATE_OFF, "trigger released");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1496,10 +1493,11 @@ function MyController(hand) {
|
||||||
|
|
||||||
var potentialEquipHotspot = this.chooseBestEquipHotspot(candidateHotSpotEntities);
|
var potentialEquipHotspot = this.chooseBestEquipHotspot(candidateHotSpotEntities);
|
||||||
if (potentialEquipHotspot) {
|
if (potentialEquipHotspot) {
|
||||||
if (this.triggerSmoothedGrab() && holdEnabled) {
|
if ((this.triggerSmoothedGrab() || this.secondarySqueezed()) && holdEnabled) {
|
||||||
this.grabbedHotspot = potentialEquipHotspot;
|
this.grabbedHotspot = potentialEquipHotspot;
|
||||||
this.grabbedEntity = potentialEquipHotspot.entityID;
|
this.grabbedEntity = potentialEquipHotspot.entityID;
|
||||||
this.setState(STATE_HOLD, "equipping '" + entityPropertiesCache.getProps(this.grabbedEntity).name + "'");
|
this.setState(STATE_HOLD, "equipping '" + entityPropertiesCache.getProps(this.grabbedEntity).name + "'");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1539,7 +1537,8 @@ function MyController(hand) {
|
||||||
// potentialNearTriggerEntity = entity;
|
// potentialNearTriggerEntity = entity;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.triggerSmoothedGrab() && nearGrabEnabled) {
|
// If near something grabbable, grab it!
|
||||||
|
if ((this.triggerSmoothedGrab() || this.secondarySqueezed()) && nearGrabEnabled) {
|
||||||
var props = entityPropertiesCache.getProps(entity);
|
var props = entityPropertiesCache.getProps(entity);
|
||||||
var grabProps = entityPropertiesCache.getGrabProps(entity);
|
var grabProps = entityPropertiesCache.getGrabProps(entity);
|
||||||
var refCount = grabProps.refCount ? grabProps.refCount : 0;
|
var refCount = grabProps.refCount ? grabProps.refCount : 0;
|
||||||
|
@ -1629,7 +1628,7 @@ function MyController(hand) {
|
||||||
// potentialFarTriggerEntity = entity;
|
// potentialFarTriggerEntity = entity;
|
||||||
}
|
}
|
||||||
} else if (this.entityIsDistanceGrabbable(rayPickInfo.entityID, handPosition)) {
|
} else if (this.entityIsDistanceGrabbable(rayPickInfo.entityID, handPosition)) {
|
||||||
if (this.triggerSmoothedGrab() && !isEditing() && farGrabEnabled) {
|
if (this.triggerSmoothedGrab() && !isEditing() && farGrabEnabled && farSearching) {
|
||||||
this.grabbedEntity = entity;
|
this.grabbedEntity = entity;
|
||||||
this.setState(STATE_DISTANCE_HOLDING, "distance hold '" + name + "'");
|
this.setState(STATE_DISTANCE_HOLDING, "distance hold '" + name + "'");
|
||||||
return;
|
return;
|
||||||
|
@ -1706,7 +1705,7 @@ function MyController(hand) {
|
||||||
equipHotspotBuddy.highlightHotspot(potentialEquipHotspot);
|
equipHotspotBuddy.highlightHotspot(potentialEquipHotspot);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (farGrabEnabled) {
|
if (farGrabEnabled && farSearching) {
|
||||||
this.searchIndicatorOn(rayPickInfo.searchRay);
|
this.searchIndicatorOn(rayPickInfo.searchRay);
|
||||||
}
|
}
|
||||||
Reticle.setVisible(false);
|
Reticle.setVisible(false);
|
||||||
|
@ -2145,7 +2144,7 @@ function MyController(hand) {
|
||||||
|
|
||||||
this.grabPointSphereOff();
|
this.grabPointSphereOff();
|
||||||
|
|
||||||
if (this.state == STATE_NEAR_GRABBING && !this.triggerClicked) {
|
if (this.state == STATE_NEAR_GRABBING && (!this.triggerClicked && this.secondaryReleased())) {
|
||||||
this.callEntityMethodOnGrabbed("releaseGrab");
|
this.callEntityMethodOnGrabbed("releaseGrab");
|
||||||
this.setState(STATE_OFF, "trigger released");
|
this.setState(STATE_OFF, "trigger released");
|
||||||
return;
|
return;
|
||||||
|
@ -2153,6 +2152,22 @@ function MyController(hand) {
|
||||||
|
|
||||||
if (this.state == STATE_HOLD) {
|
if (this.state == STATE_HOLD) {
|
||||||
|
|
||||||
|
if (this.secondarySqueezed()) {
|
||||||
|
// this.secondaryReleased() will always be true when not depressed
|
||||||
|
// so we cannot simply rely on that for release - ensure that the
|
||||||
|
// trigger was first "prepared" by being pushed in before the release
|
||||||
|
this.preparingHoldRelease = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.preparingHoldRelease && this.secondaryReleased()) {
|
||||||
|
// we have an equipped object and the secondary trigger was released
|
||||||
|
// short-circuit the other checks and release it
|
||||||
|
this.preparingHoldRelease = false;
|
||||||
|
|
||||||
|
this.release();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var dropDetected = this.dropGestureProcess(deltaTime);
|
var dropDetected = this.dropGestureProcess(deltaTime);
|
||||||
|
|
||||||
if (this.triggerSmoothedReleased()) {
|
if (this.triggerSmoothedReleased()) {
|
||||||
|
@ -2648,7 +2663,7 @@ function MyController(hand) {
|
||||||
this.grabbedOverlay = null;
|
this.grabbedOverlay = null;
|
||||||
this.grabbedHotspot = null;
|
this.grabbedHotspot = null;
|
||||||
|
|
||||||
if (this.triggerSmoothedGrab()) {
|
if (this.triggerSmoothedGrab() || this.secondarySqueezed()) {
|
||||||
this.waitForTriggerRelease = true;
|
this.waitForTriggerRelease = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,8 +53,8 @@ function animStateHandler(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function update(dt) {
|
function update(dt) {
|
||||||
var leftTrigger = normalizeControllerValue(Controller.getValue(Controller.Standard.LT));
|
var leftTrigger = clamp(Controller.getValue(Controller.Standard.LT) + Controller.getValue(Controller.Standard.LeftGrip), 0, 1);
|
||||||
var rightTrigger = normalizeControllerValue(Controller.getValue(Controller.Standard.RT));
|
var rightTrigger = clamp(Controller.getValue(Controller.Standard.RT) + Controller.getValue(Controller.Standard.RightGrip), 0, 1);
|
||||||
|
|
||||||
// Average last few trigger values together for a bit of smoothing
|
// Average last few trigger values together for a bit of smoothing
|
||||||
var tau = clamp(dt / TRIGGER_SMOOTH_TIMESCALE, 0, 1);
|
var tau = clamp(dt / TRIGGER_SMOOTH_TIMESCALE, 0, 1);
|
||||||
|
|
Loading…
Reference in a new issue