mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 06:53:46 +02:00
Fixed bug in spray paint where sometimes would not spray
This commit is contained in:
parent
0fb51a6777
commit
407b6b8158
1 changed files with 1 additions and 32 deletions
|
@ -101,6 +101,7 @@
|
|||
this.disableStream = function() {
|
||||
Entities.deleteEntity(this.paintStream);
|
||||
this.paintStream = null;
|
||||
this.spraying = false;
|
||||
this.sprayInjector.stop();
|
||||
}
|
||||
|
||||
|
@ -145,35 +146,3 @@
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function randFloat(min, max) {
|
||||
return Math.random() * (max - min) + min;
|
||||
}
|
||||
|
||||
function randInt(min, max) {
|
||||
return Math.floor(Math.random() * (max - min)) + min;
|
||||
}
|
||||
|
||||
function orientationOf(vector) {
|
||||
var Y_AXIS = {
|
||||
x: 0,
|
||||
y: 1,
|
||||
z: 0
|
||||
};
|
||||
var X_AXIS = {
|
||||
x: 1,
|
||||
y: 0,
|
||||
z: 0
|
||||
};
|
||||
|
||||
var theta = 0.0;
|
||||
|
||||
var RAD_TO_DEG = 180.0 / Math.PI;
|
||||
var direction, yaw, pitch;
|
||||
direction = Vec3.normalize(vector);
|
||||
yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * RAD_TO_DEG, Y_AXIS);
|
||||
pitch = Quat.angleAxis(Math.asin(-direction.y) * RAD_TO_DEG, X_AXIS);
|
||||
return Quat.multiply(yaw, pitch);
|
||||
}
|
Loading…
Reference in a new issue