Package-level declarations

Types

Link copied to clipboard
object CurveUtil

Chart.js spline interpolation

Link copied to clipboard

Functions from https://easings.net.

Link copied to clipboard
data class KeyedAabb<K>(val box: AABB, val key: K) : Record

A world-space AABB tagged with a merge key. Only boxes with equal keys are allowed to be merged.

Properties

Link copied to clipboard
val Vec3.absoluteValue: Vec3
Link copied to clipboard
val BoundingBox.boundingBox: AABB
Link copied to clipboard
val BoundingBox.box: AABB
Link copied to clipboard
val BoundingBox.from: BlockPos
Link copied to clipboard
Link copied to clipboard
val BoundingBox.size: Int
Link copied to clipboard
val BoundingBox.to: BlockPos

Functions

Link copied to clipboard
inline fun Vector3f.add(vec3d: Vec3): Vector3f
Link copied to clipboard
fun Iterable<Vec3>.average(): Vec3
Link copied to clipboard
fun VoxelShape.boundsOrNull(): AABB?
Link copied to clipboard
fun BoundingBox.centerOnSide(side: Direction): Vec3
fun AABB.centerOnSide(side: Direction): Vec3
Link copied to clipboard
fun VoxelShape.clipAllBoxes(base: BlockPos, from: Vec3, to: Vec3): List<Vec3>
Link copied to clipboard
inline operator fun Vec3i.component1(): Int
inline operator fun Vec2.component1(): Float
inline operator fun Vec3.component1(): Double
Link copied to clipboard
inline operator fun Vec3i.component2(): Int
inline operator fun Vec2.component2(): Float
inline operator fun Vec3.component2(): Double
Link copied to clipboard
inline operator fun Vec3i.component3(): Int
inline operator fun Vec3.component3(): Double
Link copied to clipboard
operator fun ChunkPos.contains(blockPos: Long): Boolean
operator fun BoundingBox.contains(other: BoundingBox): Boolean
Link copied to clipboard
inline fun Vec2.copy(x: Float = this.x, y: Float = this.y): Vec2
inline fun BlockPos.copy(x: Int = this.x, y: Int = this.y, z: Int = this.z): BlockPos
inline fun Vec3.copy(x: Double = this.x, y: Double = this.y, z: Double = this.z): Vec3
inline fun BoundingBox.copy(minX: Int = this.minX(), minY: Int = this.minY(), minZ: Int = this.minZ(), maxX: Int = this.maxX(), maxY: Int = this.maxY(), maxZ: Int = this.maxZ()): BoundingBox
Link copied to clipboard
fun VoxelShape.distanceToSqr(position: Vec3): Double

fun AABB.distanceToSqr(x: Double, y: Double, z: Double): Double

Squared distance from this box to a point without allocating a temporary Vec3.

Link copied to clipboard
inline fun Vec3.dot(x: Double, y: Double, z: Double): Double
Link copied to clipboard
fun Vector2ic.dotProduct(other: Vector2ic): Long
fun Vector2ic.dotProduct(x: Int, y: Int): Long
Link copied to clipboard
fun BlockPos.expandToBoundingBox(offsetX: Int = 0, offsetY: Int = 0, offsetZ: Int = 0): BoundingBox
Link copied to clipboard
fun findFunctionMinimumByBisect(from: Double, to: Double, minDelta: Double = 1.0E-4, function: Double2DoubleFunction): DoubleDoublePair

Finds the minimum between min and max.

Link copied to clipboard
fun AABB.firstHit(from: Vec3, to: Vec3): Vec3?

Ray–AABB first hit point (entry or exit).

Link copied to clipboard
inline fun Vec3.fma(scale: Double, other: Vec3): Vec3
Link copied to clipboard
fun AABB.getCoordinate(direction: Direction): Double
Link copied to clipboard
fun AABB.getFace(direction: Direction): AlignedFace
Link copied to clipboard
fun AABB.getNearestPoint(from: Position): Vec3

Get the nearest point of a box. Very useful to calculate the distance of an enemy.

Link copied to clipboard
fun AABB.getNearestPointOnSide(from: Vec3, side: Direction): Vec3
Link copied to clipboard
fun Vec3.horizontalDistanceTo(other: Vec3): Double
Link copied to clipboard
inline fun VoxelShape.ifEmpty(defaultValue: () -> VoxelShape): VoxelShape
Link copied to clipboard
fun AABB.isHitByLine(start: Vec3, p: Vec3): Boolean

Tests if the infinite line resulting from start and the point p will intersect this box.

