scena 1.0.0

A Rust-native scene-graph renderer with typed scene state, glTF assets, and explicit prepare/render lifecycles.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::super::{NodeKey, Scene};

pub(super) fn node_is_descendant_of(scene: &Scene, candidate: NodeKey, ancestor: NodeKey) -> bool {
    let mut current = Some(candidate);
    while let Some(node) = current {
        if node == ancestor {
            return true;
        }
        current = scene.nodes.get(node).and_then(|node| node.parent());
    }
    false
}