From: Daniel Karbach Date: Fri, 4 Dec 2015 09:49:54 +0000 (+0100) Subject: fix box/box intersection test …again X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=69d1bc83f472e8fe5b9b16b72ca5c840d8f75123;hp=de4b131ccd0f92322efbb8e98ea833d2aac65d52;p=blank.git fix box/box intersection test …again I am an idiot --- diff --git a/doc/todo b/doc/todo index f2f557e..21bf7ae 100644 --- a/doc/todo +++ b/doc/todo @@ -83,15 +83,6 @@ gravity maybe players should be given the option to switch between walk and fly mode - I had a NaN position while experimenting with (directional) gravity - blocks recently. I checked the gravity code and it seems solid, so - might be something I overlooked or, what more probable, it triggered - some NaN condition in the collision code. Needs investigating - - This may be related to the HUD locking on an entity. If the entity is - teleported to a NaN position, the ray intersection test could give a - false positive. - block attributes when blocks are not just a solid rock of color, attributes may diff --git a/src/geometry/geometry.cpp b/src/geometry/geometry.cpp index 7d099cf..ebd47e9 100644 --- a/src/geometry/geometry.cpp +++ b/src/geometry/geometry.cpp @@ -152,6 +152,7 @@ bool Intersection( for (const glm::vec3 &axis : axes) { if (any(isnan(axis))) { // can result from the cross products if A and B have parallel axes + ++cur_axis; continue; } float a_min = std::numeric_limits::infinity();