mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +02:00
upon release, set velocity after returning entity to being dynamic
This commit is contained in:
parent
93503d0a21
commit
b102081f2f
1 changed files with 6 additions and 3 deletions
|
@ -588,7 +588,8 @@ function MyController(hand, triggerAction) {
|
||||||
relativePosition: this.offsetPosition,
|
relativePosition: this.offsetPosition,
|
||||||
relativeRotation: this.offsetRotation,
|
relativeRotation: this.offsetRotation,
|
||||||
ttl: ACTION_TTL,
|
ttl: ACTION_TTL,
|
||||||
kinematic: NEAR_GRABBING_KINEMATIC
|
kinematic: NEAR_GRABBING_KINEMATIC,
|
||||||
|
kinematicSetVelocity: true
|
||||||
});
|
});
|
||||||
if (this.actionID === NULL_ACTION_ID) {
|
if (this.actionID === NULL_ACTION_ID) {
|
||||||
this.actionID = null;
|
this.actionID = null;
|
||||||
|
@ -641,7 +642,8 @@ function MyController(hand, triggerAction) {
|
||||||
relativePosition: this.offsetPosition,
|
relativePosition: this.offsetPosition,
|
||||||
relativeRotation: this.offsetRotation,
|
relativeRotation: this.offsetRotation,
|
||||||
ttl: ACTION_TTL,
|
ttl: ACTION_TTL,
|
||||||
kinematic: NEAR_GRABBING_KINEMATIC
|
kinematic: NEAR_GRABBING_KINEMATIC,
|
||||||
|
kinematicSetVelocity: true
|
||||||
});
|
});
|
||||||
this.actionTimeout = now + (ACTION_TTL * MSEC_PER_SEC);
|
this.actionTimeout = now + (ACTION_TTL * MSEC_PER_SEC);
|
||||||
}
|
}
|
||||||
|
@ -810,12 +812,13 @@ function MyController(hand, triggerAction) {
|
||||||
Entities.callEntityMethod(this.grabbedEntity, "releaseGrab");
|
Entities.callEntityMethod(this.grabbedEntity, "releaseGrab");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.deactivateEntity(this.grabbedEntity);
|
||||||
|
|
||||||
// the action will tend to quickly bring an object's velocity to zero. now that
|
// the action will tend to quickly bring an object's velocity to zero. now that
|
||||||
// the action is gone, set the objects velocity to something the holder might expect.
|
// the action is gone, set the objects velocity to something the holder might expect.
|
||||||
Entities.editEntity(this.grabbedEntity, {
|
Entities.editEntity(this.grabbedEntity, {
|
||||||
velocity: this.grabbedVelocity
|
velocity: this.grabbedVelocity
|
||||||
});
|
});
|
||||||
this.deactivateEntity(this.grabbedEntity);
|
|
||||||
|
|
||||||
this.grabbedVelocity = ZERO_VEC;
|
this.grabbedVelocity = ZERO_VEC;
|
||||||
this.grabbedEntity = null;
|
this.grabbedEntity = null;
|
||||||
|
|
Loading…
Reference in a new issue