mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Update collide_item.cpp
Updated non-collidable volumes check.
This commit is contained in:
parent
0a8eb65de3
commit
0faa11a882
1 changed files with 7 additions and 7 deletions
|
@ -234,6 +234,13 @@ CollidedObjectData GetCollidedObjects(ItemInfo& collidingItem, bool onlyVisible,
|
|||
if (!Geometry::CircleIntersects(circle, collidingCircle))
|
||||
continue;
|
||||
|
||||
// Skip if either bounding box has any zero extent (not a collidable volume).
|
||||
if (bounds.GetExtents().Length() > 0)
|
||||
continue;
|
||||
|
||||
if (collidingBounds.GetExtents().Length() > 0)
|
||||
continue;
|
||||
|
||||
auto box0 = bounds.ToBoundingOrientedBox(staticObj.pos.Position);
|
||||
auto box1 = collidingBounds.ToBoundingOrientedBox(collidingItem.Pose);
|
||||
|
||||
|
@ -241,13 +248,6 @@ CollidedObjectData GetCollidedObjects(ItemInfo& collidingItem, bool onlyVisible,
|
|||
if (customRadius > 0.0f)
|
||||
box1.Extents = Vector3(customRadius);
|
||||
|
||||
// Skip if either bounding box has any zero extent (not a collidable volume).
|
||||
if (box0.Extents.x > 0 || box0.Extents.y > 0 || box0.Extents.z > 0)
|
||||
continue;
|
||||
|
||||
if (box1.Extents.x > 0 || box1.Extents.y > 0 || box1.Extents.z > 0)
|
||||
continue;
|
||||
|
||||
// Test accurate box intersection.
|
||||
if (box0.Intersects(box1))
|
||||
collObjects.Statics.push_back(&staticObj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue