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

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

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

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

@Suppress("INAPPLICABLE_JVM_NAME")
interface IntVector2Functions {

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

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


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

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


    val Symbol.x: Symbol
        @JvmName("xSiv2")
        get() = functionSymbol(this, "$0.x")
    val Symbol.y: Symbol
        @JvmName("ySiv2")
        get() = functionSymbol(this, "$0.y")
    val Symbol.yx: Symbol
        @JvmName("yxSiv2")
        get() = functionSymbol(this, "$0.yx")
    val Symbol.xx: Symbol
        @JvmName("xxSiv2")
        get() = functionSymbol(this, "$0.xx")

    @Suppress("FunctionName")
    @JvmName("ivec2SiSi")
    fun IntVector2(x: Symbol, y: Symbol): Symbol =
        functionSymbol(x, y, "ivec2($0, $1)")

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

    val Symbol.uint: Symbol
        @JvmName("uintSiv2")
        get() = functionSymbol(this, "uvec2($0)")


}

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy