Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/util/util_transform.cpp')
-rw-r--r--intern/cycles/util/util_transform.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/util/util_transform.cpp b/intern/cycles/util/util_transform.cpp
index 5c2f28af318..8c5eac2cbb9 100644
--- a/intern/cycles/util/util_transform.cpp
+++ b/intern/cycles/util/util_transform.cpp
@@ -129,13 +129,15 @@ static bool transform_matrix4_gj_inverse(float R[][4], float M[][4])
Transform transform_inverse(const Transform& tfm)
{
- Transform R = transform_identity();
- Transform M = tfm;
+ union { Transform T; float M[4][4]; } R, M;
+
+ R.T = transform_identity();
+ M.T = tfm;
- if(!transform_matrix4_gj_inverse((float(*)[4])&R, (float(*)[4])&M))
+ if(!transform_matrix4_gj_inverse(R.M, M.M))
return transform_identity();
- return R;
+ return R.T;
}
CCL_NAMESPACE_END