Skip to content

Commit

Permalink
store fat value to pslot (euslisp#234 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Jul 20, 2015
1 parent bde2fee commit 247f45f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions irteus/pqp.l
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
(let ((m (pqpmakemodel))
vs v1 v2 v3 (id 0))
(setf (get self :pqpmodel) m)
(setf (get self :pqpmodel-fat) fat)
(pqpbeginmodel m)
(dolist (f fs)
(dolist (poly (face-to-triangle-aux f))
Expand All @@ -58,20 +59,24 @@
&optional (flag PQP_FIRST_CONTACT) &key (fat 0) (fat2 nil))
(let ((m1 (get model1 :pqpmodel))
(m2 (get model2 :pqpmodel))
(f1 (get model2 :pqpmodel-fat))
(f2 (get model2 :pqpmodel-fat))
(r1 (send model1 :worldrot))
(t1 (send model1 :worldpos))
(r2 (send model2 :worldrot))
(t2 (send model2 :worldpos)))
(if (null fat2) (setq fat2 fat))
(if (null m1) (setq m1 (send model1 :make-pqpmodel :fat fat)))
(if (null m2) (setq m2 (send model2 :make-pqpmodel :fat fat2)))
(if (and (null m1) (not (eps= fat f1))) (setq m1 (send model1 :make-pqpmodel :fat fat)))
(if (and (null m2) (not (eps= fat2 f2))) (setq m2 (send model2 :make-pqpmodel :fat fat2)))
(pqpcollide r1 t1 m1 r2 t2 m2 flag)
))

(defun pqp-collision-distance (model1 model2
&key (fat 0) (fat2 nil) (qsize 2))
(let ((m1 (get model1 :pqpmodel))
(m2 (get model2 :pqpmodel))
(f1 (get model2 :pqpmodel-fat))
(f2 (get model2 :pqpmodel-fat))
(r1 (send model1 :worldrot))
(t1 (send model1 :worldpos))
(r2 (send model2 :worldrot))
Expand All @@ -80,8 +85,8 @@
(p2 (float-vector 0 0 0))
r)
(if (null fat2) (setq fat2 fat))
(if (null m1) (setq m1 (send model1 :make-pqpmodel :fat fat)))
(if (null m2) (setq m2 (send model2 :make-pqpmodel :fat fat2)))
(if (and (null m1) (not (eps= fat f1))) (setq m1 (send model1 :make-pqpmodel :fat fat)))
(if (and (null m2) (not (eps= fat2 f2))) (setq m2 (send model2 :make-pqpmodel :fat fat2)))
(setq r (pqpdistance r1 t1 m1 r2 t2 m2 p1 p2 qsize))
(list r p1 p2)
))
Expand Down

0 comments on commit 247f45f

Please sign in to comment.