208 |
|
|
209 |
STATIC_INLINE float dot2f (vec2f_t u, vec2f_t v) |
STATIC_INLINE float dot2f (vec2f_t u, vec2f_t v) |
210 |
{ |
{ |
211 |
union2f_t uv = (union2f_t)(u*v); |
union2f_t uv = __extension__ (union2f_t)(u*v); |
212 |
return uv.r[0] + uv.r[1]; |
return uv.r[0] + uv.r[1]; |
213 |
} |
} |
214 |
|
|
247 |
|
|
248 |
STATIC_INLINE float dot3f (vec3f_t u, vec3f_t v) |
STATIC_INLINE float dot3f (vec3f_t u, vec3f_t v) |
249 |
{ |
{ |
250 |
union3f_t uv = (union3f_t)(u*v); |
union3f_t uv = __extension__ (union3f_t)(u*v); |
251 |
return uv.r[0] + uv.r[1] + uv.r[2]; |
return uv.r[0] + uv.r[1] + uv.r[2]; |
252 |
} |
} |
253 |
|
|
277 |
|
|
278 |
STATIC_INLINE float dot4f (vec4f_t u, vec4f_t v) |
STATIC_INLINE float dot4f (vec4f_t u, vec4f_t v) |
279 |
{ |
{ |
280 |
union4f_t uv = (union4f_t)(u*v); |
union4f_t uv = __extension__ (union4f_t)(u*v); |
281 |
return uv.r[0] + uv.r[1] + uv.r[2] + uv.r[3]; |
return uv.r[0] + uv.r[1] + uv.r[2] + uv.r[3]; |
282 |
} |
} |
283 |
|
|
300 |
|
|
301 |
STATIC_INLINE vec3f_t Diderot_ToImageSpace3f (Diderot_image3D_t *img, vec3f_t posArg) |
STATIC_INLINE vec3f_t Diderot_ToImageSpace3f (Diderot_image3D_t *img, vec3f_t posArg) |
302 |
{ |
{ |
303 |
Diderot_Mat4x4_t *m = &(img->mInv); |
vec4f_t p = __extension__ vec4f( |
|
|
|
|
vec4f_t p = vec4f( |
|
304 |
((union3f_t)posArg).r[0], |
((union3f_t)posArg).r[0], |
305 |
((union3f_t)posArg).r[1], |
((union3f_t)posArg).r[1], |
306 |
((union3f_t)posArg).r[2], |
((union3f_t)posArg).r[2], |