From 061e994acc2fe7806d3911a715993c442e56f7ef Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 16 May 2020 08:45:21 +0200 Subject: [PATCH] get-position add-internal-point! --- examples/03-custom-scene-node.scm | 4 ++-- irrlicht.scm | 2 ++ irrlicht/core.scm | 6 +++++- irrlicht/video.scm | 6 +++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/examples/03-custom-scene-node.scm b/examples/03-custom-scene-node.scm index 0476e72..e84f36a 100644 --- a/examples/03-custom-scene-node.scm +++ b/examples/03-custom-scene-node.scm @@ -75,10 +75,10 @@ (make-vertex3d '(-10 0 -10) '(0 0 1) '(255 0 255 0) '(0 0)))) (define material (make-material #:wireframe #f #:lighting #f)) -(reset-box3d! box (vertex3d-position (car vertices))) +(reset-box3d! box (get-position (car vertices))) (for-each (lambda (vertex) - (box3d-add-internal-point! box (vertex3d-position vertex))) + (add-internal-point! box (get-position vertex))) (cdr vertices)) (define (custom-render) diff --git a/irrlicht.scm b/irrlicht.scm index d68ec1b..87e029c 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -33,6 +33,7 @@ add-camera-scene-node! add-camera-scene-node-fps! add-file-archive! + add-internal-point! add-octree-scene-node! add-static-text! begin-scene @@ -45,6 +46,7 @@ get-gui-environment get-mesh get-name + get-position get-scene-manager get-texture get-video-driver diff --git a/irrlicht/core.scm b/irrlicht/core.scm index 7d97476..2b71472 100644 --- a/irrlicht/core.scm +++ b/irrlicht/core.scm @@ -28,6 +28,10 @@ (define-class () (irr-class #:init-value "aabbox3d")) +(define-method (add-internal-point! (box3d ) point) + (let ((addInternalPoint (get-irrlicht-proc "aabbox3d_addInternalPoint"))) + (addInternalPoint box3d point))) + (define (make-box3d) (let ((aabbox3d_make (get-irrlicht-proc "aabbox3d_make"))) (make #:irr-pointer (aabbox3d_make)))) @@ -36,4 +40,4 @@ (let ((reset (get-irrlicht-proc "aabbox3d_reset"))) (reset box3d init-value))) -(export make-box3d reset-box3d!) +(export add-internal-point! make-box3d reset-box3d!) diff --git a/irrlicht/video.scm b/irrlicht/video.scm index 9acfa18..c6531f0 100644 --- a/irrlicht/video.scm +++ b/irrlicht/video.scm @@ -77,13 +77,17 @@ (define-class () (irr-class #:init-value "S3DVertex")) +(define-method (get-position (vertex3d )) + (let ((S3DVertex_Pos (get-irrlicht-proc "S3DVertex_Pos"))) + (S3DVertex_Pos vertex3d))) + (define (make-vertex3d position normal color tcoords) (let ((S3DVertex_make (get-irrlicht-proc "S3DVertex_make"))) (make #:irr-pointer (S3DVertex_make position normal color tcoords)))) -(export make-vertex3d) +(export get-position make-vertex3d) ;; SMaterial -- 2.39.5