summaryrefslogtreecommitdiffstats
path: root/tests/fcpw/interaction.slang
blob: 3640016ebf0a41579c891036a4b90e490ca0b2e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
implementing fcpw;
__include math_constants;

public struct Interaction
{
    public float3 p;   // interaction point associated with query
    public float3 n;   // normal at interaction point
    public float2 uv;  // uv coordinates of interaction point
    public float d;    // distance to interaction point
    public uint index; // index of primitive/silhouette associated with interaction point

    // constructor
    public __init()
    {
        p = float3(0.0, 0.0, 0.0);
        n = float3(0.0, 0.0, 0.0);
        uv = float2(0.0, 0.0);
        d = FLT_MAX;
        index = UINT_MAX;
    }
};