Fix for PR comments

This commit is contained in:
unknown 2015-09-29 14:34:23 -07:00
parent 56a0456f70
commit 006650f23b

View file

@ -84,9 +84,11 @@ function MyController(hand, triggerAction) {
this.getHandRotation = MyAvatar.getLeftPalmRotation; this.getHandRotation = MyAvatar.getLeftPalmRotation;
} }
var SPATIAL_CONTROLLERS_PER_PALM = 2;
var TIP_CONTROLLER_OFFSET = 1;
this.triggerAction = triggerAction; this.triggerAction = triggerAction;
this.palm = 2 * hand; this.palm = SPATIAL_CONTROLLERS_PER_PALM * hand;
this.tip = 2 * hand + 1; this.tip = SPATIAL_CONTROLLERS_PER_PALM * hand + TIP_CONTROLLER_OFFSET;
this.actionID = null; // action this script created... this.actionID = null; // action this script created...
this.grabbedEntity = null; // on this entity. this.grabbedEntity = null; // on this entity.
@ -287,10 +289,12 @@ function MyController(hand, triggerAction) {
// that returns the minimum quaternion between two quaternions. // that returns the minimum quaternion between two quaternions.
var currentOrientation = MyAvatar.orientation; var currentOrientation = MyAvatar.orientation;
if (Quat.dot(currentOrientation, this.currentAvatarOrientation) < 0.0) { if (Quat.dot(currentOrientation, this.currentAvatarOrientation) < 0.0) {
var negativeCurrentOrientation = { x: -currentOrientation.x, var negativeCurrentOrientation = {
x: -currentOrientation.x,
y: -currentOrientation.y, y: -currentOrientation.y,
z: -currentOrientation.z, z: -currentOrientation.z,
w: -currentOrientation.w }; w: -currentOrientation.w
};
var avatarDeltaOrientation = Quat.multiply(negativeCurrentOrientation, Quat.inverse(this.currentAvatarOrientation)); var avatarDeltaOrientation = Quat.multiply(negativeCurrentOrientation, Quat.inverse(this.currentAvatarOrientation));
} else { } else {
var avatarDeltaOrientation = Quat.multiply(currentOrientation, Quat.inverse(this.currentAvatarOrientation)); var avatarDeltaOrientation = Quat.multiply(currentOrientation, Quat.inverse(this.currentAvatarOrientation));
@ -482,17 +486,14 @@ function MyController(hand, triggerAction) {
}; };
this.startTouch = function(entityID) { this.startTouch = function(entityID) {
// print('START TOUCH' + entityID);
Entities.callEntityMethod(entityID, "startTouch"); Entities.callEntityMethod(entityID, "startTouch");
}; };
this.continueTouch = function(entityID) { this.continueTouch = function(entityID) {
// print('CONTINUE TOUCH' + entityID);
Entities.callEntityMethod(entityID, "continueTouch"); Entities.callEntityMethod(entityID, "continueTouch");
}; };
this.stopTouch = function(entityID) { this.stopTouch = function(entityID) {
// print('STOP TOUCH' + entityID);
Entities.callEntityMethod(entityID, "stopTouch"); Entities.callEntityMethod(entityID, "stopTouch");
}; };