mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 19:38:22 +02:00
applying force, now must figure out positioning
This commit is contained in:
parent
1c9f94f3c0
commit
8f0adb5337
1 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
}
|
||||
this.fireSound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/Guns/GUN-SHOT2.raw");
|
||||
this.fireVolume = 0.5;
|
||||
this.bulletForce = 10;
|
||||
};
|
||||
|
||||
Pistol.prototype = {
|
||||
|
@ -109,6 +110,12 @@
|
|||
var intersection = Entities.findRayIntersectionBlocking(pickRay, true);
|
||||
if (intersection.intersects) {
|
||||
this.createEntityHitEffect(intersection.intersection);
|
||||
if (intersection.properties.collisionsWillMove === 1) {
|
||||
// Any entity with collisions will move can be shot
|
||||
Entities.editEntity(intersection.entityID, {
|
||||
velocity: Vec3.multiply(this.firingDirection, this.bulletForce)
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue