mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Added findRayIntersection, and confirmed judder grew a lot worse
This commit is contained in:
parent
96fd634138
commit
8dddf0e17a
1 changed files with 26 additions and 2 deletions
|
@ -18,6 +18,8 @@
|
|||
var _this;
|
||||
var RIGHT_HAND = 1;
|
||||
var LEFT_HAND = 0;
|
||||
var SPATIAL_CONTROLLERS_PER_PALM = 2;
|
||||
var TIP_CONTROLLER_OFFSET = 1;
|
||||
Whiteboard = function() {
|
||||
_this = this;
|
||||
};
|
||||
|
@ -33,11 +35,33 @@
|
|||
},
|
||||
|
||||
startFarGrabNonColliding: function() {
|
||||
this.activeHand = this.hand;
|
||||
if (this.hand === RIGHT_HAND) {
|
||||
this.getHandPosition = MyAvatar.getRightPalmPosition;
|
||||
this.getHandRotation = MyAvatar.getRightPalmRotation;
|
||||
this.triggerAction = Controller.findAction("RIGHT_HAND_CLICK");
|
||||
} else if (this.hand === LEFT_HAND) {
|
||||
this.getHandPosition = MyAvatar.getLeftPalmPosition;
|
||||
this.getHandRotation = MyAvatar.getLeftPalmRotation;
|
||||
this.triggerAction = Controller.findAction("LEFT_HAND_CLICK");
|
||||
}
|
||||
},
|
||||
|
||||
continueFarGrabbingNonColliding: function() {
|
||||
var handClick = Controller.findAction(handClickString);
|
||||
var handPosition = this.getHandPosition();
|
||||
var pickRay = {
|
||||
origin: handPosition,
|
||||
direction: Quat.getUp(this.getHandRotation())
|
||||
};
|
||||
this.intersection = Entities.findRayIntersection(pickRay, true);
|
||||
if (this.intersection.intersects) {
|
||||
if(JSON.stringify(this.intersection.entityID) === JSON.stringify(this.entityID)) {
|
||||
print('YAAAAA')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
releaseGrab: function() {
|
||||
|
||||
},
|
||||
|
||||
preload: function(entityID) {
|
||||
|
|
Loading…
Reference in a new issue