Fix color stream import from classimp

This commit is contained in:
Renaud Casenave-Péré 2015-08-28 15:05:54 +02:00
parent 7966bb14a1
commit 5daadb78b6
2 changed files with 7 additions and 4 deletions

View file

@ -31,6 +31,7 @@
(ecase type
(:unsigned-char 1)
(:unsigned-short 2)
(:unsigned-int 4)
(:float 4)))
(defun ctype-to-gltype (ctype)

View file

@ -75,10 +75,12 @@
(coerce (loop for i below (array-total-size (classimp:meshes ai-scene))
for mesh = (aref (classimp:meshes ai-scene) i)
collect (make-mesh
(remove nil (list (import-stream (classimp:vertices mesh)
:position)
(import-stream (classimp:colors mesh)
:color)))
(remove nil
(list (import-stream (classimp:vertices mesh)
:position)
(when (> (length (classimp:colors mesh)) 0)
(import-stream (aref (classimp:colors mesh) 0)
:color))))
(import-faces (classimp:faces mesh) (import-modes mesh))))
'vector)
:root-node (import-nodes (classimp:root-node ai-scene)))))