diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-05-30 11:24:46 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-05-30 11:24:46 +0200 |
| commit | 49e8918e20d9cce86a7a136a231e400c2680e88f (patch) | |
| tree | be8efc9f7d13b667a4e225b8dfa5f2c348b7ec10 /src/light.cpp | |
| parent | 2970f407be7dd7aec13cf4733bf93b700abd2b0f (diff) | |
wip light inspect & serialize stuff
Diffstat (limited to 'src/light.cpp')
| -rw-r--r-- | src/light.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/light.cpp b/src/light.cpp index ed9469f2..03fe4690 100644 --- a/src/light.cpp +++ b/src/light.cpp @@ -20,7 +20,7 @@ bool light_proto::operator==(const light_proto&) const = default; light::light(object_id id, struct chunk& c, const light_proto& proto) : entity{id, c, proto}, - half_dist{proto.half_dist}, + max_distance{proto.max_distance}, color{proto.color}, falloff{proto.falloff} { @@ -43,19 +43,4 @@ bool light::update(size_t, float) { return false; } bool light::is_dynamic() const { return true; } bool light::is_virtual() const { return true; } -Vector2 light::intensity(Vector2 half_dist, light_falloff falloff) -{ - switch (falloff) - { - case light_falloff::linear: return 2 * half_dist; - case light_falloff::quadratic: return Vector2{std::sqrt(2 * half_dist.x()), std::sqrt(2 * half_dist.y())}; - default: case light_falloff::constant: return Vector2{1, 1}; - } -} - -Vector2 light::intensity() const -{ - return intensity(half_dist, falloff); -} - } // namespace floormat |
