ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = libguile-irrlicht.la
libguile_irrlicht_la_SOURCES = \
- src/aabbox3d.cpp \
src/animated-mesh.cpp \
src/animated-mesh-md2.cpp \
src/animated-mesh-scene-node.cpp \
+ src/box3d.cpp \
src/camera-scene-node.cpp \
src/color.cpp \
src/cursor-control.cpp \
#:lookat '(0 0 0))
;; create our custom scene node
-(define box (make-aabbox3df))
+(define box (make-box3d))
(define vertices
(list (make-vertex3d '(0 0 10) '(1 1 0) '(255 0 255 255) '(0 1))
(make-vertex3d '(10 0 -10) '(1 0 0) '(255 255 0 255) '(1 1))
(make-vertex3d '(-10 0 -10) '(0 0 1) '(255 0 255 0) '(0 0))))
(define material (make-material #:wireframe #f #:lighting #f))
-(aabbox3d-reset! box (vertex-position (car vertices)))
-(for-each (lambda (vertex)
- (aabbox3d-add-internal-point! box (vertex-position vertex)))
- (cdr vertices))
+(box3d-reset! box (vertex3d-position (car vertices)))
+(for-each
+ (lambda (vertex)
+ (aabbox3d-add-internal-point! box (vertex3d-position vertex)))
+ (cdr vertices))
(define (custom-render)
(let ((indices '((0 2 3) (2 1 3) (1 0 3) (2 0 1))))
- ;;(set-material! driver material)
- ;;(set-transform! driver 'world (get-absolute-transformation my-node))
- ;;(draw-vertex-primitive-list driver vertices indices)))
- #f))
+ (set-material! driver material)
+ (set-transform! driver 'world (get-absolute-transformation my-node))
+ (draw-vertex-primitive-list driver vertices indices)))
(define (custom-get-bounding-box)
box)
+++ /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 "aabbox3d.h"
-#include "wrapped.h"
-
-extern "C" {
-
- void
- init_aabbox3d (void)
- {
- init_aabbox3df_type ();
- init_aabbox3di_type ();
- scm_c_define_gsubr ("make-aabbox3df", 0, 0, 0, (scm_t_subr)make_aabbox3df);
- scm_c_define_gsubr ("make-aabbox3di", 0, 0, 0, (scm_t_subr)make_aabbox3di);
- scm_c_export ("make-aabbox3df", "make-aabbox3di", NULL);
- }
-
- DEFINE_WRAPPED_TYPE (irr::core::aabbox3df*, "aabbox3df",
- init_aabbox3df_type, aabbox3df_p,
- wrap_aabbox3df, unwrap_aabbox3df);
-
- DEFINE_WRAPPED_TYPE (irr::core::aabbox3di*, "aabbox3di",
- init_aabbox3di_type, aabbox3di_p,
- wrap_aabbox3di, unwrap_aabbox3di);
-
- SCM
- make_aabbox3df ()
- {
- irr::core::aabbox3df* box = new irr::core::aabbox3df ();
- return wrap_aabbox3df (box);
- }
-
- SCM
- make_aabbox3di ()
- {
- irr::core::aabbox3di* box = new irr::core::aabbox3di ();
- return wrap_aabbox3di (box);
- }
-
-}
+++ /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_AABBOX_3D_H_INCLUDED__
-#define __GUILE_IRRLICHT_AABBOX_3D_H_INCLUDED__
-
-#include <irrlicht/irrlicht.h>
-#include <libguile.h>
-#include "wrapped.h"
-
-extern "C" {
-
- void
- init_aabbox3d (void);
-
- DECLARE_WRAPPED_TYPE (irr::core::aabbox3df*, init_aabbox3df_type,
- aabbox3df_p, wrap_aabbox3df, unwrap_aabbox3df);
-
- DECLARE_WRAPPED_TYPE (irr::core::aabbox3di*, init_aabbox3di_type,
- aabbox3di_p, wrap_aabbox3di, unwrap_aabbox3di);
-
- SCM
- make_aabbox3df ();
-
- SCM
- make_aabbox3di ();
-
-}
-
-#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 "box3d.h"
+#include "vector3d.h"
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_box3d (void)
+ {
+ init_box3d_type ();
+ scm_c_define_gsubr ("box3d-reset!", 2, 0, 0, (scm_t_subr)box3d_reset);
+ scm_c_define_gsubr ("make-box3d", 0, 0, 0, (scm_t_subr)make_box3d);
+ scm_c_export ("box3d-reset!", "make-box3d", NULL);
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::core::aabbox3df*, "box3d",
+ init_box3d_type, box3d_p,
+ wrap_box3d, unwrap_box3d);
+
+ SCM
+ box3d_reset (SCM box3d,
+ SCM init_value)
+ {
+ irr::core::aabbox3df* aabbox = unwrap_box3d (box3d);
+ aabbox->reset (scm_to_vector3df (init_value));
+ return SCM_UNSPECIFIED;
+ }
+
+ SCM
+ make_box3d ()
+ {
+ irr::core::aabbox3df* aabbox = new irr::core::aabbox3df ();
+ return wrap_box3d (aabbox);
+ }
+
+}
--- /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_AABBOX_3D_H_INCLUDED__
+#define __GUILE_IRRLICHT_AABBOX_3D_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_box3d (void);
+
+ DECLARE_WRAPPED_TYPE (irr::core::aabbox3df*, init_box3d_type,
+ box3d_p, wrap_box3d, unwrap_box3d);
+
+ SCM
+ box3d_reset (SCM box3d,
+ SCM init_value);
+
+ SCM
+ make_box3d ();
+
+}
+
+#endif
#include <libguile.h>
-#include "aabbox3d.h"
#include "animated-mesh.h"
#include "animated-mesh-scene-node.h"
+#include "box3d.h"
#include "camera-scene-node.h"
#include "cursor-control.h"
#include "device.h"
void
init_guile_irrlicht (void)
{
- init_vertex3d ();
- init_aabbox3d ();
init_animated_mesh ();
init_animated_mesh_scene_node ();
+ init_box3d ();
init_camera_scene_node ();
init_cursor_control ();
init_device ();
init_scene_manager ();
init_scene_node ();
init_texture ();
+ init_vertex3d ();
init_video_driver ();
}
extern "C" {
+ SCM
+ scm_from_vector3df (irr::core::vector3df vector3d)
+ {
+ return scm_list_3 (scm_from_double (vector3d.X),
+ scm_from_double (vector3d.Y),
+ scm_from_double (vector3d.Z));
+ }
+
irr::core::vector3df
scm_to_vector3df (SCM vector3d)
{
extern "C" {
+ SCM
+ scm_from_vector3df (irr::core::vector3df vector3d);
+
irr::core::vector3df
scm_to_vector3df (SCM vector3d);
{
init_vertex3d_type ();
scm_c_define_gsubr ("make-vertex3d", 4, 0, 0, (scm_t_subr)make_vertex3d);
- scm_c_export ("make-vertex3d", NULL);
+ scm_c_define_gsubr ("vertex3d-position", 1, 0, 0, (scm_t_subr)vertex3d_position);
+ scm_c_export ("make-vertex3d", "vertex3d-position", NULL);
}
DEFINE_WRAPPED_TYPE (irr::video::S3DVertex*, "vertex3d",
return wrap_vertex3d (vertex);
}
+ SCM
+ vertex3d_position (SCM vertex) {
+ irr::video::S3DVertex* s3dvertex = unwrap_vertex3d (vertex);
+ return scm_from_vector3df (s3dvertex->Pos);
+ }
+
}
SCM color,
SCM tcoords);
+ SCM
+ vertex3d_position (SCM vertex);
+
}
#endif