|
35 | 35 | (let ((m (pqpmakemodel))
|
36 | 36 | vs v1 v2 v3 (id 0))
|
37 | 37 | (setf (get self :pqpmodel) m)
|
| 38 | + (setf (get self :pqpmodel-fat) fat) |
38 | 39 | (pqpbeginmodel m)
|
39 | 40 | (dolist (f fs)
|
40 | 41 | (dolist (poly (face-to-triangle-aux f))
|
|
58 | 59 | &optional (flag PQP_FIRST_CONTACT) &key (fat 0) (fat2 nil))
|
59 | 60 | (let ((m1 (get model1 :pqpmodel))
|
60 | 61 | (m2 (get model2 :pqpmodel))
|
| 62 | + (f1 (get model2 :pqpmodel-fat)) |
| 63 | + (f2 (get model2 :pqpmodel-fat)) |
61 | 64 | (r1 (send model1 :worldrot))
|
62 | 65 | (t1 (send model1 :worldpos))
|
63 | 66 | (r2 (send model2 :worldrot))
|
64 | 67 | (t2 (send model2 :worldpos)))
|
65 | 68 | (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))) |
68 | 71 | (pqpcollide r1 t1 m1 r2 t2 m2 flag)
|
69 | 72 | ))
|
70 | 73 |
|
71 | 74 | (defun pqp-collision-distance (model1 model2
|
72 | 75 | &key (fat 0) (fat2 nil) (qsize 2))
|
73 | 76 | (let ((m1 (get model1 :pqpmodel))
|
74 | 77 | (m2 (get model2 :pqpmodel))
|
| 78 | + (f1 (get model2 :pqpmodel-fat)) |
| 79 | + (f2 (get model2 :pqpmodel-fat)) |
75 | 80 | (r1 (send model1 :worldrot))
|
76 | 81 | (t1 (send model1 :worldpos))
|
77 | 82 | (r2 (send model2 :worldrot))
|
|
80 | 85 | (p2 (float-vector 0 0 0))
|
81 | 86 | r)
|
82 | 87 | (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))) |
85 | 90 | (setq r (pqpdistance r1 t1 m1 r2 t2 m2 p1 p2 qsize))
|
86 | 91 | (list r p1 p2)
|
87 | 92 | ))
|
|
0 commit comments