]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
add-sphere-scene-node!
authorJavier Sancho <jsf@jsancho.org>
Fri, 22 May 2020 06:06:33 +0000 (08:06 +0200)
committerJavier Sancho <jsf@jsancho.org>
Fri, 22 May 2020 06:06:33 +0000 (08:06 +0200)
irrlicht.scm
irrlicht/scene.scm

index 73ab60d3c505fd098b65b9301350f14dd8a6b820..079268ae12599f89eb91899a62e49c65931faea7 100644 (file)
@@ -64,6 +64,7 @@
                add-file-archive!
                add-internal-point!
                add-octree-scene-node!
                add-file-archive!
                add-internal-point!
                add-octree-scene-node!
+               add-sphere-scene-node!
                add-static-text!
                begin-scene
                create-device
                add-static-text!
                begin-scene
                create-device
index 0ac44842f5fff33f744506b1f4864839dc22426d..25352005aed785664215afa9ed9687cb41bf2a32 100644 (file)
       (addOctreeSceneNode scene-manager mesh parent id minimal-polys-per-node
                           also-add-if-mesh-pointer-zero))))
 
       (addOctreeSceneNode scene-manager mesh parent id minimal-polys-per-node
                           also-add-if-mesh-pointer-zero))))
 
+(define-method (add-sphere-scene-node! (scene-manager <scene-manager>) . rest)
+  (let-keywords rest #f
+        ((radius 5)
+         (poly-count 16)
+         (parent (make <scene-node>))
+         (id -1)
+         (position '(0 0 0))
+         (rotation '(0 0 0))
+         (scale '(1 1 1)))
+    (let ((addSphereSceneNode (get-irrlicht-proc "addSphereSceneNode" scene-manager parent)))
+      (addSphereSceneNode scene-manager radius poly-count parent id position rotation scale))))
+
 (define-method (create-rotation-animator (scene-manager <scene-manager>) rotation-speed)
   (let ((createRotationAnimator (get-irrlicht-proc "createRotationAnimator" scene-manager)))
     (createRotationAnimator scene-manager rotation-speed)))
 (define-method (create-rotation-animator (scene-manager <scene-manager>) rotation-speed)
   (let ((createRotationAnimator (get-irrlicht-proc "createRotationAnimator" scene-manager)))
     (createRotationAnimator scene-manager rotation-speed)))
 
 (export <scene-manager> add-animated-mesh-scene-node! add-camera-scene-node!
         add-camera-scene-node-fps! add-custom-scene-node! add-octree-scene-node!
 
 (export <scene-manager> add-animated-mesh-scene-node! add-camera-scene-node!
         add-camera-scene-node-fps! add-custom-scene-node! add-octree-scene-node!
-        create-rotation-animator draw-all get-root-scene-node get-mesh)
+        add-sphere-scene-node! create-rotation-animator draw-all get-root-scene-node get-mesh)
 
 
 ;; ISceneNode
 
 
 ;; ISceneNode