mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-09 23:42:35 -04:00
particles: fix "bugging back"
This commit is contained in:
parent
cf0a6a4927
commit
cebbf7a019
@ -105,6 +105,7 @@ abstract class Particle(
|
|||||||
|
|
||||||
open fun move(velocity: Vec3d) {
|
open fun move(velocity: Vec3d) {
|
||||||
if (alreadyCollided) {
|
if (alreadyCollided) {
|
||||||
|
this.previousPosition = Vec3d(position)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var newVelocity = Vec3d(velocity)
|
var newVelocity = Vec3d(velocity)
|
||||||
@ -113,9 +114,7 @@ abstract class Particle(
|
|||||||
newVelocity = connection.collisionDetector.collide(this, newVelocity, aabb)
|
newVelocity = connection.collisionDetector.collide(this, newVelocity, aabb)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newVelocity != Vec3d.EMPTY) {
|
forceMove(newVelocity)
|
||||||
forceMove(newVelocity)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (abs(newVelocity.y) >= Y_VELOCITY_TO_CHECK && abs(velocity.y) < Y_VELOCITY_TO_CHECK) {
|
if (abs(newVelocity.y) >= Y_VELOCITY_TO_CHECK && abs(velocity.y) < Y_VELOCITY_TO_CHECK) {
|
||||||
this.alreadyCollided = true
|
this.alreadyCollided = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user