Link copied to clipboard
fun Vec3.isNormalized(tolerance: Double = 1.0E-4): Boolean
Link copied to clipboard
fun BoundingBox.iterate(): Iterable<BlockPos>
Link copied to clipboard
fun AABB.iterateBlockPos(minYInclusive: Int = minY.floorToInt(), maxYInclusive: Int = maxY.ceilToInt()): Iterable<BlockPos>
Link copied to clipboard
fun AABB.iterateBottomLayerBlockPos(): Iterable<BlockPos>
Link copied to clipboard
operator fun BoundingBox.iterator(): Iterator<BlockPos>
Link copied to clipboard
fun Vec3i.lengthSqr(): Long
Link copied to clipboard
Link copied to clipboard

Merge transitive intersecting AABBs using sweep-and-prune broadphase + union-find.

Link copied to clipboard
inline operator fun Vec3i.minus(other: Vec3i): Vec3i
inline operator fun AABB.minus(offset: Position): AABB
inline operator fun AABB.minus(offset: Vec3i): AABB
inline operator fun Vec3.minus(other: Position): Vec3
inline operator fun Vec3.minus(other: Vec3i): Vec3
Link copied to clipboard
fun Vec3.move(other: Vec3): Vec3
fun Vec3.move(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0): Vec3
Link copied to clipboard
inline fun Vec3.multiply(factorX: Double = 1.0, factorY: Double = 1.0, factorZ: Double = 1.0): Vec3
inline fun Vec3.multiply(factorX: Float = 1.0f, factorY: Float = 1.0f, factorZ: Float = 1.0f): Vec3
Link copied to clipboard
fun Vec3.normalizeIfNeeded(tolerance: Double = 1.0E-4): Vec3
Link copied to clipboard
inline fun VoxelShape?.orEmpty(): VoxelShape
Link copied to clipboard
inline operator fun BlockPos.plus(other: Vec3i): BlockPos
inline operator fun Vec3i.plus(other: Vec3i): Vec3i
inline operator fun AABB.plus(offset: Position): AABB
inline operator fun AABB.plus(offset: Vec3i): AABB
inline operator fun Vec3.plus(other: Position): Vec3
inline operator fun Vec3.plus(other: Vec3i): Vec3
Link copied to clipboard
fun Vec3.preferOver(other: Vec3): Vec3
Link copied to clipboard
inline operator fun BlockPos.rangeTo(other: BlockPos): BoundingBox
Link copied to clipboard
fun AABB.samplePointOnSide(side: Direction, a: Double, b: Double): Vec3
Link copied to clipboard
fun Vec3.scaleMut(scale: Double = 1.0): Vec3
fun Vec3.scaleMut(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0): Vec3
Link copied to clipboard
inline fun BlockPos.MutableBlockPos.set(pos: Position): BlockPos.MutableBlockPos
fun Vec3.set(other: Vec3): Vec3
inline fun Vector3f.set(vec3d: Vec3): Vector3f
fun Vec3.set(x: Double = this.x, y: Double = this.y, z: Double = this.z): Vec3
Link copied to clipboard
fun VoxelShape.shrink(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0): VoxelShape

Shrinks a VoxelShape by the specified amounts on selected axes.

Link copied to clipboard
fun Vector2ic.similarity(other: Vector2ic): Double
Link copied to clipboard
inline fun Double.sq(): Double
inline fun Float.sq(): Float
inline fun Int.sq(): Int
Link copied to clipboard
inline fun Vector3f.sub(vec3d: Vec3): Vector3f
Link copied to clipboard
inline operator fun Vec3i.times(scalar: Int): Vec3i
inline operator fun Vec3.times(scalar: Double): Vec3
Link copied to clipboard
fun ChunkAccess.toBlockBox(): BoundingBox
fun ChunkPos.toBlockBox(minY: Int = world.minY, maxY: Int = world.maxY): BoundingBox
Link copied to clipboard
inline fun Vec3.toBlockPos(xOffset: Double = 0.0, yOffset: Double = 0.0, zOffset: Double = 0.0): BlockPos
Link copied to clipboard
inline fun Double.toFixed(digits: Int): String
inline fun Float.toFixed(digits: Int): String
Link copied to clipboard
fun Vector3fc.toVec3d(): Vec3
inline fun Vec3i.toVec3d(xOffset: Double = 0.0, yOffset: Double = 0.0, zOffset: Double = 0.0): Vec3
Link copied to clipboard
inline fun Vec3.toVec3f(): Vec3f
Link copied to clipboard
inline fun Vec3.toVec3i(): Vec3i
Link copied to clipboard
inline operator fun BlockPos.unaryMinus(): BlockPos
inline operator fun Vec3i.unaryMinus(): Vec3i
inline operator fun Vec3.unaryMinus(): Vec3
Link copied to clipboard
fun Vec3.withLength(newLength: Double): Vec3

this.normalize().scale(newLength)