mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into set-model-entity-joints
This commit is contained in:
commit
086ea66c04
1 changed files with 16 additions and 16 deletions
|
@ -17,34 +17,34 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
Target.prototype = {
|
Target.prototype = {
|
||||||
hasPlayedSound: false,
|
hasBecomeActive: false,
|
||||||
preload: function(entityID) {
|
preload: function(entityID) {
|
||||||
this.entityID = entityID;
|
this.entityID = entityID;
|
||||||
var SOUND_URL = "http://hifi-public.s3.amazonaws.com/sounds/Clay_Pigeon_02.L.wav";
|
var SOUND_URL = "http://hifi-public.s3.amazonaws.com/sounds/Clay_Pigeon_02.L.wav";
|
||||||
this.hitSound = SoundCache.getSound(SOUND_URL);
|
this.hitSound = SoundCache.getSound(SOUND_URL);
|
||||||
},
|
},
|
||||||
collisionWithEntity: function(me, otherEntity) {
|
collisionWithEntity: function(me, otherEntity) {
|
||||||
var position = Entities.getEntityProperties(me, "position").position;
|
if (this.hasBecomeActive === false) {
|
||||||
Entities.editEntity(me, {
|
var position = Entities.getEntityProperties(me, "position").position;
|
||||||
gravity: {
|
Entities.editEntity(me, {
|
||||||
x: 0,
|
gravity: {
|
||||||
y: -9.8,
|
x: 0,
|
||||||
z: 0
|
y: -9.8,
|
||||||
},
|
z: 0
|
||||||
velocity: {
|
},
|
||||||
x: 0,
|
velocity: {
|
||||||
y: -0.01,
|
x: 0,
|
||||||
z: 0
|
y: -0.01,
|
||||||
}
|
z: 0
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (this.hasPlayedSound === false) {
|
|
||||||
this.audioInjector = Audio.playSound(this.hitSound, {
|
this.audioInjector = Audio.playSound(this.hitSound, {
|
||||||
position: position,
|
position: position,
|
||||||
volume: 0.5
|
volume: 0.5
|
||||||
});
|
});
|
||||||
|
|
||||||
this.hasPlayedSound = true;
|
this.hasBecomeActive = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue