Skip to content

Commit

Permalink
Recalculate min/max entity coords.
Browse files Browse the repository at this point in the history
  • Loading branch information
afritz1 committed Aug 26, 2023
1 parent 596927f commit 444ae55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenTESArena/src/Collision/Physics.cpp
Expand Up @@ -125,8 +125,8 @@ namespace Physics

// Get the entity's view-independent bounding box to help determine which voxels they are in.
const BoundingBox3D &entityBBox = entityChunkManager.getEntityBoundingBox(entityInst.bboxID);
const CoordDouble3 minCoord(visState.flatPosition.chunk, visState.flatPosition.point - entityBBox.min);
const CoordDouble3 maxCoord(visState.flatPosition.chunk, visState.flatPosition.point + entityBBox.max);
const CoordDouble3 minCoord = ChunkUtils::recalculateCoord(visState.flatPosition.chunk, visState.flatPosition.point - entityBBox.min);
const CoordDouble3 maxCoord = ChunkUtils::recalculateCoord(visState.flatPosition.chunk, visState.flatPosition.point + entityBBox.max);

// Get min and max coordinates in chunk space and get the difference for iteration.
const CoordInt3 minVoxelCoord(minCoord.chunk, VoxelUtils::pointToVoxel(minCoord.point, ceilingScale));
Expand Down

0 comments on commit 444ae55

Please sign in to comment.