mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 00:36:30 +02:00
make pistol collision sound quieter, other adjustments
This commit is contained in:
parent
4ea5c11b73
commit
8d3468265f
4 changed files with 16 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
||||||
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(1.5, Quat.getFront(Camera.getOrientation())));
|
var center = Vec3.sum(MyAvatar.position, Vec3.multiply(1.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('MAKING A PISTOLA')
|
||||||
|
|
||||||
var pistol = Entities.addEntity({
|
var pistol = Entities.addEntity({
|
||||||
type: 'Model',
|
type: 'Model',
|
||||||
|
@ -9,8 +9,8 @@ var pistol = Entities.addEntity({
|
||||||
position: center,
|
position: center,
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: 0.05,
|
x: 0.05,
|
||||||
y: .23,
|
y: 0.23,
|
||||||
z: .36
|
z: 0.36
|
||||||
},
|
},
|
||||||
script: scriptURL,
|
script: scriptURL,
|
||||||
color: {
|
color: {
|
||||||
|
@ -20,9 +20,14 @@ var pistol = Entities.addEntity({
|
||||||
},
|
},
|
||||||
shapeType: 'box',
|
shapeType: 'box',
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
gravity: {x: 0, y: -5.0, z: 0},
|
gravity: {
|
||||||
|
x: 0,
|
||||||
|
y: -5.0,
|
||||||
|
z: 0
|
||||||
|
},
|
||||||
restitution: 0,
|
restitution: 0,
|
||||||
collisionSoundURL: "https://s3.amazonaws.com/hifi-public/sounds/Guns/Gun_Drop_and_Metalli_1.wav",
|
damping:0.5,
|
||||||
|
collisionSoundURL: "http://hifi-content.s3.amazonaws.com/james/pistol/sounds/gundrop.wav",
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
spatialKey: {
|
spatialKey: {
|
||||||
|
@ -43,4 +48,4 @@ function cleanup() {
|
||||||
Entities.deleteEntity(pistol);
|
Entities.deleteEntity(pistol);
|
||||||
}
|
}
|
||||||
|
|
||||||
Script.scriptEnding.connect(cleanup);
|
Script.scriptEnding.connect(cleanup);
|
|
@ -1,6 +1,5 @@
|
||||||
//
|
//
|
||||||
// pistol.js
|
// pistol.js
|
||||||
// examples/toybox/entityScripts
|
|
||||||
//
|
//
|
||||||
// Created by Eric Levin on11/11/15.
|
// Created by Eric Levin on11/11/15.
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
Script.include("../../libraries/constants.js");
|
Script.include("../../libraries/constants.js");
|
||||||
|
|
||||||
var _this;
|
var _this;
|
||||||
// if the trigger value goes below this while held, the can will stop spraying. if it goes above, it will spray
|
|
||||||
var DISABLE_LASER_THRESHOLD = 0.2;
|
var DISABLE_LASER_THRESHOLD = 0.2;
|
||||||
var TRIGGER_CONTROLS = [
|
var TRIGGER_CONTROLS = [
|
||||||
Controller.Standard.LT,
|
Controller.Standard.LT,
|
||||||
|
|
|
@ -277,7 +277,9 @@
|
||||||
name: "pistol",
|
name: "pistol",
|
||||||
modelURL: modelURL,
|
modelURL: modelURL,
|
||||||
position: position,
|
position: position,
|
||||||
collisionSoundURL: "https://s3.amazonaws.com/hifi-public/sounds/Guns/Gun_Drop_and_Metalli_1.wav",
|
restitution: 0,
|
||||||
|
damping:0.5,
|
||||||
|
collisionSoundURL: "http://hifi-content.s3.amazonaws.com/james/pistol/sounds/gundrop.wav",
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: 0.05,
|
x: 0.05,
|
||||||
y: 0.23,
|
y: 0.23,
|
||||||
|
|
|
@ -280,7 +280,8 @@ MasterReset = function() {
|
||||||
},
|
},
|
||||||
restitution: 0,
|
restitution: 0,
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
collisionSoundURL: "https://s3.amazonaws.com/hifi-public/sounds/Guns/Gun_Drop_and_Metalli_1.wav",
|
damping: 0.5,
|
||||||
|
collisionSoundURL: "http://hifi-content.s3.amazonaws.com/james/pistol/sounds/gundrop.wav",
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
spatialKey: {
|
spatialKey: {
|
||||||
|
|
Loading…
Reference in a new issue