mirror of
https://github.com/lubosz/overte.git
synced 2025-04-26 07:15:37 +02:00
Merge pull request #14305 from AndrewMeadows/zero-vel-neargrab-nondynamic
Case 19495: zero velocities of non-dynamic entities on nearGrab release
This commit is contained in:
commit
3d01949e43
2 changed files with 9 additions and 15 deletions
scripts/system/controllers/controllerModules
|
@ -262,7 +262,9 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
if (this.thisFarGrabJointIsParent(endProps)) {
|
||||
Entities.editEntity(this.targetEntityID, {
|
||||
parentID: this.previousParentID[this.targetEntityID],
|
||||
parentJointIndex: this.previousParentJointIndex[this.targetEntityID]
|
||||
parentJointIndex: this.previousParentJointIndex[this.targetEntityID],
|
||||
localVelocity: {x: 0, y: 0, z: 0},
|
||||
localAngularVelocity: {x: 0, y: 0, z: 0}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -149,20 +149,12 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
this.hapticTargetID = null;
|
||||
var props = controllerData.nearbyEntityPropertiesByID[this.targetEntityID];
|
||||
if (this.thisHandIsParent(props) && !this.robbed) {
|
||||
if (this.previousParentID[this.targetEntityID] === Uuid.NULL || this.previousParentID === undefined) {
|
||||
Entities.editEntity(this.targetEntityID, {
|
||||
parentID: this.previousParentID[this.targetEntityID],
|
||||
parentJointIndex: this.previousParentJointIndex[this.targetEntityID]
|
||||
});
|
||||
} else {
|
||||
// we're putting this back as a child of some other parent, so zero its velocity
|
||||
Entities.editEntity(this.targetEntityID, {
|
||||
parentID: this.previousParentID[this.targetEntityID],
|
||||
parentJointIndex: this.previousParentJointIndex[this.targetEntityID],
|
||||
localVelocity: {x: 0, y: 0, z: 0},
|
||||
localAngularVelocity: {x: 0, y: 0, z: 0}
|
||||
});
|
||||
}
|
||||
Entities.editEntity(this.targetEntityID, {
|
||||
parentID: this.previousParentID[this.targetEntityID],
|
||||
parentJointIndex: this.previousParentJointIndex[this.targetEntityID],
|
||||
localVelocity: {x: 0, y: 0, z: 0},
|
||||
localAngularVelocity: {x: 0, y: 0, z: 0}
|
||||
});
|
||||
}
|
||||
|
||||
var args = [this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
|
||||
|
|
Loading…
Reference in a new issue