VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
defaultAnimBinder.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3#include "defaultAnimBinder.h"
4
5#include "framework/entity.h"
6
7namespace visutwin::canvas
8{
10 {
11 }
12
13 GraphNode* DefaultAnimBinder::resolve(const std::string& path)
14 {
15 const auto it = _nodes.find(path);
16 if (it != _nodes.end()) {
17 return it->second;
18 }
19
20 if (!_entity) {
21 return nullptr;
22 }
23
24 GraphNode* node = _entity->findByName(path);
25 _nodes[path] = node;
26 return node;
27 }
28
29 void DefaultAnimBinder::unresolve(const std::string& path)
30 {
31 _nodes.erase(path);
32 }
33}
GraphNode * resolve(const std::string &path) override
void unresolve(const std::string &path) override
ECS entity — a GraphNode that hosts components defining its behavior.
Definition entity.h:32
Hierarchical scene graph node with local/world transforms and parent-child relationships.
Definition graphNode.h:28
GraphNode * findByName(const std::string &name)
std::vector< GraphNode * > find(const std::function< bool(GraphNode *)> &predicate)
Find all descendants (and self) matching a predicate.