31typedef float __attribute__((ext_vector_type(4))) VuoPoint4d;
35#define VuoList_VuoPoint4d_TYPE_DEFINED
42#define VuoPoint4d_SUPPORTS_COMPARISON
67static inline VuoPoint4d
VuoPoint4d_make(
float x,
float y,
float z,
float w) __attribute__((
const));
70 return (VuoPoint4d){x, y, z, w};
80 return (VuoPoint4d){ f[0], f[1], f[2], f[3] };
101static inline VuoPoint3d
VuoPoint4d_to3d(VuoPoint4d p) __attribute__((
const));
104 return (VuoPoint3d){p.x, p.y, p.z};
112static inline VuoPoint4d
VuoPoint3d_to4d1(VuoPoint3d p) __attribute__((
const));
115 return (VuoPoint4d){p.x, p.y, p.z, 1};
138 return u.x*v.x + u.y*v.y + u.z*v.z + u.w*v.w;
148 return sqrtf(a.x*a.x + a.y*a.y + a.z*a.z + a.w*a.w);
157 VuoPoint3d p = a.xyz / sqrtf(a.x * a.x + a.y * a.y + a.z * a.z);
158 return (VuoPoint4d){p.x, p.y, p.z, a.w};
167 return a / sqrtf(a.x * a.x + a.y * a.y + a.z * a.z + a.w * a.w);
173static inline VuoPoint4d
VuoPoint4d_add(VuoPoint4d a, VuoPoint4d b) __attribute__((
const));
182static inline VuoPoint4d
VuoPoint4d_subtract(VuoPoint4d a, VuoPoint4d b) __attribute__((
const));
194 return (a.x*a.x + a.y*a.y + a.z*a.z + a.w*a.w);
201static inline VuoPoint4d
VuoPoint4d_divide(VuoPoint4d a, VuoPoint4d b) __attribute__((
const));
219static inline VuoPoint4d
VuoPoint4d_scale(VuoPoint4d a, VuoPoint4d b) __attribute__((
const));
231 if (fabs(a.x) < 0.000001)
232 a.x = copysign(0.000001, a.x);
233 if (fabs(a.y) < 0.000001)
234 a.y = copysign(0.000001, a.y);
235 if (fabs(a.z) < 0.000001)
236 a.z = copysign(0.000001, a.z);
237 if (fabs(a.w) < 0.000001)
238 a.w = copysign(0.000001, a.w);
248 return sqrtf((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) + (a.z-b.z)*(a.z-b.z) + (a.w-b.w)*(a.w-b.w));
254static inline VuoPoint4d
VuoPoint4d_min(
const VuoPoint4d l,
const VuoPoint4d r) __attribute__((
const));
267static inline VuoPoint4d
VuoPoint4d_max(
const VuoPoint4d l,
const VuoPoint4d r) __attribute__((
const));
280static inline VuoPoint4d
VuoPoint4d_snap(VuoPoint4d a, VuoPoint4d center, VuoPoint4d snap) __attribute__((
const));
281static inline VuoPoint4d
VuoPoint4d_snap(VuoPoint4d a, VuoPoint4d center, VuoPoint4d snap)
284 return (VuoPoint4d) {
285 center.x + nonzeroSnap.x * (int)round((a.x-center.x) / nonzeroSnap.x),
286 center.y + nonzeroSnap.y * (
int)round((a.y-center.y) / nonzeroSnap.y),
287 center.z + nonzeroSnap.z * (int)round((a.z-center.z) / nonzeroSnap.z),
288 center.w + nonzeroSnap.w * (
int)round((a.w-center.w) / nonzeroSnap.w)
296static inline VuoPoint4d
VuoPoint4d_clampn(VuoPoint4d point, VuoPoint4d limitA, VuoPoint4d limitB)