mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:29:32 +02:00
bugfix for saving attach points
The feature to add transition from equip -> near-grab, in inadvertently broke attach point saving.
This commit is contained in:
parent
659e1ff984
commit
69500643f3
1 changed files with 10 additions and 12 deletions
|
@ -202,8 +202,7 @@ CONTROLLER_STATE_MACHINE[STATE_NEAR_GRABBING] = {
|
||||||
CONTROLLER_STATE_MACHINE[STATE_HOLD] = {
|
CONTROLLER_STATE_MACHINE[STATE_HOLD] = {
|
||||||
name: "hold",
|
name: "hold",
|
||||||
enterMethod: "nearGrabbingEnter",
|
enterMethod: "nearGrabbingEnter",
|
||||||
updateMethod: "nearGrabbing",
|
updateMethod: "nearGrabbing"
|
||||||
exitMethod: "holdExit"
|
|
||||||
};
|
};
|
||||||
CONTROLLER_STATE_MACHINE[STATE_NEAR_TRIGGER] = {
|
CONTROLLER_STATE_MACHINE[STATE_NEAR_TRIGGER] = {
|
||||||
name: "trigger",
|
name: "trigger",
|
||||||
|
@ -1990,6 +1989,15 @@ function MyController(hand) {
|
||||||
|
|
||||||
if (dropDetected && !this.waitForTriggerRelease && this.triggerSmoothedGrab()) {
|
if (dropDetected && !this.waitForTriggerRelease && this.triggerSmoothedGrab()) {
|
||||||
this.callEntityMethodOnGrabbed("releaseEquip");
|
this.callEntityMethodOnGrabbed("releaseEquip");
|
||||||
|
|
||||||
|
// store the offset attach points into preferences.
|
||||||
|
if (USE_ATTACH_POINT_SETTINGS && this.grabbedHotspot && this.grabbedEntity) {
|
||||||
|
var props = Entities.getEntityProperties(this.grabbedEntity, ["localPosition", "localRotation"]);
|
||||||
|
if (props && props.localPosition && props.localRotation) {
|
||||||
|
storeAttachPointForHotspotInSettings(this.grabbedHotspot, this.hand, props.localPosition, props.localRotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var grabbedEntity = this.grabbedEntity;
|
var grabbedEntity = this.grabbedEntity;
|
||||||
this.release();
|
this.release();
|
||||||
this.grabbedEntity = grabbedEntity;
|
this.grabbedEntity = grabbedEntity;
|
||||||
|
@ -2092,16 +2100,6 @@ function MyController(hand) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.holdExit = function () {
|
|
||||||
// store the offset attach points into preferences.
|
|
||||||
if (USE_ATTACH_POINT_SETTINGS && this.grabbedHotspot && this.grabbedEntity) {
|
|
||||||
var props = Entities.getEntityProperties(this.grabbedEntity, ["localPosition", "localRotation"]);
|
|
||||||
if (props && props.localPosition && props.localRotation) {
|
|
||||||
storeAttachPointForHotspotInSettings(this.grabbedHotspot, this.hand, props.localPosition, props.localRotation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.nearTriggerEnter = function () {
|
this.nearTriggerEnter = function () {
|
||||||
|
|
||||||
this.clearEquipHaptics();
|
this.clearEquipHaptics();
|
||||||
|
|
Loading…
Reference in a new issue