Untitled
Toggle main menu visibility
Loading...
Searching...
No Matches
engine_utilities.c
Go to the documentation of this file.
1
2
3
#include "
core/engine_types.h
"
4
5
bool
mn_inside_of_root_tree
(
MeshNode
* mns,
int
check_id,
int
id
)
6
{
7
if
(
id
== -1 || check_id == -1)
return
false
;
8
MeshNode
* mn = &mns[id];
9
if
(mn->
id
== check_id)
return
true
;
10
for
(
int
i = 0; i < mn->
child_count
; i++)
11
{
12
bool
inside =
mn_inside_of_root_tree
(mns, check_id, mn->
children
[i]);
13
if
(inside ==
true
)
return
true
;
14
}
15
return
false
;
16
17
}
18
19
MeshNode
*
get_root_node
(
MeshNode
* mns,
MeshNode
* mn)
20
{
21
22
23
if
(mn->
parent
!= -1)
24
{
25
return
get_root_node
(mns, &mns[mn->
parent
]);
26
}
27
28
return
mn;
29
30
}
engine_types.h
Engine specific types and defines.
mn_inside_of_root_tree
bool mn_inside_of_root_tree(MeshNode *mns, int check_id, int id)
Definition
engine_utilities.c:5
get_root_node
MeshNode * get_root_node(MeshNode *mns, MeshNode *mn)
Definition
engine_utilities.c:19
MeshNode::id
size_t id
The ID inside of Globals.mesh_nodes.
Definition
engine_types.h:2372
MeshNode::children
int children[128]
The children to this node, a global index into Globals.mesh_nodes.
Definition
engine_types.h:2396
MeshNode::parent
int parent
The parent to this node, a global index into Globals.mesh_nodes.
Definition
engine_types.h:2392
MeshNode::child_count
int child_count
The amount of children.
Definition
engine_types.h:2397
MeshNode
MeshNodes that describe the position of Meshes, GLTF nodes for GLTFAnimations, or hold references to ...
Definition
audio_probe_bake.comp:85
src
utilities
engine_utilities.c
Generated by
1.18.0