]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
add-animated-mesh-scene-node!
authorJavier Sancho <jsf@jsancho.org>
Mon, 11 May 2020 06:52:16 +0000 (08:52 +0200)
committerJavier Sancho <jsf@jsancho.org>
Mon, 11 May 2020 06:52:16 +0000 (08:52 +0200)
irrlicht.scm
irrlicht/scene.scm

index 293049368eebe2fd6e0be9ccced514a4774084a8..dcb4de5bd907af80a465d628fbf661d00f4271cd 100644 (file)
@@ -23,7 +23,8 @@
   #:use-module (irrlicht device)
   #:use-module (irrlicht gui)
   #:use-module (irrlicht scene)
-  #:re-export (add-static-text!
+  #:re-export (add-animated-mesh-scene-node!
+               add-static-text!
                create-device
                get-gui-environment
                get-mesh
index 6f6d5e920b598eb076f08688405e93f6cb9d4a64..da0336b58d21edbef4e0912b2eb197e9ab70bbb1 100644 (file)
 
 (define-module (irrlicht scene)
   #:use-module (oop goops)
+  #:use-module (ice-9 optargs)
   #:use-module (irrlicht base)
   #:use-module (irrlicht foreign)
+  #:use-module (irrlicht io)
   #:use-module (irrlicht irr))
 
 
 (define-class <scene-manager> (<reference-counted>)
   (irr-class #:init-value "ISceneManager" #:getter irr-class))
 
+(define-method (add-animated-mesh-scene-node! (scene-manager <scene-manager>) mesh . rest)
+  (let-keywords rest #f
+        ((parent (make <scene-node>))
+         (id -1)
+         (position '(0 0 0))
+         (rotation '(0 0 0))
+         (scale '(1 1 1))
+         (also-add-if-mesh-pointer-zero #f))
+    (make <animated-mesh-scene-node>
+      #:irr-pointer
+      ((get-irrlicht-proc "addAnimatedMeshSceneNode" scene-manager parent)
+       (irr-pointer scene-manager)
+       (irr-pointer mesh)
+       (irr-pointer parent)
+       id
+       position
+       rotation
+       scale
+       also-add-if-mesh-pointer-zero))))
+
 (define-method (get-mesh (scene-manager <scene-manager>) filename)
   (make <animated-mesh>
     #:irr-pointer
      (irr-pointer scene-manager)
      filename)))
 
-(export <scene-manager> get-mesh)
+(export <scene-manager> add-animated-mesh-scene-node! get-mesh)
+
+
+;; ISceneNode
+(define-class <scene-node> (<attribute-exchanging-object>)
+  (irr-class #:init-value "ISceneNode" #:getter irr-class))
+
+(export <scene-node>)
+
+
+;; ISceneNode
+(define-class <animated-mesh-scene-node> (<scene-node>)
+  (irr-class #:init-value "IAnimatedMeshSceneNode" #:getter irr-class))
+
+(export <animated-mesh-scene-node>)