- SCM
- irr_scene_addAnimatedMeshSceneNode (SCM wrapped_scene_manager,
- SCM mesh,
- SCM rest)
- {
- SCM parent = scm_from_bool (0);
- SCM id = scm_from_int32 (-1);
- SCM position = scm_list_3 (scm_from_double (0),
- scm_from_double (0),
- scm_from_double (0));
- SCM rotation = scm_list_3 (scm_from_double (0),
- scm_from_double (0),
- scm_from_double (0));
- SCM scale = scm_list_3 (scm_from_double (1),
- scm_from_double (1),
- scm_from_double (1));
- SCM also_add_if_mesh_pointer_zero = scm_from_bool (0);
-
- scm_c_bind_keyword_arguments ("add-animated-mesh-scene-node!", rest, (scm_t_keyword_arguments_flags)0,
- scm_from_utf8_keyword ("parent"), &parent,
- scm_from_utf8_keyword ("id"), &id,
- scm_from_utf8_keyword ("position"), &position,
- scm_from_utf8_keyword ("rotation"), &rotation,
- scm_from_utf8_keyword ("scale"), &scale,
- scm_from_utf8_keyword ("also-add-if-mesh-pointer-zero"), &also_add_if_mesh_pointer_zero,
- SCM_UNDEFINED);
-
- irr::scene::ISceneManager* smgr = unwrap_scene_manager (wrapped_scene_manager);
- irr::scene::IAnimatedMeshSceneNode* node =
- smgr->addAnimatedMeshSceneNode (unwrap_animated_mesh (mesh),
- scm_is_false (parent) ? 0 : unwrap_scene_node (parent),
- scm_to_int32 (id),
- scm_to_vector3df (position),
- scm_to_vector3df (rotation),
- scm_to_vector3df (scale),
- scm_to_bool (also_add_if_mesh_pointer_zero));
- return wrap_animated_mesh_scene_node (node);
- }
-
- SCM
- irr_scene_addCameraSceneNode (SCM wrapped_scene_manager,
- SCM rest)
- {
- SCM parent = scm_from_bool (0);
- SCM position = scm_list_3 (scm_from_double (0),
- scm_from_double (0),
- scm_from_double (0));
- SCM lookat = scm_list_3 (scm_from_double (0),
- scm_from_double (0),
- scm_from_double (100));
- SCM id = scm_from_int32 (-1);
- SCM make_active = scm_from_bool (1);
-
- scm_c_bind_keyword_arguments ("add-camera-scene-node!", rest, (scm_t_keyword_arguments_flags)0,
- scm_from_utf8_keyword ("parent"), &parent,
- scm_from_utf8_keyword ("position"), &position,
- scm_from_utf8_keyword ("lookat"), &lookat,
- scm_from_utf8_keyword ("id"), &id,
- scm_from_utf8_keyword ("make-active"), &make_active,
- SCM_UNDEFINED);
+using namespace irr;
+
+template <typename TParent>
+SCM
+ISceneManager_addAnimatedMeshSceneNode (SCM scene_manager,
+ SCM mesh,
+ SCM parent,
+ SCM id,
+ SCM position,
+ SCM rotation,
+ SCM scale,
+ SCM also_add_if_mesh_pointer_zero)
+{
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::IAnimatedMeshSceneNode* node =
+ smgr->addAnimatedMeshSceneNode ((scene::IAnimatedMesh*) scm_to_pointer (mesh),
+ (TParent) scm_to_pointer (parent),
+ scm_to_int32 (id),
+ scm_to_vector3df (position),
+ scm_to_vector3df (rotation),
+ scm_to_vector3df (scale),
+ scm_to_bool (also_add_if_mesh_pointer_zero));
+ return scm_from_pointer ((void*) node, NULL);
+}