From 5f3da64a254abba9c3275c9368f6c94bdeee728e Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Wed, 18 Nov 2015 16:34:39 -0800 Subject: [PATCH] gun lining up right --- examples/weapons/pistol/pistol.js | 4 ---- examples/weapons/pistol/pistolSpawner.js | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/examples/weapons/pistol/pistol.js b/examples/weapons/pistol/pistol.js index 6aada180bc..61cf9f9b83 100644 --- a/examples/weapons/pistol/pistol.js +++ b/examples/weapons/pistol/pistol.js @@ -40,7 +40,6 @@ Overlays.editOverlay(this.laser, { visible: true }); - print("EQUIP") }, continueNearGrab: function() { @@ -67,7 +66,6 @@ }, unequip: function() { - print("UNEQUIP") this.hand = null; this.equipped = false; Overlays.editOverlay(this.laser, { @@ -77,7 +75,6 @@ preload: function(entityID) { this.entityID = entityID; - print("INIT CONTROLLER MAPIING") this.initControllerMapping(); this.laser = Overlays.addOverlay("line3d", { start: ZERO_VECTOR, @@ -90,7 +87,6 @@ }, triggerPress: function(hand, value) { - print("TRIGGER PRESS"); if (this.hand === hand && value === 1) { //We are pulling trigger on the hand we have the gun in, so fire this.fire(); diff --git a/examples/weapons/pistol/pistolSpawner.js b/examples/weapons/pistol/pistolSpawner.js index a42b141827..bd95aa9ead 100644 --- a/examples/weapons/pistol/pistolSpawner.js +++ b/examples/weapons/pistol/pistolSpawner.js @@ -1,4 +1,4 @@ -var center = Vec3.sum(MyAvatar.position, Vec3.multiply(1, Quat.getFront(Camera.getOrientation()))); +var center = Vec3.sum(MyAvatar.position, Vec3.multiply(0.5, Quat.getFront(Camera.getOrientation()))); var scriptURL = Script.resolvePath('pistol.js'); var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/gun.fbx"; print("SJDJDJ") @@ -11,15 +11,15 @@ var pistol = Entities.addEntity({ script: scriptURL, color: {red: 200, green: 0, blue: 20}, shapeType: 'box', - collisionsWillMove: true - // userData: JSON.stringify({ - // grabbableKey: { - // spatialKey: { - // relativePosition: {x: 0, y: 0, z: 0}, - // relativeRotation: {x: 0, y: 0, z: 0, w: 1} - // } - // } - // }) + collisionsWillMove: true, + userData: JSON.stringify({ + grabbableKey: { + spatialKey: { + relativePosition: {x: 0, y: 0, z: 0}, + relativeRotation: Quat.fromPitchYawRollDegrees(45, 90 , 0) + } + } + }) });