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

index c1e52c2c50d04f3a7f257e740e18758eb5f5eea2..65085372eee5cdc300a2bac66e270ffac9336886 100644 (file)
@@ -31,6 +31,7 @@
   #:re-export (add-animated-mesh-scene-node!
                add-camera-scene-node!
                add-file-archive!
+               add-octree-scene-node!
                add-static-text!
                begin-scene
                create-device
index d268dea8a583492e5f8fddafb7478c3a0b9a061a..6a6486fe8565f8bf5ecdce34723df012112211a3 100644 (file)
        id
        make-active))))
 
+(define-method (add-octree-scene-node! (scene-manager <scene-manager>)
+                                       (mesh <animated-mesh>)
+                                       . rest)
+  (let-keywords rest #f
+        ((parent (make <scene-node>))
+         (id -1)
+         (minimal-polys-per-node 512)
+         (also-add-if-mesh-pointer-zero #f))
+    (let ((addOctreeSceneNode (get-irrlicht-proc "addOctreeSceneNode" scene-manager parent mesh)))
+      (make <mesh-scene-node>
+        #:irr-pointer
+        (addOctreeSceneNode scene-manager mesh parent id minimal-polys-per-node
+                            also-add-if-mesh-pointer-zero)))))
+
+(define-method (add-octree-scene-node! (scene-manager <scene-manager>)
+                                       (mesh <mesh>)
+                                       . rest)
+  (let-keywords rest #f
+        ((parent (make <scene-node>))
+         (id -1)
+         (minimal-polys-per-node 256)
+         (also-add-if-mesh-pointer-zero #f))
+    (let ((addOctreeSceneNode (get-irrlicht-proc "addOctreeSceneNode" scene-manager parent mesh)))
+      (make <mesh-scene-node>
+        #:irr-pointer
+        (addOctreeSceneNode scene-manager mesh parent id minimal-polys-per-node
+                            also-add-if-mesh-pointer-zero)))))
+
 (define-method (draw-all (scene-manager <scene-manager>))
   ((get-irrlicht-proc "drawAll" scene-manager)
    scene-manager))
      scene-manager
      filename)))
 
-(export <scene-manager> add-animated-mesh-scene-node! add-camera-scene-node! draw-all get-mesh)
+(export <scene-manager> add-animated-mesh-scene-node! add-camera-scene-node! add-octree-scene-node!
+        draw-all get-mesh)
 
 
 ;; ISceneNode
   (irr-class #:init-value "ICameraSceneNode"))
 
 (export <camera-scene-node>)
+
+
+;; IMeshSceneNode
+(define-class <mesh-scene-node> (<scene-node>)
+  (irr-class #:init-value "IMeshSceneNode"))
+
+(export <mesh-scene-node>)