From a2e97bd95bf8f5c565819a3032d490c7451fc335 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 28 Mar 2020 13:26:47 +0100 Subject: [PATCH] get-root-scene-node --- examples/03.CustomSceneNode.scm | 2 +- src/scene-manager.cpp | 11 ++++++++++- src/scene-manager.h | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/03.CustomSceneNode.scm b/examples/03.CustomSceneNode.scm index f5c9161..3c35e7c 100644 --- a/examples/03.CustomSceneNode.scm +++ b/examples/03.CustomSceneNode.scm @@ -111,7 +111,7 @@ (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)) diff --git a/src/scene-manager.cpp b/src/scene-manager.cpp index ed2ab68..da5425a 100644 --- a/src/scene-manager.cpp +++ b/src/scene-manager.cpp @@ -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) { diff --git a/src/scene-manager.h b/src/scene-manager.h index 44e4145..b4a099d 100644 --- a/src/scene-manager.h +++ b/src/scene-manager.h @@ -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); -- 2.39.5