]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
animators
authorJavier Sancho <jsf@jsancho.org>
Tue, 4 Feb 2020 08:52:14 +0000 (09:52 +0100)
committerJavier Sancho <jsf@jsancho.org>
Tue, 4 Feb 2020 08:52:14 +0000 (09:52 +0100)
irrlicht/bindings/scene.scm
irrlicht/scene.scm

index 74b1535a75cafa07001aa7a273d8dc3fe651f128..9c7eb64f2e96f742209fe3010fb1013d04d8cf1c 100644 (file)
@@ -50,6 +50,9 @@
 (define-foreign add-animated-mesh-scene-node
   '* "irr_scene_addAnimatedMeshSceneNode" (list '* '* '* int '* '* '* int))
 
+(define-foreign add-animator
+  void "irr_scene_addAnimator" (list '* '*))
+
 (define-foreign add-camera-scene-node
   '* "irr_scene_addCameraSceneNode" (list '* '* '* '* int int))
 
@@ -62,6 +65,9 @@
 (define-foreign add-octree-scene-node
   '* "irr_scene_addOctreeSceneNode" (list '* '* '* int int int))
 
+(define-foreign create-rotation-animator
+  '* "irr_scene_createRotationAnimator" (list '* '*))
+
 (define-foreign draw-all
   void "irr_scene_drawAll" (list '*))
 
index 7e9b8d23dddcc1cc7d22c2503600e5cb009d7e59..cd8e4d45a134c6c9df35c34ac4b41c9ab5e6e1bd 100644 (file)
   #:use-module ((irrlicht bindings video) #:prefix ffi-video:)
   #:use-module (irrlicht util)
   #:export (add-animated-mesh-scene-node
+            add-animator!
             add-camera-scene-node!
             add-camera-scene-node-fps!
             add-custom-scene-node!
             add-octree-scene-node
+            create-rotation-animator
             get-mesh
             get-root-scene-node
             scene-draw-all
@@ -57,6 +59,9 @@
                (bool->integer also-add-if-mesh-pointer-zero))))
     (if (null-pointer? node) #f node)))
 
+(define (add-animator! node animator)
+  (ffi-scene:add-animator node animator))
+
 (define* (add-camera-scene-node! scene-manager
                                  #:key
                                  (parent %null-pointer)
    minimal-polys-per-node
    (bool->integer also-add-if-mesh-pointer-zero)))
 
+(define (create-rotation-animator scene-manager rotation-speed)
+  (let ((animator (ffi-scene:create-rotation-animator
+                   scene-manager
+                   (ffi-core:vector3df->pointer rotation-speed))))
+    (if (null-pointer? animator) #f animator)))
+
 (define (get-mesh scene-manager filename)
   (let ((mesh (ffi-scene:get-mesh scene-manager (string->pointer filename))))
     (if (null-pointer? mesh) #f mesh)))