The Kotlin Graphics Maths Library for Kotlin Multiplatform.
A GLM/JOML inspired library with a touch of idiomatic Kotlin.
- 2, 3 and 4-dimensional float vector types
- 2, 3 and 4-dimensional double vector types
- 2, 3 and 4-dimensional integer vector types
- 2x2, 3x3 and 4x4 float matrices
- 2x2, 3x3 and 4x4 double matrices
- Matrix-vector-multiplication
- Orthographic and perspective projection
- Matrix stacks
- Quaternions
- Composition based transformation API
- Hardware acceleration on JVM and native using FMA
- kotlinx.io read- and write-extensions for all KGML types via
kgml-io
First, add the official Maven Central repository to your settings.gradle.kts:
dependencyResolutionManagement {
repositories {
maven("https://central.sonatype.com/repository/maven-snapshots")
mavenCentral()
}
}Then add a dependency on the library in your root buildscript:
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("dev.karmakrafts.kgml:kgml-core:<version>")
}
}
}
}Or, if you are only using Kotlin/JVM, add it to your top-level dependencies block instead.