diff options
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/transform.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/intern/cycles/util/transform.h b/intern/cycles/util/transform.h index 371dbb0f4aa..477272f0ba6 100644 --- a/intern/cycles/util/transform.h +++ b/intern/cycles/util/transform.h @@ -285,6 +285,21 @@ ccl_device_inline bool operator!=(const Transform &A, const Transform &B) return !(A == B); } +ccl_device_inline bool transform_equal_threshold(const Transform &A, + const Transform &B, + const float threshold) +{ + for (int x = 0; x < 3; x++) { + for (int y = 0; y < 4; y++) { + if (fabsf(A[x][y] - B[x][y]) > threshold) { + return false; + } + } + } + + return true; +} + ccl_device_inline float3 transform_get_column(const Transform *t, int column) { return make_float3(t->x[column], t->y[column], t->z[column]); |