]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
add-animator!
authorJavier Sancho <jsf@jsancho.org>
Sun, 29 Mar 2020 18:40:25 +0000 (20:40 +0200)
committerJavier Sancho <jsf@jsancho.org>
Sun, 29 Mar 2020 18:40:25 +0000 (20:40 +0200)
examples/03.CustomSceneNode.scm
src/scene-node.cpp
src/scene-node.h

index 3c35e7c1dc1ff3d3a8420d51440ec1cab2cd3ba5..ee1c67e05791d87bba1ae33bc0a2c60f62e0f0a6 100644 (file)
 
 ;; loop
 (define frames 0)
-(while (device-run? device)
+(while (run device)
   (begin-scene driver #:color '(0 100 100 100))
   (draw-all scene-manager)
   (end-scene driver)
     (set! frames 0)))
 
 ;; delete device
-(device-drop! device)
+(drop! device)
 (exit #t)
index d7b5e3651333f5ecd1e08cec54e4028411b38541..c92c2d5dcf45d62ea4d872fc57c80ef78fd2aac3 100644 (file)
@@ -25,6 +25,7 @@
 #include "animated-mesh-scene-node.h"
 #include "mesh-scene-node.h"
 #include "scene-node.h"
+#include "scene-node-animator.h"
 #include "texture.h"
 #include "vector3d.h"
 #include "wrapped.h"
@@ -35,14 +36,24 @@ extern "C" {
   init_scene_node (void)
   {
     init_scene_node_type ();
+    scm_c_define_gsubr ("add-animator!", 2, 0, 0, (scm_t_subr)irr_scene_addAnimator);
     scm_c_define_gsubr ("set-material-texture!", 3, 0, 0, (scm_t_subr)irr_scene_setMaterialTexture);
-    scm_c_export ("set-material-texture!", NULL);
+    scm_c_export ("add-animator!", "set-material-texture!", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::scene::ISceneNode*, "scene-node",
                        init_scene_node_type, scene_node_p,
                        wrap_scene_node, unwrap_scene_node);
 
+  SCM
+  irr_scene_addAnimator (SCM wrapped_scene_node,
+                         SCM animator)
+  {
+    irr::scene::ISceneNode* node = unwrap_scene_node (wrapped_scene_node);
+    node->addAnimator (unwrap_scene_node_animator (animator));
+    return SCM_UNSPECIFIED;
+  }
+
   SCM
   irr_scene_setMaterialTexture (SCM wrapped_scene_node,
                                 SCM texture_layer,
index afb69738ad112c41fa9173a88af1a1685ae0a136..4aab1e171f15e00f42988701f6829309a078ca06 100644 (file)
@@ -34,6 +34,10 @@ extern "C" {
   DECLARE_WRAPPED_TYPE (irr::scene::ISceneNode*, init_scene_node_type,
                         scene_node_p, wrap_scene_node, unwrap_scene_node);
 
+  SCM
+  irr_scene_addAnimator (SCM wrapped_scene_node,
+                         SCM animator);
+
   SCM
   irr_scene_setMaterialTexture (SCM wrapped_scene_node,
                                 SCM texture_layer,