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;
}