forked from mirrors/cobblemon
Merge branch 'fix/particle-disapearing' into 'main'
fix: adapting the boundingBox to the visual if it's a beam it should have a... See merge request cable-mc/cobblemon!2167
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
- Fix occasional crash on retrieving revived fossils
|
||||
- Fixed a compatibility issue with World Game Rules which caused some log spam in specific cases.
|
||||
- Fixed improper validation of Pokémon when performing a trade.
|
||||
- Fixed issue where particle like beam can disappear when you don't see the beginning of the beam or you look away
|
||||
|
||||
### Developer
|
||||
|
||||
|
||||
@@ -309,6 +309,7 @@ class SnowstormParticle(
|
||||
boundingBox = AABB.ofSize(Vec3(x, y, z), radius, radius, radius)
|
||||
if (dx == 0.0 && dy == 0.0 && dz == 0.0) {
|
||||
updatePosition()
|
||||
expandBoundingBoxForCulling(radius)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -366,6 +367,16 @@ class SnowstormParticle(
|
||||
}
|
||||
}
|
||||
updatePosition()
|
||||
expandBoundingBoxForCulling(radius)
|
||||
}
|
||||
|
||||
private fun expandBoundingBoxForCulling(collisionRadius: Double) {
|
||||
val visualSizeX = abs(runtime.resolveDouble(storm.effect.particle.sizeX))
|
||||
val visualSizeY = abs(runtime.resolveDouble(storm.effect.particle.sizeY))
|
||||
val visualExtent = maxOf(visualSizeX, visualSizeY)
|
||||
if (visualExtent > collisionRadius) {
|
||||
boundingBox = AABB.ofSize(Vec3(x, y, z), visualExtent, visualExtent, visualExtent)
|
||||
}
|
||||
}
|
||||
|
||||
fun updatePosition() {
|
||||
|
||||
Reference in New Issue
Block a user