From d6fd925d118daf71de62200a6c5505fa06917f62 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Wed, 8 Apr 2020 20:35:49 +0200 Subject: [PATCH] add-animator! with mesh-scene-node support --- src/scene-node.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/scene-node.cpp b/src/scene-node.cpp index f587c05..1ec773c 100644 --- a/src/scene-node.cpp +++ b/src/scene-node.cpp @@ -54,7 +54,22 @@ extern "C" { irr_scene_addAnimator (SCM wrapped_scene_node, SCM animator) { - irr::scene::ISceneNode* node = unwrap_scene_node (wrapped_scene_node); + irr::scene::ISceneNode* node; + + if (mesh_scene_node_p (wrapped_scene_node)) + { + node = (irr::scene::ISceneNode*)unwrap_mesh_scene_node (wrapped_scene_node); + } + else if (scene_node_p (wrapped_scene_node)) + { + node = unwrap_scene_node (wrapped_scene_node); + } + else + { + scm_error (scm_arg_type_key, NULL, "Cannot add animator flag to object: ~S", + scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node)); + } + node->addAnimator (unwrap_scene_node_animator (animator)); return SCM_UNSPECIFIED; } -- 2.39.5