diff options
author | Peter Kohaut | 2019-01-24 22:56:10 +0100 |
---|---|---|
committer | Peter Kohaut | 2019-01-24 22:59:49 +0100 |
commit | 2fd29c5193a0b9e6d3920f0512ce3ca37b00bf7e (patch) | |
tree | 77563b1fab1720e4ea892d2202ca4dd7416c260b /engines/bladerunner/vector.h | |
parent | 5475bca1e1996977a45c598d61e186f10c407155 (diff) | |
download | scummvm-rg350-2fd29c5193a0b9e6d3920f0512ce3ca37b00bf7e.tar.gz scummvm-rg350-2fd29c5193a0b9e6d3920f0512ce3ca37b00bf7e.tar.bz2 scummvm-rg350-2fd29c5193a0b9e6d3920f0512ce3ca37b00bf7e.zip |
BLADERUNNER: Fixed fog rendering
Fogs were not animated.
Clean up of the fog calculation routines.
Diffstat (limited to 'engines/bladerunner/vector.h')
-rw-r--r-- | engines/bladerunner/vector.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/engines/bladerunner/vector.h b/engines/bladerunner/vector.h index d5d6365a81..52883cb587 100644 --- a/engines/bladerunner/vector.h +++ b/engines/bladerunner/vector.h @@ -55,8 +55,11 @@ public: Vector3(float ax, float ay, float az) : x(ax), y(ay), z(az) {} - float length() { return sqrt(x * x + y * y + z * z); } - Vector3 normalize() { + inline float length() { + return sqrt(x * x + y * y + z * z); + } + + inline Vector3 normalize() { float len = length(); if (len == 0) { return Vector3(0.0f, 0.0f, 0.0f); @@ -64,13 +67,17 @@ public: return Vector3(x / len, y / len, z / len); } - static Vector3 cross(Vector3 a, Vector3 b) { + inline static Vector3 cross(Vector3 a, Vector3 b) { return Vector3( a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); } + inline static float dot(Vector3 a, Vector3 b) { + return a.x * b.x + a.y * b.y + a.z * b.z; + } + Vector2 xz() const { return Vector2(x, z); } |