Added marking of nodes active/inactive.
This commit is contained in:
@@ -439,9 +439,58 @@ TEST_CASE("GraphInputOutputConnectivity", "[AnimGraphResource]") {
|
||||
//
|
||||
// check ordering
|
||||
//
|
||||
REQUIRE (anim_graph.getAnimNodeOrderIndex(blend2_node) < anim_graph.getAnimNodeOrderIndex(sampler_node));
|
||||
REQUIRE (anim_graph.getAnimNodeOrderIndex(blend2_node) < anim_graph.getAnimNodeOrderIndex(speed_scale_node));
|
||||
REQUIRE (anim_graph.getAnimNodeOrderIndex(speed_scale_node) < anim_graph.getAnimNodeOrderIndex(sampler_node));
|
||||
REQUIRE(
|
||||
anim_graph.getAnimNodeOrderIndex(blend2_node)
|
||||
< anim_graph.getAnimNodeOrderIndex(sampler_node));
|
||||
REQUIRE(
|
||||
anim_graph.getAnimNodeOrderIndex(blend2_node)
|
||||
< anim_graph.getAnimNodeOrderIndex(speed_scale_node));
|
||||
REQUIRE(
|
||||
anim_graph.getAnimNodeOrderIndex(speed_scale_node)
|
||||
< anim_graph.getAnimNodeOrderIndex(sampler_node));
|
||||
}
|
||||
|
||||
WHEN("Instantiating graph") {
|
||||
AnimGraph anim_graph = AnimGraph::createFromResource(graph_resource);
|
||||
float* blend_weight_input =
|
||||
reinterpret_cast<float*>(anim_graph.GetInput("GraphFloatInput"));
|
||||
|
||||
Blend2Node* blend2_node =
|
||||
dynamic_cast<Blend2Node*>(anim_graph.m_nodes[blend2_node_index]);
|
||||
SpeedScaleNode* speed_scale_node = dynamic_cast<SpeedScaleNode*>(
|
||||
anim_graph.m_nodes[speed_scale_node_index]);
|
||||
AnimSamplerNode* sampler_node = dynamic_cast<AnimSamplerNode*>(
|
||||
anim_graph.m_nodes[sampler_node_index]);
|
||||
|
||||
WHEN("Setting weight to 0. and marking nodes active.") {
|
||||
*blend_weight_input = 0.;
|
||||
anim_graph.MarkActiveNodes();
|
||||
|
||||
THEN("Speed scale and sampler node are inactive") {
|
||||
REQUIRE(anim_graph.CheckIsNodeActive(speed_scale_node) == false);
|
||||
REQUIRE(anim_graph.CheckIsNodeActive(sampler_node) == false);
|
||||
}
|
||||
}
|
||||
|
||||
WHEN("Setting weight to 0. and marking nodes active") {
|
||||
*blend_weight_input = 0.1;
|
||||
anim_graph.MarkActiveNodes();
|
||||
|
||||
THEN("Speed scale and sampler nodes are active") {
|
||||
REQUIRE(anim_graph.CheckIsNodeActive(speed_scale_node) == true);
|
||||
REQUIRE(anim_graph.CheckIsNodeActive(sampler_node) == true);
|
||||
}
|
||||
}
|
||||
|
||||
WHEN("Setting weight to 1. and marking nodes active") {
|
||||
*blend_weight_input = 1.0;
|
||||
anim_graph.MarkActiveNodes();
|
||||
|
||||
THEN("Speed scale and sampler nodes are active") {
|
||||
REQUIRE(anim_graph.CheckIsNodeActive(speed_scale_node) == true);
|
||||
REQUIRE(anim_graph.CheckIsNodeActive(sampler_node) == true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user