mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 13:26:14 +02:00
kinematic grab things
This commit is contained in:
parent
e0b8c6b48b
commit
40a096ca8d
3 changed files with 30 additions and 6 deletions
|
@ -944,7 +944,7 @@ function MyController(hand) {
|
|||
relativeRotation: this.offsetRotation,
|
||||
ttl: ACTION_TTL,
|
||||
kinematic: NEAR_GRABBING_KINEMATIC,
|
||||
kinematicSetVelocity: false,
|
||||
kinematicSetVelocity: true,
|
||||
ignoreIK: this.ignoreIK
|
||||
});
|
||||
if (this.actionID === NULL_ACTION_ID) {
|
||||
|
@ -1029,7 +1029,7 @@ function MyController(hand) {
|
|||
relativeRotation: this.offsetRotation,
|
||||
ttl: ACTION_TTL,
|
||||
kinematic: NEAR_GRABBING_KINEMATIC,
|
||||
kinematicSetVelocity: false,
|
||||
kinematicSetVelocity: true,
|
||||
ignoreIK: this.ignoreIK
|
||||
});
|
||||
this.actionTimeout = now + (ACTION_TTL * MSEC_PER_SEC);
|
||||
|
@ -1243,7 +1243,26 @@ function MyController(hand) {
|
|||
this.overlayLineOff();
|
||||
if (this.grabbedEntity !== null) {
|
||||
if (this.actionID !== null) {
|
||||
Entities.deleteAction(this.grabbedEntity, this.actionID);
|
||||
//add velocity whatnot
|
||||
var defaultReleaseVelocityData = {
|
||||
disableReleaseVelocity: false
|
||||
};
|
||||
|
||||
var releaseVelocityData = getEntityCustomData('releaseVelocityKey', this.grabbedEntity, defaultReleaseVelocityData);
|
||||
if (releaseVelocityData.disableReleaseVelocity === true) {
|
||||
Entities.updateAction(this.grabbedEntity, this.actionID, {
|
||||
ttl: 1,
|
||||
kinematic: false,
|
||||
kinematicSetVelocity: false,
|
||||
|
||||
});
|
||||
// Entities.deleteAction(this.grabbedEntity, this.actionID);
|
||||
|
||||
} else {
|
||||
//don't make adjustments
|
||||
Entities.deleteAction(this.grabbedEntity, this.actionID);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -243,8 +243,7 @@ entitySlider.prototype = {
|
|||
axisEnd: this.endOfAxis,
|
||||
},
|
||||
releaseVelocityKey: {
|
||||
disableReleaseVelocity: true,
|
||||
customReleaseVelocity: false
|
||||
disableReleaseVelocity: true
|
||||
}
|
||||
})
|
||||
};
|
||||
|
|
|
@ -73,7 +73,13 @@ function createBlock() {
|
|||
green: 0,
|
||||
blue: 255
|
||||
},
|
||||
position: position
|
||||
position: position,
|
||||
userData: JSON.stringify({
|
||||
|
||||
releaseVelocityKey: {
|
||||
disableReleaseVelocity: true
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
block = Entities.addEntity(blockProperties);
|
||||
|
|
Loading…
Reference in a new issue