]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
set-animation-speed!
authorJavier Sancho <jsf@jsancho.org>
Fri, 22 May 2020 06:40:56 +0000 (08:40 +0200)
committerJavier Sancho <jsf@jsancho.org>
Fri, 22 May 2020 06:40:56 +0000 (08:40 +0200)
irrlicht.scm
irrlicht/scene.scm
src/animated-mesh-scene-node.cpp

index 22f5a6032dcaf5ea6500ee96e6e9c02fa622e3f7..75e03f78bb296bf6a3824adce91b9cd20e8ab065 100644 (file)
@@ -95,6 +95,7 @@
                make-vertex3d
                reset-box3d!
                run
+               set-animation-speed!
                set-frame-loop!
                set-material!
                set-material-flag!
index a20b78c0ef564d5bebc33183ef64d1bb5038c29f..34853d3967db097b13be70c33d70b4ae9105bbac 100644 (file)
 (define-class <animated-mesh-scene-node> (<scene-node>)
   (irr-class #:init-value "IAnimatedMeshSceneNode"))
 
+(define-method (set-animation-speed! (node <animated-mesh-scene-node>) frames-per-second)
+  (let ((setAnimationSpeed (get-irrlicht-proc "setAnimationSpeed" node)))
+    (setAnimationSpeed node frames-per-second)))
+
 (define-method (set-frame-loop! (node <animated-mesh-scene-node>) begin end)
   (let ((setFrameLoop (get-irrlicht-proc "setFrameLoop" node)))
     (setFrameLoop node begin end)))
    node
    anim))
 
-(export <animated-mesh-scene-node> set-frame-loop! set-md2-animation!)
+(export <animated-mesh-scene-node> set-animation-speed! set-frame-loop! set-md2-animation!)
 
 
 ;; ICameraSceneNode
index 040b7cdba9f2bac04ce5549590af005049e6e22e..e63541bcfd2692ebb9a260d02150abebd7a0a2fb 100644 (file)
 
 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,