mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 13:56:24 +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,
|
||||
relativeRotation: this.offsetRotation,
|
||||
ttl: ACTION_TTL,
|
||||
kinematic: NEAR_GRABBING_KINEMATIC,
|
||||
kinematic: this.kinematicGrab,
|
||||
kinematicSetVelocity: true,
|
||||
ignoreIK: this.ignoreIK
|
||||
});
|
||||
|
@ -2838,12 +2838,14 @@ function MyController(hand) {
|
|||
this.ignoreIK = true;
|
||||
} else {
|
||||
grabbedProperties = Entities.getEntityProperties(this.grabbedThingID, GRABBABLE_PROPERTIES);
|
||||
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedThingID, DEFAULT_GRABBABLE_DATA);
|
||||
if (FORCE_IGNORE_IK) {
|
||||
this.ignoreIK = true;
|
||||
} else {
|
||||
var grabbableData = getEntityCustomData(GRABBABLE_DATA_KEY, this.grabbedThingID, DEFAULT_GRABBABLE_DATA);
|
||||
this.ignoreIK = (grabbableData.ignoreIK !== undefined) ? grabbableData.ignoreIK : true;
|
||||
}
|
||||
|
||||
this.kinematicGrab = (grabbableData.kinematic !== undefined) ? grabbableData.kinematic : NEAR_GRABBING_KINEMATIC;
|
||||
}
|
||||
|
||||
var handRotation;
|
||||
|
@ -3207,7 +3209,7 @@ function MyController(hand) {
|
|||
relativePosition: this.offsetPosition,
|
||||
relativeRotation: this.offsetRotation,
|
||||
ttl: ACTION_TTL,
|
||||
kinematic: NEAR_GRABBING_KINEMATIC,
|
||||
kinematic: this.kinematicGrab,
|
||||
kinematicSetVelocity: true,
|
||||
ignoreIK: this.ignoreIK
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue