Package-level declarations

Types

Link copied to clipboard
data class AABB3D(val min: Vector3F = Vector3F(), val max: Vector3F = Vector3F()) : Shape3D
Link copied to clipboard
typealias Anchor = Anchor2D
Link copied to clipboard
data class Anchor2D(val sx: Double, val sy: Double) : Interpolable<Anchor>
Link copied to clipboard
typealias Anchor3 = Anchor3F
Link copied to clipboard
data class Anchor3F(val sx: Float, val sy: Float, val sz: Float) : Interpolable<Anchor3F>
Link copied to clipboard

Represents an Angle, ratio is in 0, 1 range, radians is in 0, 2PI range, and degrees in 0, 360 range The internal representation is in 0, 1 range to reduce rounding errors, since floating points can represent a lot of values in that range.

Link copied to clipboard
inline class BoundsBuilder(val bounds: Rectangle)
Link copied to clipboard
data class Circle(val center: Point, val radius: Double) : AbstractShape2D
Link copied to clipboard
data class CylindricalVector(val radius: Double = 1.0, val angle: Angle = Angle.ZERO, val y: Double = 0.0)
Link copied to clipboard
class DoubleVectorArrayList(val dimensions: Int, capacity: Int = 7) : DoubleVectorList, Extra
Link copied to clipboard
Link copied to clipboard
data class Ellipse(val center: Point, val radius: Size) : Shape2D
Link copied to clipboard

Rotations around Z axis, then X axis, then Y axis in that order.

Link copied to clipboard
class GenericDoubleVector(val dimensions: Int, val data: DoubleArray, val offset: Int = 0) : IGenericDoubleVector
Link copied to clipboard
Link copied to clipboard
interface IScale
Link copied to clipboard
interface IVector3
Link copied to clipboard
typealias Line = Line2D
Link copied to clipboard
typealias Line2 = Line
Link copied to clipboard
data class Line2D(val a: Vector2D, val b: Vector2D) : Shape2D
Link copied to clipboard
data class LineIntersection(val line: MLine = MLine(), var intersection: Point = Point())
Link copied to clipboard
data class Margin(val top: Double, val right: Double, val bottom: Double, val left: Double) : IsAlmostEquals<Margin>

A top, right, bottom, left pack with FixedShort (16-bit) in the range of +-3275.9 (3.3 integer digits + 1 decimal digit)

Link copied to clipboard
data class MarginInt(val top: Int, val right: Int, val bottom: Int, val left: Int)

A top, right, bottom, left pack with Int)

Link copied to clipboard
data class Matrix(val a: Double, val b: Double, val c: Double, val d: Double, val tx: Double = 0.0, val ty: Double = 0.0) : IsAlmostEquals<Matrix>
Link copied to clipboard

Useful for representing rotations and scales.

Link copied to clipboard

Useful for representing complete transforms: rotations, scales, translations, projections, etc.

Link copied to clipboard
class MatrixComputed(val matrix: Matrix, val transform: MatrixTransform)
Link copied to clipboard
Link copied to clipboard
data class MatrixTransform(val x: Double = 0.0, val y: Double = 0.0, val scaleX: Double = 1.0, val scaleY: Double = 1.0, val skewX: Angle = Angle.ZERO, val skewY: Angle = Angle.ZERO, val rotation: Angle = Angle.ZERO) : IsAlmostEquals<MatrixTransform>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class MLine(var a: Point, var b: Point)
Link copied to clipboard
data class MMatrix(var a: Double = 1.0, var b: Double = 0.0, var c: Double = 0.0, var d: Double = 1.0, var tx: Double = 0.0, var ty: Double = 0.0) : MutableInterpolable<MMatrix> , Interpolable<MMatrix>
Link copied to clipboard
typealias MMatrix3D = MMatrix4
Link copied to clipboard
class MMatrix4
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias MPosition3D = MVector4
Link copied to clipboard
Link copied to clipboard
inline class MRectangleInt(val rect: MRectangle)
Link copied to clipboard
data class MScale(var scaleX: Double, var scaleY: Double) : IScale
Link copied to clipboard
typealias MScale3D = MVector4
Link copied to clipboard
Link copied to clipboard
interface MSizeable
Link copied to clipboard
inline class MSizeInt(val float: MSize)
Link copied to clipboard
typealias MVector2D = MPoint
Link copied to clipboard
Link copied to clipboard
typealias MVector3D = MVector4
Link copied to clipboard
class MVector4
Link copied to clipboard
inline class MVector4Int(val v: MVector4)
Link copied to clipboard
Link copied to clipboard
typealias Point = Vector2D
Link copied to clipboard
typealias Point2 = Vector2D
Link copied to clipboard
typealias Point3 = Vector3D
Link copied to clipboard
open class PointArrayList(capacity: Int = 7) : PointList, Extra
Link copied to clipboard
data class PointFixed(val x: Fixed, val y: Fixed)
Link copied to clipboard
typealias PointInt = Vector2I
Link copied to clipboard
open class PointIntArrayList(capacity: Int = 7) : PointIntList, Extra
Link copied to clipboard
interface PointIntList
Link copied to clipboard
Link copied to clipboard
data class Polygon(val points: PointList) : AbstractShape2D
Link copied to clipboard
data class Polyline(val points: PointList) : AbstractShape2D
Link copied to clipboard
data class Quaternion(val x: Float, val y: Float, val z: Float, val w: Float) : IsAlmostEqualsF<Quaternion>
Link copied to clipboard
typealias Ray = Ray2D
Link copied to clipboard
typealias Ray2 = Ray
Link copied to clipboard
data class Ray2D : IsAlmostEquals<Ray2D>

Represents an infinite Ray starting at point in the specified direction with an angle

Link copied to clipboard
typealias Ray3 = Ray3F
Link copied to clipboard
data class Ray3F(val pos: Vector3F, val dir: Vector3F)
Link copied to clipboard
typealias Rectangle = RectangleD
Link copied to clipboard
data class RectangleD(val x: Double, val y: Double, val width: Double, val height: Double) : Shape2D, IsAlmostEquals<RectangleD>
Link copied to clipboard
data class RectangleI(val x: Int, val y: Int, val width: Int, val height: Int)
Link copied to clipboard
Link copied to clipboard
data class RectCorners(val topLeft: Double, val topRight: Double, val bottomRight: Double, val bottomLeft: Double)
Link copied to clipboard
data class RoundRectangle(val rect: Rectangle, val corners: RectCorners) : AbstractShape2D
Link copied to clipboard
data class Scale(val scaleX: Double, val scaleY: Double)
Link copied to clipboard
class ScaleMode(val name: String? = null, val transform: (Size, Size) -> Size)
Link copied to clipboard
typealias Size = Size2D
Link copied to clipboard
data class Size2D(val width: Double, val height: Double)

A class representing a size with a width and a height as Float.

Link copied to clipboard
data class Size2F(val width: Float, val height: Float)
Link copied to clipboard
typealias Size3 = Size2F
Link copied to clipboard
data class Size3D(val width: Double, val height: Double, val depth: Double)
Link copied to clipboard
data class Size3F(val width: Float, val height: Float, val depth: Float)
Link copied to clipboard
interface Sizeable
Link copied to clipboard
interface SizeableInt
Link copied to clipboard
typealias SizeI = SizeInt
Link copied to clipboard
data class SizeInt(val width: Int, val height: Int)
Link copied to clipboard
data class Spacing(val vertical: Double, val horizontal: Double)
Link copied to clipboard
data class Sphere3D(val center: Vector3F, val radius: Float) : Shape3D
Link copied to clipboard
data class TRS4(val translation: Vector4F, val rotation: Quaternion, val scale: Vector4F)
Link copied to clipboard
typealias Vector2 = Vector2F
Link copied to clipboard
data class Vector2D(val x: Double, val y: Double) : IsAlmostEquals<Vector2D>
Link copied to clipboard
data class Vector2F(val x: Float, val y: Float)
Link copied to clipboard
data class Vector2I(val x: Int, val y: Int)
Link copied to clipboard
typealias Vector3 = Vector3F
Link copied to clipboard
data class Vector3D(val x: Double, val y: Double, val z: Double)
Link copied to clipboard
data class Vector3F(val x: Float, val y: Float, val z: Float) : IsAlmostEqualsF<Vector3F>
Link copied to clipboard
data class Vector3I(val x: Int, val y: Int, val z: Int)
Link copied to clipboard
typealias Vector4 = Vector4F
Link copied to clipboard
data class Vector4D(val x: Double, val y: Double, val z: Double, val w: Double)
Link copied to clipboard
data class Vector4F(val x: Float, val y: Float, val z: Float, val w: Float)
Link copied to clipboard
data class Vector4I(val x: Int, val y: Int, val z: Int, val w: Int)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline fun abs(angle: Angle): Angle
Link copied to clipboard
fun Size.applyScaleMode(container: Size, mode: ScaleMode): Size
fun Rectangle.applyScaleMode(container: Rectangle, mode: ScaleMode, anchor: Anchor): Rectangle
fun Size.applyScaleMode(container: Rectangle, mode: ScaleMode, anchor: Anchor): Rectangle
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Iterable<MRectangle>.bounds(target: MRectangle = MRectangle()): MRectangle
fun Iterable<MPoint>.bounds(out: MRectangle = MRectangle(), bb: MBoundsBuilder = MBoundsBuilder()): MRectangle
fun List<MPoint>.bounds(out: MRectangle = MRectangle(), bb: MBoundsBuilder = MBoundsBuilder()): MRectangle
Link copied to clipboard
fun Angle.clamp(min: Angle, max: Angle): Angle
fun Vector2D.clamp(min: Float, max: Float): Vector2D
fun Vector2F.clamp(min: Float, max: Float): Vector2F
fun Vector3F.clamp(min: Float, max: Float): Vector3F
fun Vector4F.clamp(min: Float, max: Float): Vector4F
fun MPoint.clamp(min: Double, max: Double, out: MPoint = MPoint()): MPoint
Link copied to clipboard
operator fun OpenRange<Angle>.contains(angle: Angle): Boolean
operator fun ClosedRange<Angle>.contains(angle: Angle): Boolean
Link copied to clipboard
fun Rectangle.copyTo(out: MRectangle = MRectangle()): MRectangle
Link copied to clipboard
inline fun cos(angle: Angle, up: Vector2D = Vector2D.UP): Double
Link copied to clipboard
inline fun cosf(angle: Angle, up: Vector2D = Vector2D.UP): Float
Link copied to clipboard
operator fun Vector2D.div(other: Scale): Vector2D
operator fun Vector2D.div(other: Size): Vector2D
operator fun Vector2D.div(other: SizeInt): Vector2D
operator fun Vector2F.div(other: Scale): Vector2F
operator fun Vector2F.div(other: Size): Vector2F
operator fun Vector2F.div(other: SizeInt): Vector2F
operator fun Vector2I.div(other: SizeInt): Vector2I
Link copied to clipboard
inline fun PointIntList.fastForEach(block: (x: Int, y: Int) -> Unit)
inline fun PointList.fastForEach(block: (Point) -> Unit)
Link copied to clipboard
inline fun <T : DoubleVectorList> T.fastForEachGeneric(block: T.(n: Int) -> Unit)
Link copied to clipboard
inline fun PointList.fastForEachIndexed(block: (index: Int, Point) -> Unit)
Link copied to clipboard
inline fun PointIntList.fastForEachReverse(block: (x: Int, y: Int) -> Unit)
inline fun PointList.fastForEachReverse(block: (Point) -> Unit)
Link copied to clipboard
inline fun PointList.fastForEachReverseIndexed(block: (index: Int, Point) -> Unit)
Link copied to clipboard
fun Size.fitTo(container: Size): Size
fun SizeInt.fitTo(container: SizeInt): SizeInt
Link copied to clipboard
Link copied to clipboard
inline fun DoubleVectorList.getOrElse(index: Int, dim: Int, default: Double = 0.0): Double
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T> PointList.map(gen: (x: Double, y: Double) -> T): List<T>
Link copied to clipboard
Link copied to clipboard
fun <T> DoubleVectorList.mapVector(block: (list: DoubleVectorList, index: Int) -> T): List<T>
Link copied to clipboard
inline fun max(a: Angle, b: Angle): Angle
fun max(a: MPoint, b: MPoint, out: MPoint = MPoint()): MPoint
Link copied to clipboard
inline fun min(a: Angle, b: Angle): Angle
fun min(a: MPoint, b: MPoint, out: MPoint = MPoint()): MPoint
Link copied to clipboard
operator fun Vector2D.minus(other: Size): Vector2D
operator fun Vector2D.minus(other: SizeInt): Vector2D
operator fun Vector2F.minus(other: Size): Vector2F
operator fun Vector2F.minus(other: SizeInt): Vector2F
operator fun Vector2I.minus(other: SizeInt): Vector2I
Link copied to clipboard
fun Rectangle.mutable(out: MRectangle = MRectangle()): MRectangle
fun Point.mutable(out: MPoint = MPoint()): MPoint
Link copied to clipboard
fun mvec(x: Float, y: Float, z: Float): MVector3
Link copied to clipboard
fun Rectangle.place(item: Size, anchor: Anchor, scale: ScaleMode): Rectangle
Link copied to clipboard
operator fun Vector2D.plus(other: Size): Vector2D
operator fun Vector2D.plus(other: SizeInt): Vector2D
operator fun Vector2F.plus(other: Size): Vector2F
operator fun Vector2F.plus(other: SizeInt): Vector2F
operator fun Vector2I.plus(other: SizeInt): Vector2I
Link copied to clipboard
Link copied to clipboard
operator fun Vector2D.rem(other: Scale): Vector2D
operator fun Vector2D.rem(other: Size): Vector2D
operator fun Vector2D.rem(other: SizeInt): Vector2D
operator fun Vector2F.rem(other: Scale): Vector2F
operator fun Vector2F.rem(other: Size): Vector2F
operator fun Vector2F.rem(other: SizeInt): Vector2F
operator fun Vector2I.rem(other: SizeInt): Vector2I
Link copied to clipboard
inline fun sin(angle: Angle, up: Vector2D = Vector2D.UP): Double
Link copied to clipboard
inline fun sinf(angle: Angle, up: Vector2D = Vector2D.UP): Float
Link copied to clipboard
inline fun tan(angle: Angle, up: Vector2D = Vector2D.UP): Double
Link copied to clipboard
inline fun tanf(angle: Angle, up: Vector2D = Vector2D.UP): Float
Link copied to clipboard
operator fun Size.times(anchor: Anchor): Point
operator fun Vector2D.times(other: Scale): Vector2D
operator fun Vector2D.times(other: Size): Vector2D
operator fun Vector2D.times(other: SizeInt): Vector2D
operator fun Vector2F.times(other: Scale): Vector2F
operator fun Vector2F.times(other: Size): Vector2F
operator fun Vector2F.times(other: SizeInt): Vector2F
operator fun Vector2I.times(other: SizeInt): Vector2I
operator fun Double.times(v: Vector2D): Vector2D
operator fun Double.times(v: Vector2F): Vector2F
operator fun Double.times(v: Vector3F): Vector3F
operator fun Float.times(v: Vector2D): Vector2D
operator fun Float.times(v: Vector2F): Vector2F
operator fun Float.times(v: Vector3F): Vector3F
operator fun Int.times(v: Vector2D): Vector2D
operator fun Int.times(v: Vector2F): Vector2F
operator fun Int.times(v: Vector3F): Vector3F
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Point.toMPoint(out: MPoint = MPoint()): MPoint
Link copied to clipboard
fun Scale.toMutable(out: MScale = MScale()): MScale
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Matrix.transformRectangle(rectangle: Rectangle, delta: Boolean = false): Rectangle
Link copied to clipboard
infix fun Angle.until(other: Angle): OpenRange<Angle>
Link copied to clipboard
fun vec(x: Float, y: Float): Vector2F
fun vec(x: Float, y: Float, z: Float): Vector3F
fun vec(x: Float, y: Float, z: Float, w: Float): Vector4F
Link copied to clipboard
fun vec2(x: Float, y: Float): Vector2F
Link copied to clipboard
fun vec3(x: Float, y: Float, z: Float): Vector3F
Link copied to clipboard
fun vec4(x: Float, y: Float, z: Float, w: Float = 1.0f): Vector4F
Link copied to clipboard
fun vectorDoubleArrayListOf(vararg vectors: GenericDoubleVector, dimensions: Int = vectors.first().dimensions): DoubleVectorArrayList
fun vectorDoubleArrayListOf(vararg vectors: IGenericDoubleVector, dimensions: Int = vectors.first().dimensions): DoubleVectorArrayList
fun vectorDoubleArrayListOf(vararg data: Float, dimensions: Int): DoubleVectorArrayList
fun vectorDoubleArrayListOf(vararg data: Int, dimensions: Int): DoubleVectorArrayList