summaryrefslogtreecommitdiff
path: root/gfx/include/gfx/scene/object.h
blob: 7579d29d604fdc2c4ea8d1c0e54448564c88941a (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
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include <gfx/sizes.h>

#include <math/fwd.h>

#include <math/aabb3.h>

typedef struct Mesh      Mesh;
typedef struct SceneNode SceneNode;
typedef struct Skeleton  Skeleton;

typedef struct SceneObject SceneObject;

typedef struct ObjectDesc {
  size_t num_meshes;
  Mesh*  meshes[GFX_MAX_NUM_MESHES];
} ObjectDesc;

/// Create a new object.
SceneObject* gfx_make_object(const ObjectDesc*);

/// Destroy the object.
///
/// The object is conveniently removed from the scene graph and its parent scene
/// node is destroyed.
void gfx_destroy_object(SceneObject**);

/// Set the object's skeleton.
void gfx_set_object_skeleton(SceneObject*, const Skeleton*);

/// Get the object's skeleton.
/// Return null if the object has no skeleton.
const Skeleton* gfx_get_object_skeleton(const SceneObject*);

/// Gets the object's bounding box.
///
/// The object's bounding box is the bounding box of its mesh geometries.
aabb3 gfx_get_object_aabb(const SceneObject*);