]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - irrlicht/scene.scm
set-animation-speed!
[guile-irrlicht.git] / irrlicht / scene.scm
index 0ac44842f5fff33f744506b1f4864839dc22426d..34853d3967db097b13be70c33d70b4ae9105bbac 100644 (file)
                              #:jump-speed jump-speed #:invert-mouse invert-mouse
                              #:make-active make-active))))
 
+(define-method (add-cube-scene-node! (scene-manager <scene-manager>) . rest)
+  (let-keywords rest #f
+        ((size 10)
+         (parent (make <scene-node>))
+         (id -1)
+         (position '(0 0 0))
+         (rotation '(0 0 0))
+         (scale '(1 1 1)))
+    (let ((addCubeSceneNode (get-irrlicht-proc "addCubeSceneNode" scene-manager parent)))
+      (addCubeSceneNode scene-manager size parent id position rotation scale))))
+
 (define-method (add-custom-scene-node! (scene-manager <scene-manager>) proc-render
                                        proc-get-bounding-box  proc-get-material-count
                                        proc-get-material . rest)
       (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-fly-circle-animator (scene-manager <scene-manager>) . rest)
+  (let-keywords rest #f
+        ((center '(0 0 0))
+         (radius 100)
+         (speed 0.001)
+         (direction '(0 1 0))
+         (start-position 0)
+         (radius-ellipsoid 0))
+    (let ((createFlyCircleAnimator (get-irrlicht-proc "createFlyCircleAnimator" scene-manager)))
+      (createFlyCircleAnimator scene-manager center radius speed direction start-position
+                               radius-ellipsoid))))
+
+(define-method (create-fly-straight-animator (scene-manager <scene-manager>)
+                                             start-point end-point time-for-way . rest)
+  (let-keywords rest #f
+        ((loop #f)
+         (pingpong #f))
+    (let ((createFlyStraightAnimator (get-irrlicht-proc "createFlyStraightAnimator" scene-manager)))
+      (createFlyStraightAnimator scene-manager start-point end-point time-for-way
+                                 loop pingpong))))
+
 (define-method (create-rotation-animator (scene-manager <scene-manager>) rotation-speed)
   (let ((createRotationAnimator (get-irrlicht-proc "createRotationAnimator" scene-manager)))
     (createRotationAnimator scene-manager rotation-speed)))
   (let ((getRootSceneNode (get-irrlicht-proc "getRootSceneNode" scene-manager)))
     (getRootSceneNode scene-manager)))
 
-(export <scene-manager> add-animated-mesh-scene-node! add-camera-scene-node!
+(export <scene-manager> add-animated-mesh-scene-node! add-cube-scene-node! add-camera-scene-node!
         add-camera-scene-node-fps! add-custom-scene-node! add-octree-scene-node!
+        add-sphere-scene-node! create-fly-circle-animator create-fly-straight-animator
         create-rotation-animator draw-all get-root-scene-node get-mesh)
 
 
 (define-class <animated-mesh-scene-node> (<scene-node>)
   (irr-class #:init-value "IAnimatedMeshSceneNode"))
 
+(define-method (set-animation-speed! (node <animated-mesh-scene-node>) frames-per-second)
+  (let ((setAnimationSpeed (get-irrlicht-proc "setAnimationSpeed" node)))
+    (setAnimationSpeed node frames-per-second)))
+
+(define-method (set-frame-loop! (node <animated-mesh-scene-node>) begin end)
+  (let ((setFrameLoop (get-irrlicht-proc "setFrameLoop" node)))
+    (setFrameLoop node begin end)))
+
 (define-method (set-md2-animation! (node <animated-mesh-scene-node>) anim)
   ((get-irrlicht-proc "setMD2Animation" node)
    node
    anim))
 
-(export <animated-mesh-scene-node> set-md2-animation!)
+(export <animated-mesh-scene-node> set-animation-speed! set-frame-loop! set-md2-animation!)
 
 
 ;; ICameraSceneNode