From: Javier Sancho Date: Tue, 4 Feb 2020 08:52:14 +0000 (+0100) Subject: animators X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=8ab48666239b37a357944d2928a31aaf37578892;p=guile-irrlicht.git animators --- diff --git a/irrlicht/bindings/scene.scm b/irrlicht/bindings/scene.scm index 74b1535..9c7eb64 100644 --- a/irrlicht/bindings/scene.scm +++ b/irrlicht/bindings/scene.scm @@ -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 '*)) diff --git a/irrlicht/scene.scm b/irrlicht/scene.scm index 7e9b8d2..cd8e4d4 100644 --- a/irrlicht/scene.scm +++ b/irrlicht/scene.scm @@ -26,10 +26,12 @@ #: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) @@ -141,6 +146,12 @@ 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)))