summaryrefslogtreecommitdiff
path: root/gfx/models
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/models')
-rw-r--r--gfx/models/lights.cpp11
-rw-r--r--gfx/models/lights.h29
2 files changed, 40 insertions, 0 deletions
diff --git a/gfx/models/lights.cpp b/gfx/models/lights.cpp
new file mode 100644
index 0000000..8c0e9e6
--- /dev/null
+++ b/gfx/models/lights.cpp
@@ -0,0 +1,11 @@
+#include "lights.h"
+
+SpotLightVertex::SpotLightVertex(const SpotLightDef & light, uint32_t parentObjectIdx) :
+ SpotLightDef {light}, LightCommonVertex {parentObjectIdx}
+{
+}
+
+PointLightVertex::PointLightVertex(const PointLightDef & light, uint32_t parentObjectIdx) :
+ PointLightDef {light}, LightCommonVertex {parentObjectIdx}
+{
+}
diff --git a/gfx/models/lights.h b/gfx/models/lights.h
new file mode 100644
index 0000000..586b3ef
--- /dev/null
+++ b/gfx/models/lights.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "config/types.h"
+
+struct LightCommon {
+ RelativePosition3D position;
+ RGB colour;
+ RelativeDistance kq;
+};
+
+struct LightCommonVertex {
+ uint32_t parentObject;
+};
+
+struct SpotLightDef : LightCommon {
+ Direction3D direction;
+ Angle arc;
+};
+
+struct PointLightDef : LightCommon { };
+
+struct SpotLightVertex : SpotLightDef, LightCommonVertex {
+ SpotLightVertex(const SpotLightDef &, uint32_t);
+};
+
+struct PointLightVertex : PointLightDef, LightCommonVertex {
+ PointLightVertex(const PointLightDef &, uint32_t);
+};
+