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

index 60a4f354230a9da4b3a74bd157ca825be2e535e0..9421ef6c0b32ca9931da68d61a579d1f7e8717da 100644 (file)
@@ -25,6 +25,7 @@
   #:use-module (irrlicht scene)
   #:use-module (irrlicht video)
   #:re-export (add-animated-mesh-scene-node!
+               add-camera-scene-node!
                add-static-text!
                create-device
                get-gui-environment
index 3ca632656c3f37682b2a9c86e071820d334e5013..c1fac94bea43aa1d63b0f6737d25a77d0af56a3d 100644 (file)
@@ -46,7 +46,9 @@
 (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)
+(define-method (add-animated-mesh-scene-node! (scene-manager <scene-manager>)
+                                              (mesh <animated-mesh>)
+                                              . rest)
   (let-keywords rest #f
         ((parent (make <scene-node>))
          (id -1)
        scale
        also-add-if-mesh-pointer-zero))))
 
+(define-method (add-camera-scene-node! (scene-manager <scene-manager>) . rest)
+  (let-keywords rest #f
+        ((parent (make <scene-node>))
+         (position '(0 0 0))
+         (lookat '(0 0 100))
+         (id -1)
+         (make-active #t))
+    (make <camera-scene-node>
+      #:irr-pointer
+      ((get-irrlicht-proc "addCameraSceneNode" scene-manager parent)
+       (irr-pointer scene-manager)
+       (irr-pointer parent)
+       position
+       lookat
+       id
+       make-active))))
+
 (define-method (get-mesh (scene-manager <scene-manager>) filename)
   (make <animated-mesh>
     #:irr-pointer
@@ -73,7 +92,7 @@
      (irr-pointer scene-manager)
      filename)))
 
-(export <scene-manager> add-animated-mesh-scene-node! get-mesh)
+(export <scene-manager> add-animated-mesh-scene-node! add-camera-scene-node! get-mesh)
 
 
 ;; ISceneNode
 (export <scene-node> set-material-flag! set-material-texture!)
 
 
-;; ISceneNode
+;; IAnimatedMeshSceneNode
 (define-class <animated-mesh-scene-node> (<scene-node>)
   (irr-class #:init-value "IAnimatedMeshSceneNode" #:getter irr-class))
 
    anim))
 
 (export <animated-mesh-scene-node> set-md2-animation!)
+
+
+;; ICameraSceneNode
+(define-class <camera-scene-node> (<scene-node>)
+  (irr-class #:init-value "ICameraSceneNode" #:getter irr-class))
+
+(export <camera-scene-node>)