All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ru.casperix.math.axis_aligned.float32.Dimension3f.kt Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
package ru.casperix.math.axis_aligned.float32

import ru.casperix.math.axis_aligned.Dimension3
import ru.casperix.math.vector.float32.Vector3f
import ru.casperix.math.vector.int32.Vector3i
import kotlinx.serialization.Serializable
import kotlin.math.roundToInt

@Serializable
data class Dimension3f(override val width: Float, override val height: Float, override val depth:Float) : Dimension3 {

    fun roundToVector3i(): Vector3i {
        return Vector3i(width.roundToInt(), height.roundToInt(), depth.roundToInt())
    }

    fun toVector3f(): Vector3f {
        return Vector3f(width, height, depth)
    }

    companion object {
        val ZERO = Dimension3f(0f, 0f, 0f)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy