mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:12:46 +02:00
don't do constant haptics if stylus touches tablet frame. home button triggers only once per click
This commit is contained in:
parent
c4d85c91d0
commit
7c938728e5
2 changed files with 13 additions and 5 deletions
|
@ -929,7 +929,7 @@ glm::quat Avatar::getAbsoluteJointRotationInObjectFrame(int index) const {
|
||||||
}
|
}
|
||||||
case CAMERA_MATRIX_INDEX: {
|
case CAMERA_MATRIX_INDEX: {
|
||||||
glm::quat rotation;
|
glm::quat rotation;
|
||||||
if (_skeletonModel) {
|
if (_skeletonModel && _skeletonModel->isActive()) {
|
||||||
int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex;
|
int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex;
|
||||||
if (headJointIndex >= 0) {
|
if (headJointIndex >= 0) {
|
||||||
_skeletonModel->getAbsoluteJointRotationInRigFrame(headJointIndex, rotation);
|
_skeletonModel->getAbsoluteJointRotationInRigFrame(headJointIndex, rotation);
|
||||||
|
@ -965,7 +965,7 @@ glm::vec3 Avatar::getAbsoluteJointTranslationInObjectFrame(int index) const {
|
||||||
}
|
}
|
||||||
case CAMERA_MATRIX_INDEX: {
|
case CAMERA_MATRIX_INDEX: {
|
||||||
glm::vec3 translation;
|
glm::vec3 translation;
|
||||||
if (_skeletonModel) {
|
if (_skeletonModel && _skeletonModel->isActive()) {
|
||||||
int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex;
|
int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex;
|
||||||
if (headJointIndex >= 0) {
|
if (headJointIndex >= 0) {
|
||||||
_skeletonModel->getAbsoluteJointTranslationInRigFrame(headJointIndex, translation);
|
_skeletonModel->getAbsoluteJointTranslationInRigFrame(headJointIndex, translation);
|
||||||
|
|
|
@ -737,6 +737,7 @@ function MyController(hand) {
|
||||||
this.autoUnequipCounter = 0;
|
this.autoUnequipCounter = 0;
|
||||||
this.grabPointIntersectsEntity = false;
|
this.grabPointIntersectsEntity = false;
|
||||||
this.stylus = null;
|
this.stylus = null;
|
||||||
|
this.homeButtonTouched = false;
|
||||||
|
|
||||||
// Until there is some reliable way to keep track of a "stack" of parentIDs, we'll have problems
|
// Until there is some reliable way to keep track of a "stack" of parentIDs, we'll have problems
|
||||||
// when more than one avatar does parenting grabs on things. This script tries to work
|
// when more than one avatar does parenting grabs on things. This script tries to work
|
||||||
|
@ -1178,13 +1179,13 @@ function MyController(hand) {
|
||||||
this.showStylus();
|
this.showStylus();
|
||||||
var rayPickInfo = this.calcRayPickInfo(this.hand);
|
var rayPickInfo = this.calcRayPickInfo(this.hand);
|
||||||
if (rayPickInfo.distance < WEB_STYLUS_LENGTH / 2.0 + WEB_TOUCH_Y_OFFSET) {
|
if (rayPickInfo.distance < WEB_STYLUS_LENGTH / 2.0 + WEB_TOUCH_Y_OFFSET) {
|
||||||
|
this.handleStylusOnHomeButton(rayPickInfo);
|
||||||
if (this.handleStylusOnWebEntity(rayPickInfo)) {
|
if (this.handleStylusOnWebEntity(rayPickInfo)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.handleStylusOnWebOverlay(rayPickInfo)) {
|
if (this.handleStylusOnWebOverlay(rayPickInfo)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.handleStylusOnHomeButton(rayPickInfo);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.hideStylus();
|
this.hideStylus();
|
||||||
|
@ -1246,8 +1247,16 @@ function MyController(hand) {
|
||||||
var entity = rayPickInfo.entityID;
|
var entity = rayPickInfo.entityID;
|
||||||
var name = entityPropertiesCache.getProps(entity).name;
|
var name = entityPropertiesCache.getProps(entity).name;
|
||||||
if (name == "homeButton") {
|
if (name == "homeButton") {
|
||||||
Messages.sendLocalMessage("home", entity);
|
if (this.homeButtonTouched == false) {
|
||||||
|
this.homeButtonTouched = true;
|
||||||
|
Controller.triggerHapticPulse(1, 20, this.hand);
|
||||||
|
Messages.sendLocalMessage("home", entity);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.homeButtonTouched = false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.homeButtonTouched = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1679,7 +1688,6 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.handleStylusOnWebEntity = function (rayPickInfo) {
|
this.handleStylusOnWebEntity = function (rayPickInfo) {
|
||||||
Controller.triggerHapticPulse(1, 20, this.hand);
|
|
||||||
var pointerEvent;
|
var pointerEvent;
|
||||||
|
|
||||||
if (rayPickInfo.entityID && Entities.wantsHandControllerPointerEvents(rayPickInfo.entityID)) {
|
if (rayPickInfo.entityID && Entities.wantsHandControllerPointerEvents(rayPickInfo.entityID)) {
|
||||||
|
|
Loading…
Reference in a new issue