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

commonMain.dsl.functions.IntVector3Functions.kt Maven / Gradle / Ivy

package org.openrndr.orsl.shadergenerator.dsl.functions

import org.openrndr.orsl.shadergenerator.dsl.*
import org.openrndr.math.*
import kotlin.jvm.JvmName

@Suppress("INAPPLICABLE_JVM_NAME")
interface IntVector3unctions {

    @JvmName("absSiv3")
    fun abs(x: Symbol): Symbol = functionSymbol(x, "abs($0)")

    @JvmName("divVdSv3")
    operator fun Double.div(right: Symbol): Symbol = functionSymbol(this, right, "($0 / $1)")


    @JvmName("timesSiv3Vd")
    operator fun Symbol.times(right: Double): Symbol = functionSymbol(this, right, "($0 * $1)")

    @JvmName("timesSiv3Sd")
    operator fun Symbol.times(right: Symbol): Symbol =
        functionSymbol(this, right, "($0 * $1)")

    @JvmName("plusSiv3Siv3")
    operator fun Symbol.plus(right: Symbol): Symbol =
        functionSymbol(this, right, "($0 + $1)")

    @JvmName("plusSiv3Viv3")
    operator fun Symbol.plus(right: IntVector3): Symbol =
        functionSymbol(this, right, "($0 + $1)")


    val Symbol.x: Symbol
        @JvmName("xSiv3")
        get() = functionSymbol(this, "$0.x")
    val Symbol.y: Symbol
        @JvmName("ySiv3")
        get() = functionSymbol(this, "$0.y")

    val Symbol.z: Symbol
        @JvmName("zSiv3")
        get() = functionSymbol(this, "$0.z")

    val Symbol.xy: Symbol
        @JvmName("xySiv3")
        get() = functionSymbol(this, "$0.xy")
    val Symbol.yz: Symbol
        @JvmName("yzSiv3")
        get() = functionSymbol(this, "$0.yz")
    val Symbol.xz: Symbol
        @JvmName("xzSiv3")
        get() = functionSymbol(this, "$0.xz")

    val Symbol.double: Symbol
        @JvmName("doubleSiv3")
        get() = functionSymbol(this, "vec3($0)")

    @Suppress("FunctionName")
    @JvmName("ivec3SiSiSi")
    fun IntVector3(x: Symbol, y: Symbol, z: Symbol): Symbol =
        functionSymbol(x, y, z, "ivec3($0, $1, $2)")

}

val IntVector3.symbol: Symbol
    get() {
        return symbol(glsl(this)!!)
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy