mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 19:19:32 +02:00
Merge pull request #6297 from birarda/grab-locked
allow non-colliding grab of locked entities
This commit is contained in:
commit
e5da29e08a
1 changed files with 6 additions and 5 deletions
|
@ -352,7 +352,7 @@ function MyController(hand) {
|
||||||
|
|
||||||
var intersection = Entities.findRayIntersection(pickRayBacked, true);
|
var intersection = Entities.findRayIntersection(pickRayBacked, true);
|
||||||
|
|
||||||
if (intersection.intersects && !intersection.properties.locked) {
|
if (intersection.intersects) {
|
||||||
// the ray is intersecting something we can move.
|
// the ray is intersecting something we can move.
|
||||||
var intersectionDistance = Vec3.distance(pickRay.origin, intersection.intersection);
|
var intersectionDistance = Vec3.distance(pickRay.origin, intersection.intersection);
|
||||||
this.grabbedEntity = intersection.entityID;
|
this.grabbedEntity = intersection.entityID;
|
||||||
|
@ -381,7 +381,7 @@ function MyController(hand) {
|
||||||
// the hand is very close to the intersected object. go into close-grabbing mode.
|
// the hand is very close to the intersected object. go into close-grabbing mode.
|
||||||
if (grabbableData.wantsTrigger) {
|
if (grabbableData.wantsTrigger) {
|
||||||
this.setState(STATE_NEAR_GRABBING_NON_COLLIDING);
|
this.setState(STATE_NEAR_GRABBING_NON_COLLIDING);
|
||||||
} else {
|
} else if (!intersection.properties.locked) {
|
||||||
this.setState(STATE_NEAR_GRABBING);
|
this.setState(STATE_NEAR_GRABBING);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -390,7 +390,8 @@ function MyController(hand) {
|
||||||
this.grabbedEntity = null;
|
this.grabbedEntity = null;
|
||||||
} else {
|
} else {
|
||||||
// the hand is far from the intersected object. go into distance-holding mode
|
// the hand is far from the intersected object. go into distance-holding mode
|
||||||
if (intersection.properties.collisionsWillMove) {
|
if (intersection.properties.collisionsWillMove
|
||||||
|
&& !intersection.properties.locked) {
|
||||||
this.setState(STATE_DISTANCE_HOLDING);
|
this.setState(STATE_DISTANCE_HOLDING);
|
||||||
} else {
|
} else {
|
||||||
this.setState(STATE_FAR_GRABBING_NON_COLLIDING);
|
this.setState(STATE_FAR_GRABBING_NON_COLLIDING);
|
||||||
|
|
Loading…
Reference in a new issue