It was observed previously that sometimes an out of error index would be encountered when looking up a texture frame for motion clouds. This was because the WrapValue operator was not implemented correctly and when the input was equal to the negative of the number of texture frames, the calculated wrapped value would be out of bounds.
This PR updates the WrapValue operator to perform index wrapping properly.
One realisation here was that the % operator in C# does not behave as a modulus (as in Python) but instead does the remainder operation. A modulus function is also implemented in the WrapValue operator with the same behaviour as the Python % operator.
This PR fixes issue #89
It was observed previously that sometimes an out of error index would be encountered when looking up a texture frame for motion clouds. This was because the WrapValue operator was not implemented correctly and when the input was equal to the negative of the number of texture frames, the calculated wrapped value would be out of bounds.
This PR updates the WrapValue operator to perform index wrapping properly.
One realisation here was that the % operator in C# does not behave as a modulus (as in Python) but instead does the remainder operation. A modulus function is also implemented in the WrapValue operator with the same behaviour as the Python % operator.