src/gui-static-text.cpp \
src/guile-irrlicht.cpp \
src/material-flags.cpp \
+ src/mesh.cpp \
+ src/mesh-scene-node.cpp \
src/misc.cpp \
src/rect.cpp \
src/reference-counted.cpp \
(add-file-archive! (get-file-system device) "media/map-20kdm2.pk3")
(define mesh (get-mesh scene-manager "20kdm2.bsp"))
-(define node (add-octree-scene-node
+(define node (add-octree-scene-node!
scene-manager mesh
#:minimal-polys-per-node 1024))
(set-position! node '(-1300 -144 -1249))
#include "gui-environment.h"
#include "gui-static-text.h"
#include "material-flags.h"
+#include "mesh.h"
+#include "mesh-scene-node.h"
#include "misc.h"
#include "reference-counted.h"
#include "scene-manager.h"
init_gui_environment ();
init_gui_static_text ();
init_material_flag ();
+ init_mesh ();
+ init_mesh_scene_node ();
init_misc ();
init_reference_counted ();
init_scene_manager ();
--- /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 "mesh-scene-node.h"
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_mesh_scene_node (void)
+ {
+ init_mesh_scene_node_type ();
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::scene::IMeshSceneNode*, "mesh-scene-node",
+ init_mesh_scene_node_type, mesh_scene_node_p,
+ wrap_mesh_scene_node, unwrap_mesh_scene_node);
+
+}
--- /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_MESH_SCENE_NODE_H_INCLUDED__
+#define __GUILE_IRRLICHT_MESH_SCENE_NODE_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_mesh_scene_node (void);
+
+ DECLARE_WRAPPED_TYPE (irr::scene::IMeshSceneNode*, init_mesh_scene_node_type,
+ mesh_scene_node_p, wrap_mesh_scene_node, unwrap_mesh_scene_node);
+
+}
+
+#endif
--- /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 "mesh.h"
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_mesh (void)
+ {
+ init_mesh_type ();
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::scene::IMesh*, "mesh",
+ init_mesh_type, mesh_p,
+ wrap_mesh, unwrap_mesh);
+
+}
--- /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_MESH_H_INCLUDED__
+#define __GUILE_IRRLICHT_MESH_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_mesh (void);
+
+ DECLARE_WRAPPED_TYPE (irr::scene::IMesh*, init_mesh_type,
+ mesh_p, wrap_mesh, unwrap_mesh);
+
+}
+
+#endif
#include "animated-mesh-scene-node.h"
#include "camera-scene-node.h"
#include "device.h"
+#include "mesh.h"
+#include "mesh-scene-node.h"
#include "scene-manager.h"
#include "scene-node.h"
#include "vector3d.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-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!",
- "get-mesh", "get-scene-manager", NULL);
+ "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_addOctreeSceneNode (SCM wrapped_scene_manager,
+ SCM wrapped_mesh,
+ SCM rest)
+ {
+ SCM parent = scm_from_bool (0);
+ SCM id = scm_from_int32 (-1);
+ SCM minimal_polys_per_node = scm_from_int32 (256);
+ SCM also_add_if_mesh_pointer_zero = scm_from_bool (0);
+
+ scm_c_bind_keyword_arguments ("add-octree-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 ("minimal-polys-per-node"), &minimal_polys_per_node,
+ 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::IMeshSceneNode* node;
+ if (animated_mesh_p (wrapped_mesh))
+ {
+ node = smgr->addOctreeSceneNode (unwrap_animated_mesh (wrapped_mesh),
+ scm_is_false (parent) ? 0 : unwrap_scene_node (parent),
+ scm_to_int32 (id),
+ scm_to_int32 (minimal_polys_per_node),
+ scm_to_bool (also_add_if_mesh_pointer_zero));
+ }
+ else
+ {
+ node = smgr->addOctreeSceneNode (unwrap_mesh (wrapped_mesh),
+ scm_is_false (parent) ? 0 : unwrap_scene_node (parent),
+ scm_to_int32 (id),
+ scm_to_int32 (minimal_polys_per_node),
+ scm_to_bool (also_add_if_mesh_pointer_zero));
+ }
+ return wrap_mesh_scene_node (node);
+ }
+
SCM
irr_scene_getMesh (SCM wrapped_scene_manager,
SCM filename)
irr_scene_addCameraSceneNode (SCM wrapped_scene_manager,
SCM rest);
+ SCM
+ irr_scene_addOctreeSceneNode (SCM wrapped_scene_manager,
+ SCM wrapped_mesh,
+ SCM rest);
+
SCM
irr_scene_getMesh (SCM wrapped_scene_manager,
SCM filename);