Skip to content

Commit e7326b3

Browse files
gkmotulgritz
authored andcommitted
Updated vector2.h with a mod fuction: mod(vector2,vector2); (#1312)
This is useful when working with vec2 concepts through out shaders like UV data for example.
1 parent 571ac80 commit e7326b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/shaders/vector2.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,11 @@ vector2 min(vector2 a, float b)
242242
return min(a, vector2(b, b));
243243
}
244244

245+
vector2 mod(vector2 a, vector2 b)
246+
{
247+
return a-b*floor(a/b);
248+
}
249+
245250
vector2 fmod(vector2 a, vector2 b)
246251
{
247252
return vector2 (fmod(a.x, b.x),

0 commit comments

Comments
 (0)