Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 247f45f

Browse files
committedJul 20, 2015
store fat value to pslot (euslisp#234 (comment))
1 parent bde2fee commit 247f45f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
 

‎irteus/pqp.l

+9-4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
(let ((m (pqpmakemodel))
3636
vs v1 v2 v3 (id 0))
3737
(setf (get self :pqpmodel) m)
38+
(setf (get self :pqpmodel-fat) fat)
3839
(pqpbeginmodel m)
3940
(dolist (f fs)
4041
(dolist (poly (face-to-triangle-aux f))
@@ -58,20 +59,24 @@
5859
&optional (flag PQP_FIRST_CONTACT) &key (fat 0) (fat2 nil))
5960
(let ((m1 (get model1 :pqpmodel))
6061
(m2 (get model2 :pqpmodel))
62+
(f1 (get model2 :pqpmodel-fat))
63+
(f2 (get model2 :pqpmodel-fat))
6164
(r1 (send model1 :worldrot))
6265
(t1 (send model1 :worldpos))
6366
(r2 (send model2 :worldrot))
6467
(t2 (send model2 :worldpos)))
6568
(if (null fat2) (setq fat2 fat))
66-
(if (null m1) (setq m1 (send model1 :make-pqpmodel :fat fat)))
67-
(if (null m2) (setq m2 (send model2 :make-pqpmodel :fat fat2)))
69+
(if (and (null m1) (not (eps= fat f1))) (setq m1 (send model1 :make-pqpmodel :fat fat)))
70+
(if (and (null m2) (not (eps= fat2 f2))) (setq m2 (send model2 :make-pqpmodel :fat fat2)))
6871
(pqpcollide r1 t1 m1 r2 t2 m2 flag)
6972
))
7073

7174
(defun pqp-collision-distance (model1 model2
7275
&key (fat 0) (fat2 nil) (qsize 2))
7376
(let ((m1 (get model1 :pqpmodel))
7477
(m2 (get model2 :pqpmodel))
78+
(f1 (get model2 :pqpmodel-fat))
79+
(f2 (get model2 :pqpmodel-fat))
7580
(r1 (send model1 :worldrot))
7681
(t1 (send model1 :worldpos))
7782
(r2 (send model2 :worldrot))
@@ -80,8 +85,8 @@
8085
(p2 (float-vector 0 0 0))
8186
r)
8287
(if (null fat2) (setq fat2 fat))
83-
(if (null m1) (setq m1 (send model1 :make-pqpmodel :fat fat)))
84-
(if (null m2) (setq m2 (send model2 :make-pqpmodel :fat fat2)))
88+
(if (and (null m1) (not (eps= fat f1))) (setq m1 (send model1 :make-pqpmodel :fat fat)))
89+
(if (and (null m2) (not (eps= fat2 f2))) (setq m2 (send model2 :make-pqpmodel :fat fat2)))
8590
(setq r (pqpdistance r1 t1 m1 r2 t2 m2 p1 p2 qsize))
8691
(list r p1 p2)
8792
))

0 commit comments

Comments
 (0)
Please sign in to comment.