BoundingBox

open class BoundingBox

Source from kool engine.

Constructors

Link copied to clipboard
fun BoundingBox(min: Vec3f, max: Vec3f)
Link copied to clipboard

Functions

Link copied to clipboard
fun add(point: Vec3f): BoundingBox
fun add(points: List<Vec3f>): BoundingBox
fun add(points: List<Vec3f>, range: IntRange): BoundingBox
Link copied to clipboard
inline fun batchUpdate(block: BoundingBox.() -> Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
operator fun contains(point: Vec3f): Boolean
operator fun contains(aabb: BoundingBox): Boolean
fun contains(x: Float, y: Float, z: Float): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Checks aabb components for equality (using '==' operator). For better numeric stability consider using isFuzzyEqual.

Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Computes the squared hit distance for the given ray. If the ray does not intersect this BoundingBox Float.MAX_VALUE is returned. If the ray origin is inside this BoundingBox 0 is returned. The method returns the squared distance because it's faster to compute. If the exact distance is needed the square root of the result has to be taken.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun move(offset: Vec3f): BoundingBox
fun move(x: Float, y: Float, z: Float): BoundingBox
Link copied to clipboard

Computes the distance between the given point and this BoundingBox. It this BoundingBox includes the point, 0 is returned.

Link copied to clipboard

Computes the squared distance between the given point and this BoundingBox. It this BoundingBox includes the point, 0 is returned.

Link copied to clipboard
fun set(min: Vec3f, max: Vec3f): BoundingBox
fun set(minX: Float, minY: Float, minZ: Float, maxX: Float, maxY: Float, maxZ: Float): BoundingBox
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
Link copied to clipboard
var isBatchUpdate: Boolean = false
Link copied to clipboard
var isEmpty: Boolean = true
Link copied to clipboard
val max: Vec3f
Link copied to clipboard
val min: Vec3f
Link copied to clipboard
val size: Vec3f