8
svtObjPen(&box, &cyl, stdout, "Pen 1", depth, &dir, &pos); \
9
ccdVec3Scale(&dir, depth); \
10
ccdVec3Add(&cyl.pos, &dir); \
11
svtObjPen(&box, &cyl, stdout, "Pen 1", depth, &dir, &pos)
29
ccd.support1 = ccdSupport;
30
ccd.support2 = ccdSupport;
32
ccdVec3Set(&cyl.pos, 0.1, 0., 0.);
33
res = ccdGJKIntersect(&box, &cyl, &ccd);
36
ccdVec3Set(&cyl.pos, .6, 0., 0.);
37
res = ccdGJKIntersect(&box, &cyl, &ccd);
40
ccdVec3Set(&cyl.pos, .6, 0.6, 0.);
41
res = ccdGJKIntersect(&box, &cyl, &ccd);
44
ccdVec3Set(&cyl.pos, .6, 0.6, 0.5);
45
res = ccdGJKIntersect(&box, &cyl, &ccd);
48
ccdVec3Set(&axis, 0., 1., 0.);
49
ccdQuatSetAngleAxis(&cyl.quat, M_PI / 3., &axis);
50
ccdVec3Set(&cyl.pos, .6, 0.6, 0.5);
51
res = ccdGJKIntersect(&box, &cyl, &ccd);
54
ccdVec3Set(&axis, 0.67, 1.1, 0.12);
55
ccdQuatSetAngleAxis(&cyl.quat, M_PI / 4., &axis);
56
ccdVec3Set(&cyl.pos, .6, 0., 0.5);
57
res = ccdGJKIntersect(&box, &cyl, &ccd);
60
ccdVec3Set(&axis, -0.1, 2.2, -1.);
61
ccdQuatSetAngleAxis(&cyl.quat, M_PI / 5., &axis);
62
ccdVec3Set(&cyl.pos, .6, 0., 0.5);
63
ccdVec3Set(&axis, 1., 1., 0.);
64
ccdQuatSetAngleAxis(&box.quat, -M_PI / 4., &axis);
65
ccdVec3Set(&box.pos, .6, 0., 0.5);
66
res = ccdGJKIntersect(&box, &cyl, &ccd);
69
ccdVec3Set(&axis, -0.1, 2.2, -1.);
70
ccdQuatSetAngleAxis(&cyl.quat, M_PI / 5., &axis);
71
ccdVec3Set(&cyl.pos, .6, 0., 0.5);
72
ccdVec3Set(&axis, 1., 1., 0.);
73
ccdQuatSetAngleAxis(&box.quat, -M_PI / 4., &axis);
74
ccdVec3Set(&box.pos, .9, 0.8, 0.5);
75
res = ccdGJKIntersect(&box, &cyl, &ccd);
97
ccd.support1 = ccdSupport;
98
ccd.support2 = ccdSupport;
100
ccdVec3Set(&cyl.pos, 0.1, 0., 0.);
101
res = ccdGJKPenetration(&box, &cyl, &ccd, &depth, &dir, &pos);
102
assertTrue(res == 0);
103
recPen(depth, &dir, &pos, stdout, "Pen 1");
106
ccdVec3Set(&cyl.pos, .6, 0., 0.);
107
res = ccdGJKPenetration(&box, &cyl, &ccd, &depth, &dir, &pos);
108
assertTrue(res == 0);
109
recPen(depth, &dir, &pos, stdout, "Pen 2");
112
ccdVec3Set(&cyl.pos, .6, 0.6, 0.);
113
res = ccdGJKPenetration(&box, &cyl, &ccd, &depth, &dir, &pos);
114
assertTrue(res == 0);
115
recPen(depth, &dir, &pos, stdout, "Pen 3");
118
ccdVec3Set(&cyl.pos, .6, 0.6, 0.5);
119
res = ccdGJKPenetration(&box, &cyl, &ccd, &depth, &dir, &pos);
120
assertTrue(res == 0);
121
recPen(depth, &dir, &pos, stdout, "Pen 4");
124
ccdVec3Set(&axis, 0., 1., 0.);
125
ccdQuatSetAngleAxis(&cyl.quat, M_PI / 3., &axis);
126
ccdVec3Set(&cyl.pos, .6, 0.6, 0.5);
127
res = ccdGJKPenetration(&box, &cyl, &ccd, &depth, &dir, &pos);
128
assertTrue(res == 0);
129
recPen(depth, &dir, &pos, stdout, "Pen 5");
132
ccdVec3Set(&axis, 0.67, 1.1, 0.12);
133
ccdQuatSetAngleAxis(&cyl.quat, M_PI / 4., &axis);
134
ccdVec3Set(&cyl.pos, .6, 0., 0.5);
135
res = ccdGJKPenetration(&box, &cyl, &ccd, &depth, &dir, &pos);
136
assertTrue(res == 0);
137
recPen(depth, &dir, &pos, stdout, "Pen 6");
140
ccdVec3Set(&axis, -0.1, 2.2, -1.);
141
ccdQuatSetAngleAxis(&cyl.quat, M_PI / 5., &axis);
142
ccdVec3Set(&cyl.pos, .6, 0., 0.5);
143
ccdVec3Set(&axis, 1., 1., 0.);
144
ccdQuatSetAngleAxis(&box.quat, -M_PI / 4., &axis);
145
ccdVec3Set(&box.pos, .6, 0., 0.5);
146
res = ccdGJKPenetration(&box, &cyl, &ccd, &depth, &dir, &pos);
147
assertTrue(res == 0);
148
recPen(depth, &dir, &pos, stdout, "Pen 7");
151
ccdVec3Set(&axis, -0.1, 2.2, -1.);
152
ccdQuatSetAngleAxis(&cyl.quat, M_PI / 5., &axis);
153
ccdVec3Set(&cyl.pos, .6, 0., 0.5);
154
ccdVec3Set(&axis, 1., 1., 0.);
155
ccdQuatSetAngleAxis(&box.quat, -M_PI / 4., &axis);
156
ccdVec3Set(&box.pos, .9, 0.8, 0.5);
157
res = ccdGJKPenetration(&box, &cyl, &ccd, &depth, &dir, &pos);
158
assertTrue(res == 0);
159
recPen(depth, &dir, &pos, stdout, "Pen 8");