|
4 | 4 | #include "mm_animation_library.h"
|
5 | 5 | #include "mm_animation_node.h"
|
6 | 6 |
|
| 7 | +#include <godot_cpp/classes/animation_root_node.hpp> |
7 | 8 | #include <godot_cpp/classes/engine.hpp>
|
8 | 9 | #include <godot_cpp/classes/input.hpp>
|
9 | 10 | #include <godot_cpp/classes/input_event_mouse_motion.hpp>
|
@@ -256,6 +257,7 @@ void MMCharacter::_fill_query_input(MMQueryInput& input) {
|
256 | 257 | input.controller_transform = get_global_transform();
|
257 | 258 | input.character_transform = skeleton->get_global_transform();
|
258 | 259 | input.skeleton_state = _skeleton_state;
|
| 260 | + input.on_query_result = std::bind(&MMCharacter::_on_query_result, this, std::placeholders::_1); |
259 | 261 | }
|
260 | 262 |
|
261 | 263 | void MMCharacter::_update_query() {
|
@@ -326,6 +328,12 @@ void MMCharacter::_update_skeleton_state(double delta_t) {
|
326 | 328 | }
|
327 | 329 | }
|
328 | 330 |
|
| 331 | +void MMCharacter::_on_query_result(const MMQueryOutput& output) { |
| 332 | + if (emit_result_signal) { |
| 333 | + emit_signal("on_query_result", _output_to_dict(output)); |
| 334 | + } |
| 335 | +} |
| 336 | + |
329 | 337 | Dictionary MMCharacter::_output_to_dict(const MMQueryOutput& output) {
|
330 | 338 | Dictionary result;
|
331 | 339 |
|
@@ -366,6 +374,9 @@ void MMCharacter::_bind_methods() {
|
366 | 374 | BINDER_PROPERTY_PARAMS(MMCharacter, Variant::FLOAT, trajectory_delta_time);
|
367 | 375 | BINDER_PROPERTY_PARAMS(MMCharacter, Variant::INT, history_point_count);
|
368 | 376 | BINDER_PROPERTY_PARAMS(MMCharacter, Variant::FLOAT, history_delta_time);
|
| 377 | + |
| 378 | + ADD_GROUP("Debug", ""); |
| 379 | + BINDER_PROPERTY_PARAMS(MMCharacter, Variant::BOOL, emit_result_signal); |
369 | 380 | }
|
370 | 381 |
|
371 | 382 | void MMCharacter::_notification(int p_what) {
|
|
0 commit comments