#:use-module (assimp low-level types)
#:use-module (assimp low-level vector)
#:use-module (system foreign)
+ #:export (ai-import-file
+ ai-release-import
+ ai-attach-predefined-log-stream
+ ai-transform-vec-by-matrix4
+ ai-multiply-matrix3
+ ai-multiply-matrix4
+ ai-identity-matrix3
+ ai-identity-matrix4
+ ai-transpose-matrix3
+ ai-transpose-matrix4)
#:re-export (ai-material-key
ai-process-steps
ai-process-convert-to-left-handed
ai-process-preset-target-realtime-fast
ai-process-preset-target-realtime-quality
- ai-process-preset-target-realtime-max-quality))
+ ai-process-preset-target-realtime-max-quality
+ ai-default-log-stream
+ (aiDetachAllLogStreams . ai-detach-all-log-streams)))
;;; Scenes
(name (sized-string (field 'mName)))
(primitive-types (field 'mPrimitiveTypes))
(vertices (wrap
- (array (field 'mNumVertices) (field 'mVertices) #:element-proc get-element-address)
+ (array (field 'mNumVertices) (field 'mVertices) #:element-size 12 #:element-proc get-element-address)
wrap-ai-vector3d))
(faces (wrap
(array (field 'mNumFaces) (field 'mFaces) #:element-size 8 #:element-proc get-element-address)
;;; Functions
-(define-public (ai-import-file filename flags)
+(define (ai-import-file filename flags)
(wrap-ai-scene
(aiImportFile (string->pointer filename)
flags)))
-(define-public (ai-transform-vec-by-matrix4 vec mat)
+(define (ai-release-import scene)
+ (aiReleaseImport (unwrap-ai-scene scene)))
+
+(define* (ai-attach-predefined-log-stream type #:optional file)
+ (aiAttachLogStream
+ (aiGetPredefinedLogStream
+ type
+ (if file
+ (string->pointer file)
+ %null-pointer))))
+
+(define (ai-transform-vec-by-matrix4 vec mat)
(let ((cvec (parse-aiVector3D (map cdr (ai-vector3d-contents vec)) #:reverse #t))
(cmat (parse-aiMatrix4x4 (map cdr (ai-matrix4x4-contents mat)) #:reverse #t)))
(aiTransformVecByMatrix4 cvec cmat)
(wrap-ai-vector3d cvec)))
-(define-public (ai-multiply-matrix3 m1 m2)
+(define (ai-multiply-matrix3 m1 m2)
(let ((cm1 (parse-aiMatrix3x3 (map cdr (ai-matrix3x3-contents m1)) #:reverse #t))
(cm2 (parse-aiMatrix3x3 (map cdr (ai-matrix3x3-contents m2)) #:reverse #t)))
(aiMultiplyMatrix3 cm1 cm2)
(wrap-ai-matrix3x3 cm1)))
-(define-public (ai-multiply-matrix4 m1 m2)
+(define (ai-multiply-matrix4 m1 m2)
(let ((cm1 (parse-aiMatrix4x4 (map cdr (ai-matrix4x4-contents m1)) #:reverse #t))
(cm2 (parse-aiMatrix4x4 (map cdr (ai-matrix4x4-contents m2)) #:reverse #t)))
(aiMultiplyMatrix4 cm1 cm2)
(wrap-ai-matrix4x4 cm1)))
-(define-public (ai-identity-matrix3)
+(define (ai-identity-matrix3)
(let ((cmat (parse-aiMatrix3x3 (make-list 9 0) #:reverse #t)))
(aiIdentityMatrix3 cmat)
(wrap-ai-matrix3x3 cmat)))
-(define-public (ai-identity-matrix4)
+(define (ai-identity-matrix4)
(let ((cmat (parse-aiMatrix4x4 (make-list 16 0) #:reverse #t)))
(aiIdentityMatrix4 cmat)
(wrap-ai-matrix4x4 cmat)))
-(define-public (ai-transpose-matrix3 mat)
+(define (ai-transpose-matrix3 mat)
(let ((cmat (parse-aiMatrix3x3 (map cdr (ai-matrix3x3-contents mat)) #:reverse #t)))
(aiTransposeMatrix3 cmat)
(wrap-ai-matrix3x3 cmat)))
-(define-public (ai-transpose-matrix4 mat)
+(define (ai-transpose-matrix4 mat)
(let ((cmat (parse-aiMatrix4x4 (map cdr (ai-matrix4x4-contents mat)) #:reverse #t)))
(aiTransposeMatrix4 cmat)
(wrap-ai-matrix4x4 cmat)))
#:use-module (assimp low-level)
#:use-module (system foreign)
#:export (aiImportFile
+ aiReleaseImport
+ aiGetPredefinedLogStream
+ aiAttachLogStream
+ aiDetachAllLogStreams
aiTransformVecByMatrix4
aiMultiplyMatrix3
aiMultiplyMatrix4
aiTransposeMatrix4))
(define-assimp-function (aiImportFile '* unsigned-int) -> '*)
+(define-assimp-function (aiReleaseImport '*) -> void)
+(define-assimp-function (aiGetPredefinedLogStream unsigned-int '*) -> (list '* '* '*))
+(define-assimp-function (aiAttachLogStream '*) -> void)
+(define-assimp-function (aiDetachAllLogStreams) -> void)
+
(define-assimp-function (aiTransformVecByMatrix4 '* '*) -> void)
(define-assimp-function (aiMultiplyMatrix3 '* '*) -> void)
(define-assimp-function (aiMultiplyMatrix4 '* '*) -> void)