mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 12:29:56 +02:00
allow kinematic near-grab to be turned on or off for a given entity
This commit is contained in:
parent
507f658a5f
commit
026dde2e68
1 changed files with 5 additions and 3 deletions
|
@ -2741,7 +2741,7 @@ function MyController(hand) {
|
||||||
relativePosition: this.offsetPosition,
|
relativePosition: this.offsetPosition,
|
||||||
relativeRotation: this.offsetRotation,
|
relativeRotation: this.offsetRotation,
|
||||||
ttl: ACTION_TTL,
|
ttl: ACTION_TTL,
|
||||||
kinematic: NEAR_GRABBING_KINEMATIC,
|
kinematic: this.kinematicGrab,
|
||||||
kinematicSetVelocity: true,
|
kinematicSetVelocity: true,
|
||||||
ignoreIK: this.ignoreIK
|
ignoreIK: this.ignoreIK
|
||||||
});
|
});
|
||||||
|
@ -2838,12 +2838,14 @@ function MyController(hand) {
|
||||||
this.ignoreIK = true;
|
this.ignoreIK = true;
|
||||||
} else {
|
} else {
|
||||||
grabbedProperties = Entities.getEntityProperties(this.grabbedThingID, GRABBABLE_PROPERTIES);
|
grabbedProperties = Entities.getEntityProperties(this.grabbedThingID, GRABBABLE_PROPERTIES);
|
||||||
|
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedThingID, DEFAULT_GRABBABLE_DATA);
|
||||||
if (FORCE_IGNORE_IK) {
|
if (FORCE_IGNORE_IK) {
|
||||||
this.ignoreIK = true;
|
this.ignoreIK = true;
|
||||||
} else {
|
} else {
|
||||||
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedThingID, DEFAULT_GRABBABLE_DATA);
|
|
||||||
this.ignoreIK = (grabbableData.ignoreIK !== undefined) ? grabbableData.ignoreIK : true;
|
this.ignoreIK = (grabbableData.ignoreIK !== undefined) ? grabbableData.ignoreIK : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.kinematicGrab = (grabbableData.kinematic !== undefined) ? grabbableData.kinematic : NEAR_GRABBING_KINEMATIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
var handRotation;
|
var handRotation;
|
||||||
|
@ -3207,7 +3209,7 @@ function MyController(hand) {
|
||||||
relativePosition: this.offsetPosition,
|
relativePosition: this.offsetPosition,
|
||||||
relativeRotation: this.offsetRotation,
|
relativeRotation: this.offsetRotation,
|
||||||
ttl: ACTION_TTL,
|
ttl: ACTION_TTL,
|
||||||
kinematic: NEAR_GRABBING_KINEMATIC,
|
kinematic: this.kinematicGrab,
|
||||||
kinematicSetVelocity: true,
|
kinematicSetVelocity: true,
|
||||||
ignoreIK: this.ignoreIK
|
ignoreIK: this.ignoreIK
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue