From e6792f323493078dceac0566f5d27786fc76225d Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 14 May 2020 14:12:11 +0200 Subject: [PATCH] add-octree-scene-node! --- irrlicht.scm | 1 + irrlicht/scene.scm | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/irrlicht.scm b/irrlicht.scm index c1e52c2..6508537 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -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 diff --git a/irrlicht/scene.scm b/irrlicht/scene.scm index d268dea..6a6486f 100644 --- a/irrlicht/scene.scm +++ b/irrlicht/scene.scm @@ -85,6 +85,34 @@ id make-active)))) +(define-method (add-octree-scene-node! (scene-manager ) + (mesh ) + . rest) + (let-keywords rest #f + ((parent (make )) + (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 + #: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 ) + (mesh ) + . rest) + (let-keywords rest #f + ((parent (make )) + (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 + #:irr-pointer + (addOctreeSceneNode scene-manager mesh parent id minimal-polys-per-node + also-add-if-mesh-pointer-zero))))) + (define-method (draw-all (scene-manager )) ((get-irrlicht-proc "drawAll" scene-manager) scene-manager)) @@ -96,7 +124,8 @@ scene-manager filename))) -(export add-animated-mesh-scene-node! add-camera-scene-node! draw-all get-mesh) +(export add-animated-mesh-scene-node! add-camera-scene-node! add-octree-scene-node! + draw-all get-mesh) ;; ISceneNode @@ -135,3 +164,10 @@ (irr-class #:init-value "ICameraSceneNode")) (export ) + + +;; IMeshSceneNode +(define-class () + (irr-class #:init-value "IMeshSceneNode")) + +(export ) -- 2.39.5