mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 19:35:00 -04:00
add VoxelShape::equals
* This should fix some lighting bugs, because light properties are not determinant as expected
This commit is contained in:
parent
91b306ce8a
commit
3a21bbfa2f
@ -140,6 +140,21 @@ class VoxelShape(private val aabbs: MutableList<AABB> = mutableListOf()) : Itera
|
||||
return shouldDrawLine(start.toVec3d, end.toVec3d)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return aabbs.toString()
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return aabbs.hashCode()
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other === this) return true
|
||||
if (other !is VoxelShape) return false
|
||||
if (other.hashCode() != hashCode()) return false
|
||||
return aabbs == other.aabbs
|
||||
}
|
||||
|
||||
companion object {
|
||||
val EMPTY = VoxelShape()
|
||||
val FULL = VoxelShape(mutableListOf(AABB.BLOCK))
|
||||
|
Loading…
x
Reference in New Issue
Block a user