mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-17 00:56:07 +09:00
THE cheapest way to resolve right-sided phys bug
This commit is contained in:
@@ -894,7 +894,7 @@ open class ActorWithBody : Actor {
|
|||||||
debug1("translate x by $t")
|
debug1("translate x by $t")
|
||||||
}
|
}
|
||||||
/* 4, 14 */ COLLIDING_RIGHT, COLLIDING_RIGHT or COLLIDING_UD -> {
|
/* 4, 14 */ COLLIDING_RIGHT, COLLIDING_RIGHT or COLLIDING_UD -> {
|
||||||
val t = -newHitbox.endX.modTileDelta()
|
val t = -newHitbox.endX.modTileDelta() - PHYS_EPSILON_DIST // THE cheapest way to resolve right-sided phys bug
|
||||||
newHitbox.translatePosX(t); bounceX = true
|
newHitbox.translatePosX(t); bounceX = true
|
||||||
debug1("translate x by $t")
|
debug1("translate x by $t")
|
||||||
}
|
}
|
||||||
@@ -979,7 +979,8 @@ open class ActorWithBody : Actor {
|
|||||||
debug1("offendingTileWorldY=$offendingTileWorldY, offendingHitboxPointY=$offendingHitboxPointY")
|
debug1("offendingTileWorldY=$offendingTileWorldY, offendingHitboxPointY=$offendingHitboxPointY")
|
||||||
|
|
||||||
val displacementAbs = Vector2(
|
val displacementAbs = Vector2(
|
||||||
(offendingTileWorldX - offendingHitboxPointX).abs(),
|
(offendingTileWorldX - offendingHitboxPointX).abs() +
|
||||||
|
if (selfCollisionStatus and COLLIDING_RIGHT != 0) PHYS_EPSILON_DIST else 0.0, // THE cheapest way to resolve right-sided phys bug
|
||||||
(offendingTileWorldY - offendingHitboxPointY).abs()
|
(offendingTileWorldY - offendingHitboxPointY).abs()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user