summaryrefslogtreecommitdiff
path: root/gfx/src/scene/object_impl.h
blob: 88f8e316102f154d0ccbe7f8ea2d827b93880538 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <gfx/scene/object.h>

#include "types.h"

#include <math/mat4.h>

typedef struct MeshLink {
  mesh_idx      mesh;
  mesh_link_idx next; // Next MeshLink in the list.
} MeshLink;

/// Scene object.
///
/// A SceneObject does not own its Meshes, and they are instead shared for
/// re-use. The SceneObject consequently embeds a list of MeshLinks as opposed
/// to a list of Meshes. The MeshLinks define a list of Meshes, which can be
/// different for each SceneObject. Each SceneObject may then have a unique list
/// of Meshes, and the Meshes are re-used.
typedef struct SceneObject {
  mesh_link_idx mesh_link; /// First MeshLink in the list.
  skeleton_idx  skeleton;  /// 0 for static objects.
  node_idx      parent;    /// Parent SceneNode.
  aabb3         box;
} SceneObject;