]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
box3d-add-internal-point!
authorJavier Sancho <jsf@jsancho.org>
Fri, 27 Mar 2020 08:53:14 +0000 (09:53 +0100)
committerJavier Sancho <jsf@jsancho.org>
Fri, 27 Mar 2020 08:53:14 +0000 (09:53 +0100)
examples/03.CustomSceneNode.scm
src/box3d.cpp
src/box3d.h

index 11869fbfcae554f6aebf2c20625b17d4af312157..f5c9161e373ef047ec760c643030c48992ec3812 100644 (file)
@@ -78,7 +78,7 @@
 (box3d-reset! box (vertex3d-position (car vertices)))
 (for-each
  (lambda (vertex)
-   (aabbox3d-add-internal-point! box (vertex3d-position vertex)))
+   (box3d-add-internal-point! box (vertex3d-position vertex)))
  (cdr vertices))
 
 (define (custom-render)
index ee5c65bd312dbbe5b662b1695345a64909db61ef..7185c0b3c072c707e2caef882922a5177b4812c0 100644 (file)
@@ -31,15 +31,25 @@ extern "C" {
   init_box3d (void)
   {
     init_box3d_type ();
+    scm_c_define_gsubr ("box3d-add-internal-point!", 2, 0, 0, (scm_t_subr)box3d_add_internal_point);
     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);
+    scm_c_export ("box3d-add-internal-point!", "box3d-reset!", "make-box3d", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::core::aabbox3df*, "box3d",
                        init_box3d_type, box3d_p,
                        wrap_box3d, unwrap_box3d);
 
+  SCM
+  box3d_add_internal_point (SCM box3d,
+                            SCM point)
+  {
+    irr::core::aabbox3df* aabbox = unwrap_box3d (box3d);
+    aabbox->addInternalPoint (scm_to_vector3df (point));
+    return SCM_UNSPECIFIED;
+  }
+
   SCM
   box3d_reset (SCM box3d,
                SCM init_value)
index 8ed47f57bd3a09504322aa39a879c44ebcd8d54b..689dded4dcb493b213fc7173491c49562630771f 100644 (file)
@@ -34,6 +34,10 @@ extern "C" {
   DECLARE_WRAPPED_TYPE (irr::core::aabbox3df*, init_box3d_type,
                         box3d_p, wrap_box3d, unwrap_box3d);
 
+  SCM
+  box3d_add_internal_point (SCM box3d,
+                            SCM point);
+
   SCM
   box3d_reset (SCM box3d,
                SCM init_value);