summaryrefslogtreecommitdiffstats
path: root/nodes/common/mathhelper.qen
blob: e214f9ce6d6a268351c8746cf1c57f42114e28f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
    "QEN": {
        "description": "This node contains commonly used math defines and helper functions.",
        "fragmentCode": [
            "#define PI 3.14159265359",
            "#define TAU 6.28318530718",
            "#define SQRT2 1.41421356237",
            "",
            "mat2 rotate2d(float a) {",
            "    const float c = cos(a);",
            "    const float s = sin(a);",
            "    return mat2(c, -s, s, c);",
            "}",
            "@main"
        ],
        "name": "MathHelper",
        "version": 1
    }
}