Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ public static CollisionInfo collide(final Entity entity, final Vec3 collisionMot
lastPose.lerp(logicalPose, (double) (i - 1) / substeps, lastSubLevelPose);
lastPose.lerp(logicalPose, (double) (i) / substeps, subLevelPose);

// Re-orient the entity's collision box to THIS sub-level's pose at THIS substep.
// The computation before the loop reads subLevelPose before it has been set for the
// current iteration, so the box was oriented to the previous substep's pose — or to
// a different sub-level entirely — making entities catch on walls and doorframes of
// rotated sub-levels.
if (customEntityOrientation == null) {
sink.entityBoxOrientation.identity().rotateY(getHitBoxYaw(subLevelPose));
entityBoundsOBB.setOrientation(sink.entityBoxOrientation);
}

rotatedContextBounds.set(fullContextBounds);
if (customEntityOrientation != null) {
entityBoundsOBB.vertices(sink.a);
Expand Down