--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "keymap.h"
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_keymap (void)
+ {
+ init_keymap_type ();
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::SKeyMap*, "keymap",
+ init_keymap_type, keymap_p,
+ wrap_keymap, unwrap_keymap);
+
+}
--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __GUILE_IRRLICHT_KEYMAP_H_INCLUDED__
+#define __GUILE_IRRLICHT_KEYMAP_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_keymap (void);
+
+ DECLARE_WRAPPED_TYPE (irr::SKeyMap*, init_keymap_type,
+ keymap_p, wrap_keymap, unwrap_keymap);
+
+}
+
+#endif
#include "animated-mesh-scene-node.h"
#include "camera-scene-node.h"
#include "device.h"
+#include "keymap.h"
#include "mesh.h"
#include "mesh-scene-node.h"
#include "scene-manager.h"
(scm_t_subr)irr_scene_addAnimatedMeshSceneNode);
scm_c_define_gsubr ("add-camera-scene-node!", 1, 0, 1,
(scm_t_subr)irr_scene_addCameraSceneNode);
+ scm_c_define_gsubr ("add-camera-scene-node-fps!", 1, 0, 1,
+ (scm_t_subr)irr_scene_addCameraSceneNodeFPS);
scm_c_define_gsubr ("add-octree-scene-node!", 2, 0, 1,
(scm_t_subr)irr_scene_addOctreeSceneNode);
scm_c_define_gsubr ("get-mesh", 2, 0, 0, (scm_t_subr)irr_scene_getMesh);
scm_c_define_gsubr ("get-scene-manager", 1, 0, 0, (scm_t_subr)irr_getSceneManager);
scm_c_export ("add-animated-mesh-scene-node!", "add-camera-scene-node!",
- "add-octree-scene-node!", "get-mesh", "get-scene-manager", NULL);
+ "add-camera-scene-node-fps!", "add-octree-scene-node!",
+ "get-mesh", "get-scene-manager", NULL);
}
DEFINE_WRAPPED_TYPE (irr::scene::ISceneManager*, "scene-manager",
return wrap_camera_scene_node (camera);
}
+ SCM
+ irr_scene_addCameraSceneNodeFPS (SCM wrapped_scene_manager,
+ SCM rest)
+ {
+ SCM parent = scm_from_bool (0);
+ SCM rotate_speed = scm_from_double (100);
+ SCM move_speed = scm_from_double (0.5);
+ SCM id = scm_from_int32 (-1);
+ SCM key_map_array = scm_from_bool (0);
+ SCM key_map_size = scm_from_int32 (0);
+ SCM no_vertical_movement = scm_from_bool (0);
+ SCM jump_speed = scm_from_double (0);
+ SCM invert_mouse = scm_from_bool (0);
+ SCM make_active = scm_from_bool (1);
+
+ scm_c_bind_keyword_arguments ("add-camera-scene-node-fps!", rest, (scm_t_keyword_arguments_flags)0,
+ scm_from_utf8_keyword ("parent"), &parent,
+ scm_from_utf8_keyword ("rotate-speed"), &rotate_speed,
+ scm_from_utf8_keyword ("move-speed"), &move_speed,
+ scm_from_utf8_keyword ("id"), &id,
+ scm_from_utf8_keyword ("key-map-array"), &key_map_array,
+ scm_from_utf8_keyword ("key-map-size"), &key_map_size,
+ scm_from_utf8_keyword ("no-vertical-movement"), &no_vertical_movement,
+ scm_from_utf8_keyword ("jump-speed"), &jump_speed,
+ scm_from_utf8_keyword ("invert-mouse"), &invert_mouse,
+ scm_from_utf8_keyword ("make-active"), &make_active,
+ SCM_UNDEFINED);
+
+ irr::scene::ISceneManager* scene_manager = unwrap_scene_manager (wrapped_scene_manager);
+ irr::scene::ICameraSceneNode* camera =
+ scene_manager->addCameraSceneNodeFPS (scm_is_false (parent) ? 0 : unwrap_scene_node (parent),
+ scm_to_double (rotate_speed),
+ scm_to_double (move_speed),
+ scm_to_int32 (id),
+ scm_is_false (key_map_array) ? 0 : unwrap_keymap (key_map_array),
+ scm_to_int32 (key_map_size),
+ scm_to_bool (no_vertical_movement),
+ scm_to_double (jump_speed),
+ scm_to_bool (invert_mouse),
+ scm_to_bool (make_active));
+ return wrap_camera_scene_node (camera);
+ }
+
SCM
irr_scene_addOctreeSceneNode (SCM wrapped_scene_manager,
SCM wrapped_mesh,