Skip to content

Commit b32c2d6

Browse files
committed
test entobb::front/entobb::back
1 parent 2990655 commit b32c2d6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/testmpr.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,37 @@ namespace
206206
assert(l == -2.f);
207207
}
208208
}
209+
210+
void test_entobb_front_back()
211+
{
212+
std::printf("testing entobb::front and entobb::back\n");
213+
{
214+
physent p;
215+
p.xradius = 1;
216+
p.yradius = 1;
217+
p.eyeheight = 1;
218+
p.o = vec(0,0,0);
219+
p.yaw = 0;
220+
mpr::EntOBB e(&p);
221+
float f = e.front();
222+
float b = e.back();
223+
assert(f == -b);
224+
assert(f == 1.f);
225+
}
226+
{
227+
physent p;
228+
p.xradius = 1;
229+
p.yradius = 2;
230+
p.eyeheight = 1;
231+
p.o = vec(0,0,0);
232+
p.yaw = 0;
233+
mpr::EntOBB e(&p);
234+
float f = e.front();
235+
float b = e.back();
236+
assert(f == -b);
237+
assert(f == 2.f);
238+
}
239+
}
209240
}
210241

211242
void test_mpr()
@@ -225,4 +256,5 @@ testing mpr functionality\n\
225256
test_ent_center();
226257
test_entobb_supportpoint();
227258
test_entobb_left_right();
259+
test_entobb_front_back();
228260
}

0 commit comments

Comments
 (0)