aboutsummaryrefslogtreecommitdiff
path: root/src/scene/object_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/scene/object_impl.h')
-rw-r--r--src/scene/object_impl.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/scene/object_impl.h b/src/scene/object_impl.h
new file mode 100644
index 0000000..e864e53
--- /dev/null
+++ b/src/scene/object_impl.h
@@ -0,0 +1,25 @@
1#pragma once
2
3#include <gfx/scene/object.h>
4
5#include "types.h"
6
7typedef struct MeshLink {
8 mesh_idx mesh;
9 mesh_link_idx next; // Next MeshLink in the list.
10} MeshLink;
11
12/// Scene object.
13///
14/// A SceneObject does not own its Meshes, and they are instead shared for
15/// re-use. The SceneObject consequently embeds a list of MeshLinks as opposed
16/// to a list of Meshes. The MeshLinks define a list of Meshes, which can be
17/// different for each SceneObject. Each SceneObject may then have a unique list
18/// of Meshes, and the Meshes are re-used.
19typedef struct SceneObject {
20 mesh_link_idx mesh_link; /// First MeshLink in the list.
21 skeleton_idx skeleton; /// 0 for static objects.
22 // TODO: Can we just store node indices in nodes, not the contained object?
23 node_idx parent; /// Parent SceneNode.
24 aabb3 box;
25} SceneObject;