More float<>double vector conversions
This commit is contained in:
parent
ffa7f0361f
commit
cea22e65a2
@ -4,7 +4,7 @@ kotlin.code.style=official
|
|||||||
specifyKotlinAsDependency=false
|
specifyKotlinAsDependency=false
|
||||||
|
|
||||||
projectGroup=ru.dbotthepony.kommons
|
projectGroup=ru.dbotthepony.kommons
|
||||||
projectVersion=2.1.5
|
projectVersion=2.1.6
|
||||||
|
|
||||||
guavaDepVersion=33.0.0
|
guavaDepVersion=33.0.0
|
||||||
gsonDepVersion=2.8.9
|
gsonDepVersion=2.8.9
|
||||||
|
@ -191,6 +191,9 @@ data class Vector2d(
|
|||||||
|
|
||||||
operator fun times(value: Matrix4dStack) = times(value.last())
|
operator fun times(value: Matrix4dStack) = times(value.last())
|
||||||
|
|
||||||
|
fun toDoubleVector() = this
|
||||||
|
fun toFloatVector() = Vector2f(x.toFloat(), y.toFloat())
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField val ZERO = Vector2d()
|
@JvmField val ZERO = Vector2d()
|
||||||
@JvmField val POSITIVE_X = Vector2d(x = 1.0)
|
@JvmField val POSITIVE_X = Vector2d(x = 1.0)
|
||||||
|
@ -192,6 +192,7 @@ data class Vector2f(
|
|||||||
operator fun times(value: Matrix4fStack) = times(value.last())
|
operator fun times(value: Matrix4fStack) = times(value.last())
|
||||||
|
|
||||||
fun toDoubleVector() = Vector2d(x.toDouble(), y.toDouble())
|
fun toDoubleVector() = Vector2d(x.toDouble(), y.toDouble())
|
||||||
|
fun toFloatVector() = this
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField val ZERO = Vector2f()
|
@JvmField val ZERO = Vector2f()
|
||||||
|
@ -205,6 +205,9 @@ data class Vector3d(
|
|||||||
|
|
||||||
operator fun times(value: Matrix4dStack) = times(value.last())
|
operator fun times(value: Matrix4dStack) = times(value.last())
|
||||||
|
|
||||||
|
fun toDoubleVector() = this
|
||||||
|
fun toFloatVector() = Vector3f(x.toFloat(), y.toFloat(), z.toFloat())
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField val ZERO = Vector3d()
|
@JvmField val ZERO = Vector3d()
|
||||||
@JvmField val POSITIVE_X = Vector3d(x = 1.0)
|
@JvmField val POSITIVE_X = Vector3d(x = 1.0)
|
||||||
|
@ -206,6 +206,7 @@ data class Vector3f(
|
|||||||
operator fun times(value: Matrix4fStack) = times(value.last())
|
operator fun times(value: Matrix4fStack) = times(value.last())
|
||||||
|
|
||||||
fun toDoubleVector() = Vector3d(x.toDouble(), y.toDouble(), z.toDouble())
|
fun toDoubleVector() = Vector3d(x.toDouble(), y.toDouble(), z.toDouble())
|
||||||
|
fun toFloatVector() = this
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField val ZERO = Vector3f()
|
@JvmField val ZERO = Vector3f()
|
||||||
|
@ -226,6 +226,9 @@ data class Vector4d(
|
|||||||
|
|
||||||
operator fun times(value: Matrix4dStack) = times(value.last())
|
operator fun times(value: Matrix4dStack) = times(value.last())
|
||||||
|
|
||||||
|
fun toDoubleVector() = this
|
||||||
|
fun toFloatVector() = Vector4f(x.toFloat(), y.toFloat(), z.toFloat(), w.toFloat())
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField val ZERO = Vector4d()
|
@JvmField val ZERO = Vector4d()
|
||||||
@JvmField val POSITIVE_X = Vector4d(x = 1.0)
|
@JvmField val POSITIVE_X = Vector4d(x = 1.0)
|
||||||
|
@ -229,6 +229,7 @@ data class Vector4f(
|
|||||||
operator fun times(value: Matrix4fStack) = times(value.last())
|
operator fun times(value: Matrix4fStack) = times(value.last())
|
||||||
|
|
||||||
fun toDoubleVector() = Vector4d(x.toDouble(), y.toDouble(), z.toDouble(), w.toDouble())
|
fun toDoubleVector() = Vector4d(x.toDouble(), y.toDouble(), z.toDouble(), w.toDouble())
|
||||||
|
fun toFloatVector() = this
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmField val ZERO = Vector4f()
|
@JvmField val ZERO = Vector4f()
|
||||||
|
Loading…
Reference in New Issue
Block a user