diff -r f3abdaa2e8fb -r c005054bf4c1 include/shapes.h --- a/include/shapes.h Sun May 31 16:53:05 2009 +0200 +++ b/include/shapes.h Sun May 31 23:06:03 2009 +0200 @@ -69,12 +69,17 @@ #ifndef NO_SIMD virtual mfloat4 intersect_packet(const RayPacket &rays, mfloat4 &dists) const { - mfloat4 results; - ((int*)&results)[0] = intersect(rays[0], ((float*)&dists)[0]) ? -1 : 0; - ((int*)&results)[1] = intersect(rays[1], ((float*)&dists)[1]) ? -1 : 0; - ((int*)&results)[2] = intersect(rays[2], ((float*)&dists)[2]) ? -1 : 0; - ((int*)&results)[3] = intersect(rays[3], ((float*)&dists)[3]) ? -1 : 0; - return results; + union { + mfloat4 mresults; + int32_t results[4]; + }; + union { + mfloat4 m; + float arr[4]; + } d = { dists }; + for (int i = 0; i < 4; i++) + results[i] = intersect(rays[i], d.arr[i]) ? -1 : 0; + return mresults; }; #endif