Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarLightSource.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /source/game/StarLightSource.hpp
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'source/game/StarLightSource.hpp')
-rw-r--r--source/game/StarLightSource.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/source/game/StarLightSource.hpp b/source/game/StarLightSource.hpp
new file mode 100644
index 0000000..b19240e
--- /dev/null
+++ b/source/game/StarLightSource.hpp
@@ -0,0 +1,31 @@
+#ifndef STAR_LIGHT_SOURCE_HPP
+#define STAR_LIGHT_SOURCE_HPP
+
+#include "StarVector.hpp"
+#include "StarDataStream.hpp"
+
+namespace Star {
+
+struct LightSource {
+ Vec2F position;
+ Vec3B color;
+
+ bool pointLight;
+ // pointBeam of 0.0 means light has no beam component, as pointBeam goes up,
+ // the dropoff from the beamAngle becomes faster and faster.
+ float pointBeam;
+ // The angle of the beam component of the light in radians
+ float beamAngle;
+ // beamAmbience provides a floor to the dropoff for beamed lights, so that
+ // even where the beam is not pointing there will still be some light. 0.0
+ // means no ambient floor, 1.0 effectively turns off beaming.
+ float beamAmbience;
+
+ void translate(Vec2F const& pos);
+};
+
+DataStream& operator<<(DataStream& ds, LightSource const& lightSource);
+DataStream& operator>>(DataStream& ds, LightSource& lightSource);
+}
+
+#endif