Removed even more unused files.
This commit is contained in:
@@ -5,10 +5,8 @@
|
||||
#ifndef ANIMTESTBED_ANIMGRAPHRESOURCE_H
|
||||
#define ANIMTESTBED_ANIMGRAPHRESOURCE_H
|
||||
|
||||
#include "AnimGraph.h"
|
||||
#include "AnimGraphNodes.h"
|
||||
|
||||
#include "3rdparty/json/json.hpp"
|
||||
#include "AnimGraphNodes.h"
|
||||
|
||||
struct AnimGraphBlendTree;
|
||||
struct AnimGraphStateMachine;
|
||||
@@ -23,7 +21,8 @@ struct AnimNodeResource {
|
||||
float m_position[2] = {0.f, 0.f};
|
||||
};
|
||||
|
||||
static inline AnimNodeResource* AnimNodeResourceFactory(const std::string& node_type_name);
|
||||
static inline AnimNodeResource* AnimNodeResourceFactory(
|
||||
const std::string& node_type_name);
|
||||
|
||||
struct BlendTreeConnectionResource {
|
||||
size_t source_node_index = -1;
|
||||
@@ -36,8 +35,7 @@ struct BlendTreeResource {
|
||||
std::vector<AnimNodeResource*> m_nodes;
|
||||
std::vector<BlendTreeConnectionResource> m_connections;
|
||||
|
||||
~BlendTreeResource() { CleanupNodes();
|
||||
}
|
||||
~BlendTreeResource() { CleanupNodes(); }
|
||||
|
||||
void Reset() {
|
||||
CleanupNodes();
|
||||
@@ -62,8 +60,12 @@ struct BlendTreeResource {
|
||||
m_nodes[1]->m_name = "Inputs";
|
||||
}
|
||||
|
||||
[[nodiscard]] AnimNodeResource* GetGraphOutputNode() const { return m_nodes[0]; }
|
||||
[[nodiscard]] AnimNodeResource* GetGraphInputNode() const { return m_nodes[1]; }
|
||||
[[nodiscard]] AnimNodeResource* GetGraphOutputNode() const {
|
||||
return m_nodes[0];
|
||||
}
|
||||
[[nodiscard]] AnimNodeResource* GetGraphInputNode() const {
|
||||
return m_nodes[1];
|
||||
}
|
||||
|
||||
size_t GetNodeIndex(const AnimNodeResource* node_resource) const {
|
||||
for (size_t i = 0, n = m_nodes.size(); i < n; i++) {
|
||||
@@ -75,7 +77,7 @@ struct BlendTreeResource {
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool ConnectSockets (
|
||||
bool ConnectSockets(
|
||||
const AnimNodeResource* source_node,
|
||||
const std::string& source_socket_name,
|
||||
const AnimNodeResource* target_node,
|
||||
@@ -86,13 +88,17 @@ struct BlendTreeResource {
|
||||
std::vector<Socket*> result;
|
||||
|
||||
for (size_t i = 0; i < m_nodes.size(); i++) {
|
||||
for (size_t j = 0, num_inputs = instance_node_descriptors[i]->m_inputs.size();
|
||||
for (size_t j = 0,
|
||||
num_inputs = instance_node_descriptors[i]->m_inputs.size();
|
||||
j < num_inputs;
|
||||
j++) {
|
||||
Socket& input = instance_node_descriptors[i]->m_inputs[j];
|
||||
|
||||
if (*input.m_reference.ptr_ptr == nullptr) {
|
||||
memcpy(&input.m_value, &m_nodes[i]->m_socket_accessor->m_inputs[j].m_value, sizeof(Socket::SocketValue));
|
||||
memcpy(
|
||||
&input.m_value,
|
||||
&m_nodes[i]->m_socket_accessor->m_inputs[j].m_value,
|
||||
sizeof(Socket::SocketValue));
|
||||
result.push_back(&input);
|
||||
}
|
||||
}
|
||||
@@ -104,12 +110,14 @@ struct BlendTreeResource {
|
||||
size_t GetNodeIndexForOutputSocket(const std::string& socket_name) const {
|
||||
for (size_t i = 0; i < m_connections.size(); i++) {
|
||||
const BlendTreeConnectionResource& connection = m_connections[i];
|
||||
if (connection.target_node_index == 0 && connection.target_socket_name == socket_name) {
|
||||
if (connection.target_node_index == 0
|
||||
&& connection.target_socket_name == socket_name) {
|
||||
return connection.source_node_index;
|
||||
}
|
||||
}
|
||||
|
||||
std::cerr << "Error: could not find a node connected to output '" << socket_name << "'." << std::endl;
|
||||
std::cerr << "Error: could not find a node connected to output '"
|
||||
<< socket_name << "'." << std::endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -117,12 +125,14 @@ struct BlendTreeResource {
|
||||
size_t GetNodeIndexForInputSocket(const std::string& socket_name) const {
|
||||
for (size_t i = 0; i < m_connections.size(); i++) {
|
||||
const BlendTreeConnectionResource& connection = m_connections[i];
|
||||
if (connection.source_node_index == 1 && connection.source_socket_name == socket_name) {
|
||||
if (connection.source_node_index == 1
|
||||
&& connection.source_socket_name == socket_name) {
|
||||
return connection.target_node_index;
|
||||
}
|
||||
}
|
||||
|
||||
std::cerr << "Error: could not find a node connected to input '" << socket_name << "'." << std::endl;
|
||||
std::cerr << "Error: could not find a node connected to input '"
|
||||
<< socket_name << "'." << std::endl;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -140,7 +150,7 @@ struct StateMachineResource {
|
||||
std::vector<StateMachineTransitionResources> m_transitions;
|
||||
};
|
||||
|
||||
struct AnimGraphResource: AnimNodeResource {
|
||||
struct AnimGraphResource : AnimNodeResource {
|
||||
std::string m_graph_type_name;
|
||||
|
||||
BlendTreeResource m_blend_tree_resource;
|
||||
|
||||
Reference in New Issue
Block a user