X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fscene-node.cpp;h=08c94a8f48be3464aac40f2fc87ac625964c8c9f;hb=0cb94da9c4b0cc97e1a6e3452922b78f9f84124e;hp=8b3b561902674b8114157969c30fe1d94bfcaa44;hpb=480766c8e4e7272c21f69adf24b706aee20a5dba;p=guile-irrlicht.git diff --git a/src/scene-node.cpp b/src/scene-node.cpp index 8b3b561..08c94a8 100644 --- a/src/scene-node.cpp +++ b/src/scene-node.cpp @@ -81,10 +81,9 @@ extern "C" { } else { - scm_error (scm_arg_type_key, NULL, "Cannot add animator flag to object: ~S", + scm_error (scm_arg_type_key, NULL, "Cannot add animator to object: ~S", scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node)); } - return SCM_UNSPECIFIED; } @@ -98,8 +97,21 @@ extern "C" { SCM irr_scene_getPosition (SCM wrapped_scene_node) { - irr::scene::ISceneNode* node = unwrap_scene_node (wrapped_scene_node, false); - return scm_from_vector3df (node->getPosition ()); +#define GET_POSITION(NODE) scm_from_vector3df (NODE->getPosition ()); + + if (scene_node_p (wrapped_scene_node)) + { + return GET_POSITION (unwrap_scene_node (wrapped_scene_node)); + } + else if (mesh_scene_node_p (wrapped_scene_node)) + { + return GET_POSITION (unwrap_mesh_scene_node (wrapped_scene_node)); + } + else + { + scm_error (scm_arg_type_key, NULL, "Cannot get position from object: ~S", + scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node)); + } } SCM