mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 15:49:51 +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, {
|
||||
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();
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue