mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:00:36 +02:00
gun lining up right
This commit is contained in:
parent
8f0adb5337
commit
5f3da64a25
2 changed files with 10 additions and 14 deletions
|
@ -40,7 +40,6 @@
|
||||||
Overlays.editOverlay(this.laser, {
|
Overlays.editOverlay(this.laser, {
|
||||||
visible: true
|
visible: true
|
||||||
});
|
});
|
||||||
print("EQUIP")
|
|
||||||
},
|
},
|
||||||
|
|
||||||
continueNearGrab: function() {
|
continueNearGrab: function() {
|
||||||
|
@ -67,7 +66,6 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
unequip: function() {
|
unequip: function() {
|
||||||
print("UNEQUIP")
|
|
||||||
this.hand = null;
|
this.hand = null;
|
||||||
this.equipped = false;
|
this.equipped = false;
|
||||||
Overlays.editOverlay(this.laser, {
|
Overlays.editOverlay(this.laser, {
|
||||||
|
@ -77,7 +75,6 @@
|
||||||
|
|
||||||
preload: function(entityID) {
|
preload: function(entityID) {
|
||||||
this.entityID = entityID;
|
this.entityID = entityID;
|
||||||
print("INIT CONTROLLER MAPIING")
|
|
||||||
this.initControllerMapping();
|
this.initControllerMapping();
|
||||||
this.laser = Overlays.addOverlay("line3d", {
|
this.laser = Overlays.addOverlay("line3d", {
|
||||||
start: ZERO_VECTOR,
|
start: ZERO_VECTOR,
|
||||||
|
@ -90,7 +87,6 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
triggerPress: function(hand, value) {
|
triggerPress: function(hand, value) {
|
||||||
print("TRIGGER PRESS");
|
|
||||||
if (this.hand === hand && value === 1) {
|
if (this.hand === hand && value === 1) {
|
||||||
//We are pulling trigger on the hand we have the gun in, so fire
|
//We are pulling trigger on the hand we have the gun in, so fire
|
||||||
this.fire();
|
this.fire();
|
||||||
|
|
|
@ -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 scriptURL = Script.resolvePath('pistol.js');
|
||||||
var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/gun.fbx";
|
var modelURL = "https://s3.amazonaws.com/hifi-public/eric/models/gun.fbx";
|
||||||
print("SJDJDJ")
|
print("SJDJDJ")
|
||||||
|
@ -11,15 +11,15 @@ var pistol = Entities.addEntity({
|
||||||
script: scriptURL,
|
script: scriptURL,
|
||||||
color: {red: 200, green: 0, blue: 20},
|
color: {red: 200, green: 0, blue: 20},
|
||||||
shapeType: 'box',
|
shapeType: 'box',
|
||||||
collisionsWillMove: true
|
collisionsWillMove: true,
|
||||||
// userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
// grabbableKey: {
|
grabbableKey: {
|
||||||
// spatialKey: {
|
spatialKey: {
|
||||||
// relativePosition: {x: 0, y: 0, z: 0},
|
relativePosition: {x: 0, y: 0, z: 0},
|
||||||
// relativeRotation: {x: 0, y: 0, z: 0, w: 1}
|
relativeRotation: Quat.fromPitchYawRollDegrees(45, 90 , 0)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue