mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 14:04:05 +09:00
tiles won't place to the position where occupied by actors
Former-commit-id: 745558470933aea8d1f03da30ca5042a82c69eac Former-commit-id: 09e741f5eaec3eb18b8a76c82fcc2aa62378e82e
This commit is contained in:
@@ -44,6 +44,14 @@ open class ActorWithBody : Actor() {
|
||||
val hitbox = Hitbox(0.0, 0.0, 0.0, 0.0) // Hitbox is implemented using Double;
|
||||
@Transient val nextHitbox = Hitbox(0.0, 0.0, 0.0, 0.0) // 52 mantissas ought to be enough for anybody...
|
||||
|
||||
val tilewiseHitbox: Hitbox
|
||||
get() = Hitbox.fromTwoPoints(
|
||||
hitbox.posX.div(TILE_SIZE).floor(),
|
||||
hitbox.posY.div(TILE_SIZE).floor(),
|
||||
hitbox.endPointX.div(TILE_SIZE).floor(),
|
||||
hitbox.endPointY.div(TILE_SIZE).floor()
|
||||
)
|
||||
|
||||
/**
|
||||
* Velocity vector for newtonian sim.
|
||||
* Acceleration: used in code like:
|
||||
|
||||
Reference in New Issue
Block a user