]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
get-root-scene-node
authorJavier Sancho <jsf@jsancho.org>
Sat, 28 Mar 2020 12:26:47 +0000 (13:26 +0100)
committerJavier Sancho <jsf@jsancho.org>
Sat, 28 Mar 2020 12:26:47 +0000 (13:26 +0100)
examples/03.CustomSceneNode.scm
src/scene-manager.cpp
src/scene-manager.h

index f5c9161e373ef047ec760c643030c48992ec3812..3c35e7c1dc1ff3d3a8420d51440ec1cab2cd3ba5 100644 (file)
 (define frames 0)
 (while (device-run? device)
   (begin-scene driver #:color '(0 100 100 100))
-  (scene-draw-all scene-manager)
+  (draw-all scene-manager)
   (end-scene driver)
 
   (set! frames (+ frames 1))
index ed2ab6871fc29cfeb38ece8ff86b51c27ba8c44e..da5425aba7ffb9ea6ea2bc76dedff95ca170324a 100644 (file)
@@ -53,10 +53,12 @@ extern "C" {
     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-root-scene-node", 1, 0, 0, (scm_t_subr)irr_scene_getRootSceneNode);
     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-camera-scene-node-fps!", "add-custom-scene-node!",
-                  "add-octree-scene-node!", "get-mesh", "get-scene-manager", NULL);
+                  "add-octree-scene-node!", "get-mesh", "get-root-scene-node",
+                  "get-scene-manager", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::scene::ISceneManager*, "scene-manager",
@@ -326,6 +328,13 @@ extern "C" {
     return wrap_animated_mesh (mesh);
   }
 
+  SCM
+  irr_scene_getRootSceneNode (SCM wrapped_scene_manager)
+  {
+    irr::scene::ISceneManager* smgr = unwrap_scene_manager (wrapped_scene_manager);
+    return wrap_scene_node (smgr->getRootSceneNode ());
+  }
+
   SCM
   irr_getSceneManager (SCM wrapped_obj)
   {
index 44e414511650d27b51806dabd0985e6d5a03b2fd..b4a099d885aeca1b0c041389078c7a686549869f 100644 (file)
@@ -64,6 +64,9 @@ extern "C" {
   irr_scene_getMesh (SCM wrapped_scene_manager,
                      SCM filename);
 
+  SCM
+  irr_scene_getRootSceneNode (SCM wrapped_scene_manager);
+
   SCM
   irr_getSceneManager (SCM wrapped_obj);