fixed rotation

This commit is contained in:
ericrius1 2016-02-26 10:14:27 -08:00
parent b70d96ea96
commit 25a2d1eb93
2 changed files with 29 additions and 29 deletions

View file

@ -72,8 +72,8 @@
direction: Quat.getFront(markerProps.rotation) direction: Quat.getFront(markerProps.rotation)
} }
var intersection = Entities.findRayIntersectionBlocking(pickRay, true, _this.whiteboards); var intersection = Entities.findRayIntersectionBlocking(pickRay, true, _this.whiteboards);
_this.whiteboardNormal = Quat.getFront(intersection.properties.rotation);
if (intersection.intersects && Vec3.distance(intersection.intersection, markerProps.position) < _this.MAX_MARKER_TO_BOARD_DISTANCE) { if (intersection.intersects && Vec3.distance(intersection.intersection, markerProps.position) < _this.MAX_MARKER_TO_BOARD_DISTANCE) {
_this.whiteboardNormal = Quat.getFront(intersection.properties.rotation);
Overlays.editOverlay(_this.laserPointer, { Overlays.editOverlay(_this.laserPointer, {
visible: true, visible: true,
position: intersection.intersection, position: intersection.intersection,

View file

@ -23,7 +23,7 @@ var markerRotation = Quat.fromVec3Degrees({
orientation.x = 0; orientation.x = 0;
var whiteboardRotation = Quat.fromVec3Degrees({ var whiteboardRotation = Quat.fromVec3Degrees({
x: 0, x: 0,
y: orientation.y - 90, y: orientation.y,
z: 0 z: 0
}); });
orientation = Quat.fromVec3Degrees(orientation); orientation = Quat.fromVec3Degrees(orientation);
@ -31,8 +31,8 @@ var markers = [];
var whiteboardPosition = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getFront(orientation))); var whiteboardPosition = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getFront(orientation)));
var WHITEBOARD_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Whiteboard-3.fbx"; var WHITEBOARD_MODEL_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/Whiteboard-3+(1).fbx";
var WHITEBOARD_COLLISION_HULL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/Whiteboard.obj"; var WHITEBOARD_COLLISION_HULL_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/whiteboardCollisionHull.obj";
var whiteboard = Entities.addEntity({ var whiteboard = Entities.addEntity({
type: "Model", type: "Model",
name: "whiteboard", name: "whiteboard",
@ -42,9 +42,9 @@ var whiteboard = Entities.addEntity({
shapeType: 'compound', shapeType: 'compound',
compoundShapeURL: WHITEBOARD_COLLISION_HULL_URL, compoundShapeURL: WHITEBOARD_COLLISION_HULL_URL,
dimensions: { dimensions: {
x: 0.4636, x: 1.86,
y: 2.7034, y: 2.7,
z: 1.8653 z: 0.4636
}, },
}); });
@ -68,7 +68,7 @@ var whiteboardDrawingSurface = Entities.addEntity({
blue: 200 blue: 200
}, },
position: whiteboardSurfacePosition, position: whiteboardSurfacePosition,
rotation: orientation, rotation: whiteboardRotation,
visible: false, visible: false,
parentID: whiteboard parentID: whiteboard
}); });
@ -108,9 +108,9 @@ var eraser = Entities.addEntity({
wearable: { wearable: {
joints: { joints: {
RightHand: [{ RightHand: [{
x: 0.0207, x: 0.020,
y: 0.1202, y: 0.120,
z: 0.0493 z: 0.049
}, { }, {
x: 0.1004, x: 0.1004,
y: 0.6424, y: 0.6424,
@ -122,7 +122,7 @@ var eraser = Entities.addEntity({
y: 0.1101, y: 0.1101,
z: 0.053 z: 0.053
}, { }, {
x: 0.7234, x: 0.723,
y: 0.289, y: 0.289,
z: 0.142, z: 0.142,
w: 0.610 w: 0.610
@ -186,9 +186,9 @@ function createMarker(modelURL, markerPosition, markerColor) {
}, },
position: markerPosition, position: markerPosition,
dimensions: { dimensions: {
x: 0.0270, x: 0.027,
y: 0.0272, y: 0.027,
z: 0.1641 z: 0.164
}, },
name: "marker", name: "marker",
script: MARKER_SCRIPT_URL, script: MARKER_SCRIPT_URL,
@ -197,24 +197,24 @@ function createMarker(modelURL, markerPosition, markerColor) {
wearable: { wearable: {
joints: { joints: {
RightHand: [{ RightHand: [{
x: 0.001109793782234192, x: 0.001,
y: 0.13991504907608032, y: 0.139,
z: 0.05035984516143799 z: 0.050
}, { }, {
x: -0.7360993027687073, x: -0.73,
y: -0.04330085217952728, y: -0.043,
z: -0.10863728821277618, z: -0.108,
w: -0.6666942238807678 w: -0.666
}], }],
LeftHand: [{ LeftHand: [{
x: 0.007193896919488907, x: 0.007,
y: 0.15147076547145844, y: 0.151,
z: 0.06174466013908386 z: 0.061
}, { }, {
x: -0.4174973964691162, x: -0.417,
y: 0.631147563457489, y: 0.631,
z: -0.3890438377857208, z: -0.389,
w: -0.52535080909729 w: -0.525
}] }]
} }
} }