From: Javier Sancho Date: Fri, 22 May 2020 06:40:56 +0000 (+0200) Subject: set-animation-speed! X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=06d4163c5154f0fd2e934e197bb55d06e1a2b0fa;p=guile-irrlicht.git set-animation-speed! --- diff --git a/irrlicht.scm b/irrlicht.scm index 22f5a60..75e03f7 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -95,6 +95,7 @@ make-vertex3d reset-box3d! run + set-animation-speed! set-frame-loop! set-material! set-material-flag! diff --git a/irrlicht/scene.scm b/irrlicht/scene.scm index a20b78c..34853d3 100644 --- a/irrlicht/scene.scm +++ b/irrlicht/scene.scm @@ -247,6 +247,10 @@ (define-class () (irr-class #:init-value "IAnimatedMeshSceneNode")) +(define-method (set-animation-speed! (node ) frames-per-second) + (let ((setAnimationSpeed (get-irrlicht-proc "setAnimationSpeed" node))) + (setAnimationSpeed node frames-per-second))) + (define-method (set-frame-loop! (node ) begin end) (let ((setFrameLoop (get-irrlicht-proc "setFrameLoop" node))) (setFrameLoop node begin end))) @@ -256,7 +260,7 @@ node anim)) -(export set-frame-loop! set-md2-animation!) +(export set-animation-speed! set-frame-loop! set-md2-animation!) ;; ICameraSceneNode diff --git a/src/animated-mesh-scene-node.cpp b/src/animated-mesh-scene-node.cpp index 040b7cd..e63541b 100644 --- a/src/animated-mesh-scene-node.cpp +++ b/src/animated-mesh-scene-node.cpp @@ -28,6 +28,16 @@ using namespace irr; +SCM +IAnimatedMeshSceneNode_setAnimationSpeed (SCM animated_mesh_scene_node, + SCM frames_per_second) +{ + scene::IAnimatedMeshSceneNode* node = + (scene::IAnimatedMeshSceneNode*) scm_to_irr_pointer (animated_mesh_scene_node); + node->setAnimationSpeed (scm_to_double (frames_per_second)); + return SCM_UNSPECIFIED; +} + SCM IAnimatedMeshSceneNode_setFrameLoop (SCM animated_mesh_scene_node, SCM begin, @@ -51,6 +61,8 @@ IAnimatedMeshSceneNode_setMD2Animation (SCM animated_mesh_scene_node, void init_animated_mesh_scene_node (void) { + DEFINE_GSUBR ("IAnimatedMeshSceneNode_setAnimationSpeed", 2, 0, 0, + IAnimatedMeshSceneNode_setAnimationSpeed); DEFINE_GSUBR ("IAnimatedMeshSceneNode_setFrameLoop", 3, 0, 0, IAnimatedMeshSceneNode_setFrameLoop); DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMD2Animation", 2, 0, 0,