mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
parent
ac451d79ef
commit
66ea0471a0
@ -26,3 +26,20 @@ def test_plane_into_box():
|
||||
|
||||
entry = make_collision(plane, box)[0]
|
||||
assert entry is None
|
||||
|
||||
|
||||
def test_ray_into_box():
|
||||
ray = CollisionRay(1, 1, 1, 0, 1, 0)
|
||||
box = CollisionBox((0, 0, 0), 3, 3, 5)
|
||||
entry = make_collision(ray, box)[0]
|
||||
assert entry is not None
|
||||
assert entry.get_from() == ray
|
||||
assert entry.get_into() == box
|
||||
|
||||
# Colliding just on the edge
|
||||
entry, np_from, np_into = make_collision(CollisionRay(3, 3, 0, 1, -1, 0), box)
|
||||
assert entry.get_surface_point(np_from) == Point3(3, 3, 0)
|
||||
|
||||
# No collision
|
||||
entry = make_collision(CollisionRay(0, 0, 100, 1, 0, 0), box)[0]
|
||||
assert entry is None
|
||||
|
Loading…
x
Reference in New Issue
Block a user