mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:38:27 +02:00
Merge pull request #11677 from druiz17/fix-fargrab
Make non-dynamic entities collisionless during far-grab
This commit is contained in:
commit
0f31631f17
1 changed files with 6 additions and 1 deletions
|
@ -119,6 +119,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
this.actionID = null; // action this script created...
|
this.actionID = null; // action this script created...
|
||||||
this.entityWithContextOverlay = false;
|
this.entityWithContextOverlay = false;
|
||||||
this.contextOverlayTimer = false;
|
this.contextOverlayTimer = false;
|
||||||
|
this.previousCollisionStatus = false;
|
||||||
this.reticleMinX = MARGIN;
|
this.reticleMinX = MARGIN;
|
||||||
this.reticleMaxX;
|
this.reticleMaxX;
|
||||||
this.reticleMinY = MARGIN;
|
this.reticleMinY = MARGIN;
|
||||||
|
@ -342,7 +343,9 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
if (this.madeDynamic) {
|
if (this.madeDynamic) {
|
||||||
var props = {};
|
var props = {};
|
||||||
props.dynamic = false;
|
props.dynamic = false;
|
||||||
|
props.collisionless = this.previousCollisionStatus;
|
||||||
props.localVelocity = {x: 0, y: 0, z: 0};
|
props.localVelocity = {x: 0, y: 0, z: 0};
|
||||||
|
props.localRotation = {x: 0, y: 0, z: 0};
|
||||||
Entities.editEntity(this.grabbedThingID, props);
|
Entities.editEntity(this.grabbedThingID, props);
|
||||||
this.madeDynamic = false;
|
this.madeDynamic = false;
|
||||||
}
|
}
|
||||||
|
@ -507,10 +510,12 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
if (entityIsGrabbable(targetProps)) {
|
if (entityIsGrabbable(targetProps)) {
|
||||||
if (!entityIsDistanceGrabbable(targetProps)) {
|
if (!entityIsDistanceGrabbable(targetProps)) {
|
||||||
targetProps.dynamic = true;
|
targetProps.dynamic = true;
|
||||||
|
this.previousCollisionStatus = targetProps.collisionless;
|
||||||
|
targetProps.collisionless = true;
|
||||||
Entities.editEntity(entityID, targetProps);
|
Entities.editEntity(entityID, targetProps);
|
||||||
this.madeDynamic = true;
|
this.madeDynamic = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.distanceRotating) {
|
if (!this.distanceRotating) {
|
||||||
this.grabbedThingID = entityID;
|
this.grabbedThingID = entityID;
|
||||||
this.grabbedDistance = rayPickInfo.distance;
|
this.grabbedDistance = rayPickInfo.distance;
|
||||||
|
|
Loading…
Reference in a new issue