aboutsummaryrefslogtreecommitdiff
path: root/src/utils/sceneparser.h
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-12-07 16:23:20 -0500
committersotech117 <michael_foiani@brown.edu>2023-12-07 16:23:20 -0500
commitcaa765bff49d54217b75aaf0e7acf4e5392a11e4 (patch)
tree9b92914dfb88b99599e8e60e4512e9e9ea9a25db /src/utils/sceneparser.h
parenta9274459443f1d560d7580a162deb581549980cb (diff)
upload base code
Diffstat (limited to 'src/utils/sceneparser.h')
-rw-r--r--src/utils/sceneparser.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/utils/sceneparser.h b/src/utils/sceneparser.h
new file mode 100644
index 0000000..699d6fb
--- /dev/null
+++ b/src/utils/sceneparser.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#include "scenedata.h"
+#include <vector>
+#include <string>
+#include "rgba.h"
+
+// Struct which contains data for a single primitive, to be used for rendering
+struct RenderShapeData {
+ ScenePrimitive primitive;
+ glm::mat4 ctm; // the cumulative transformation matrix
+ glm::mat4 inverseCTM;
+};
+
+// Struct which contains all the data needed to render a scene
+struct RenderData {
+ SceneGlobalData globalData;
+ SceneCameraData cameraData;
+
+ std::vector<SceneLightData> lights;
+ std::vector<RenderShapeData> shapes;
+};
+
+class SceneParser {
+public:
+ // Parse the scene and store the results in renderData.
+ // @param filepath The path of the scene file to load.
+ // @param renderData On return, this will contain the metadata of the loaded scene.
+ // @return A boolean value indicating whether the parse was successful.
+ static bool parse(std::string filepath, RenderData &renderData);
+};