mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 11:44:09 +02:00
bow collisions, etc
This commit is contained in:
parent
aa2450d755
commit
c22a07bba7
1 changed files with 12 additions and 2 deletions
|
@ -270,8 +270,13 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Script.addEventHandler(arrow, "collisionWithEntity", function(entityA, entityB, collision) {
|
var makeArrowStick = function(entityA, entityB, collision) {
|
||||||
Entities.editEntity(entityA, {
|
Entities.editEntity(entityA, {
|
||||||
|
angularVelocity: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
},
|
||||||
velocity: {
|
velocity: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
|
@ -282,10 +287,14 @@
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
|
position: collision.contactPoint,
|
||||||
collisionsWillMove: false
|
collisionsWillMove: false
|
||||||
})
|
})
|
||||||
print('ARROW COLLIDED WITH::' + entityB);
|
print('ARROW COLLIDED WITH::' + entityB);
|
||||||
});
|
Script.removeEventHandler(arrow, "collisionWithEntity", makeArrowStick)
|
||||||
|
}
|
||||||
|
|
||||||
|
Script.addEventHandler(arrow, "collisionWithEntity", makeArrowStick);
|
||||||
|
|
||||||
return arrow
|
return arrow
|
||||||
},
|
},
|
||||||
|
@ -549,6 +558,7 @@
|
||||||
//make the arrow physical, give it gravity, a lifetime, and set our velocity
|
//make the arrow physical, give it gravity, a lifetime, and set our velocity
|
||||||
var arrowProperties = {
|
var arrowProperties = {
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
|
ignoreForCollisions:false,
|
||||||
velocity: releaseVelocity,
|
velocity: releaseVelocity,
|
||||||
gravity: ARROW_GRAVITY,
|
gravity: ARROW_GRAVITY,
|
||||||
lifetime: 10,
|
lifetime: 10,
|
||||||
|
|
Loading…
Reference in a new issue