Skip to content

Commit

Permalink
make qpqmodel with glvertices
Browse files Browse the repository at this point in the history
  • Loading branch information
YoheiKakiuchi committed Sep 18, 2015
1 parent 3ad5a16 commit 471b9c6
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions euscollada/src/euscollada-robot.l
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,28 @@
(:make-collision-model-for-links
(&key (fat 0) (collision-func 'pqp-collision-check) ((:links ls) (send self :links)))
(dolist (ll ls)
(send ll
(read-from-string
(format nil ":make-~Amodel"
(string-right-trim "-COLLISION-CHECK" (string collision-func))))
:fat fat
:faces (flatten (mapcar #'(lambda (x)
(cond
((find-method x :def-gl-vertices)
(send x :glvertices :convert-to-faces :wrt :world))
(t
(send x :faces))))
(send ll :bodies)))))
(let (fs glv usefs)
(dolist (bd (send ll :bodies))
(if (find-method bd :def-gl-vertices)
(push (send bd :glvertices) glv)
(push (send bd :faces) fs)))
(setq fs (flatten fs))
(cond
((and (not fs) glv) ;; if there is no faces, use glvertices for creating pqpmodel
(setq usefs (instance gl::glvertices :init nil))
(send usefs :transform (send (car glv) :worldcoords))
(send usefs :append-glvertices glv))
(fs
(setq usefs
(append fs
(mapcar #'(lambda (gv) (send gv :convert-to-faces :wrt :world)) glv)))))
(send ll
(read-from-string
(format nil ":make-~Amodel"
(string-right-trim "-COLLISION-CHECK" (string collision-func))))
:fat fat
:faces usefs)
))
)
)

Expand Down

0 comments on commit 471b9c6

Please sign in to comment.