148#if defined(GRAPHENE_USE_SSE)
151#define graphene_simd4x4f_transpose_in_place(s) \
153 _MM_TRANSPOSE4_PS ((s)->x, (s)->y, (s)->z, (s)->w); \
155#elif defined (_MSC_VER)
156#define graphene_simd4x4f_transpose_in_place(s) \
157 _MM_TRANSPOSE4_PS ((s)->x, (s)->y, (s)->z, (s)->w)
160#elif defined(GRAPHENE_USE_GCC)
162#define graphene_simd4x4f_transpose_in_place(s) \
164 const graphene_simd4f_t sx = (s)->x; \
165 const graphene_simd4f_t sy = (s)->y; \
166 const graphene_simd4f_t sz = (s)->z; \
167 const graphene_simd4f_t sw = (s)->w; \
168 (s)->x = graphene_simd4f_init (sx[0], sy[0], sz[0], sw[0]); \
169 (s)->y = graphene_simd4f_init (sx[1], sy[1], sz[1], sw[1]); \
170 (s)->z = graphene_simd4f_init (sx[2], sy[2], sz[2], sw[2]); \
171 (s)->w = graphene_simd4f_init (sx[3], sy[3], sz[3], sw[3]); \
174#elif defined(GRAPHENE_USE_ARM_NEON)
178#define graphene_simd4x4f_transpose_in_place(s) \
180 const graphene_simd4f_union_t sx = { (s)->x }; \
181 const graphene_simd4f_union_t sy = { (s)->y }; \
182 const graphene_simd4f_union_t sz = { (s)->z }; \
183 const graphene_simd4f_union_t sw = { (s)->w }; \
184 (s)->x = graphene_simd4f_init (sx.f[0], sy.f[0], sz.f[0], sw.f[0]); \
185 (s)->y = graphene_simd4f_init (sx.f[1], sy.f[1], sz.f[1], sw.f[1]); \
186 (s)->z = graphene_simd4f_init (sx.f[2], sy.f[2], sz.f[2], sw.f[2]); \
187 (s)->w = graphene_simd4f_init (sx.f[3], sy.f[3], sz.f[3], sw.f[3]); \
190# elif defined (_MSC_VER)
192#define graphene_simd4x4f_transpose_in_place(s) _simd4x4f_transpose_in_place(s)
196 const graphene_simd4f_union_t sx = { (
s)->x };
197 const graphene_simd4f_union_t sy = { (
s)->y };
198 const graphene_simd4f_union_t sz = { (
s)->z };
199 const graphene_simd4f_union_t sw = { (
s)->w };
208#elif defined(GRAPHENE_USE_SCALAR)
210#define graphene_simd4x4f_transpose_in_place(s) \
211 (graphene_simd4x4f_transpose_in_place ((graphene_simd4x4f_t *) (s)))
214# error "No implementation for graphene_simd4x4f_t defined."
566 float delta_z = z_far - z_near;
569 float a = cotangent / aspect;
571 float c = -(z_far + z_near) / delta_z;
572 float d = -2 * z_near * z_far / delta_z;
604 float delta_y = top - bottom;
605 float delta_z = z_far - z_near;
607 float a = 2.0f / delta_x;
609 float c = 2.0f / delta_y;
610 float d = -(top + bottom) / delta_y;
611 float e = -2.0f / delta_z;
612 float f = -(z_far + z_near) / delta_z;
705 float y = 2.f * z_near / (top - bottom);
708 float b = (top + bottom) / (top - bottom);
709 float c = -1.f * (z_far + z_near) / (z_far - z_near);
710 float d = -2.f * z_far * z_near / (z_far - z_near);
854 ab = x * y * (1.0f - cosine);
855 bc = y * z * (1.0f - cosine);
856 ca = z * x * (1.0f - cosine);
1115 if (invdet_r !=
NULL)
1167 if (!(fabsf (f[0]) < FLT_EPSILON &&
1168 fabsf (f[1]) < FLT_EPSILON &&
1169 1.f - fabsf (f[2]) < FLT_EPSILON &&
1170 fabsf (f[3]) < FLT_EPSILON))
#define GRAPHENE_END_DECLS
#define GRAPHENE_VECTORCALL
#define GRAPHENE_BEGIN_DECLS
#define graphene_simd4f_get_y(s)
#define graphene_simd4f_shuffle_wxyz(s)
#define graphene_simd4f_cmp_eq(a, b)
static graphene_simd4f_t graphene_simd4f_normalize3(const graphene_simd4f_t v)
#define graphene_simd4f_zero_w(v)
#define graphene_simd4f_neg(s)
#define graphene_simd4f_mul(a, b)
#define graphene_simd4f_shuffle_zwxy(s)
#define graphene_simd4f_merge_w(s, v)
static float graphene_simd4f_sum_scalar(const graphene_simd4f_t v)
#define graphene_simd4f_splat_z(s)
#define graphene_simd4f_flip_sign_1010(s)
#define graphene_simd4f_dup_4f(s, v)
#define graphene_simd4f_splat_y(s)
#define graphene_simd4f_merge_high(a, b)
#define graphene_simd4f_get_x(s)
#define graphene_simd4f_init_4f(v)
#define graphene_simd4f_get_z(s)
#define graphene_simd4f_splat_x(s)
static graphene_simd4f_t graphene_simd4f_sum(const graphene_simd4f_t v)
#define graphene_simd4f_dot3(a, b)
#define graphene_simd4f_init(x, y, z, w)
#define graphene_simd4f_splat(v)
static graphene_simd4f_t graphene_simd4f_madd(const graphene_simd4f_t m1, const graphene_simd4f_t m2, const graphene_simd4f_t a)
#define graphene_simd4f_flip_sign_0101(s)
#define graphene_simd4f_get_w(s)
#define graphene_simd4f_reciprocal(s)
#define graphene_simd4f_div(a, b)
#define graphene_simd4f_shuffle_yzwx(s)
#define graphene_simd4f_sub(a, b)
#define graphene_simd4f_splat_w(s)
#define graphene_simd4f_cross3(a, b)
#define graphene_simd4f_add(a, b)
static void graphene_simd4x4f_inv_ortho_vec3_mul(const graphene_simd4x4f_t *a, const graphene_simd4f_t *b, graphene_simd4f_t *res)
static void graphene_simd4x4f_to_float(const graphene_simd4x4f_t *m, float *v)
static void graphene_simd4x4f_div(const graphene_simd4x4f_t *a, const graphene_simd4x4f_t *b, graphene_simd4x4f_t *res)
static void graphene_simd4x4f_determinant(const graphene_simd4x4f_t *m, graphene_simd4f_t *det_r, graphene_simd4f_t *invdet_r)
static void graphene_simd4x4f_init_ortho(graphene_simd4x4f_t *m, float left, float right, float bottom, float top, float z_near, float z_far)
static void graphene_simd4x4f_init_frustum(graphene_simd4x4f_t *m, float left, float right, float bottom, float top, float z_near, float z_far)
static void graphene_simd4x4f_sub(const graphene_simd4x4f_t *a, const graphene_simd4x4f_t *b, graphene_simd4x4f_t *res)
static void graphene_simd4x4f_sum(const graphene_simd4x4f_t *a, graphene_simd4f_t *res)
static bool graphene_simd4x4f_inverse(const graphene_simd4x4f_t *m, graphene_simd4x4f_t *res)
static void graphene_simd4x4f_mul(const graphene_simd4x4f_t *a, const graphene_simd4x4f_t *b, graphene_simd4x4f_t *res)
static void graphene_simd4x4f_perspective(graphene_simd4x4f_t *m, float depth)
static GRAPHENE_BEGIN_DECLS graphene_simd4x4f_t GRAPHENE_VECTORCALL graphene_simd4x4f_init(graphene_simd4f_t x, graphene_simd4f_t y, graphene_simd4f_t z, graphene_simd4f_t w)
static void graphene_simd4x4f_init_perspective(graphene_simd4x4f_t *m, float fovy_rad, float aspect, float z_near, float z_far)
static void graphene_simd4x4f_vec3_mul(const graphene_simd4x4f_t *m, const graphene_simd4f_t *v, graphene_simd4f_t *res)
static bool graphene_simd4x4f_is_identity(const graphene_simd4x4f_t *m)
static void graphene_simd4x4f_transpose(const graphene_simd4x4f_t *s, graphene_simd4x4f_t *res)
#define graphene_simd4x4f_transpose_in_place(s)
static void graphene_simd4x4f_matrix_mul(const graphene_simd4x4f_t *a, const graphene_simd4x4f_t *b, graphene_simd4x4f_t *res)
static void graphene_simd4x4f_init_look_at(graphene_simd4x4f_t *m, graphene_simd4f_t eye, graphene_simd4f_t center, graphene_simd4f_t up)
static void graphene_simd4x4f_point3_mul(const graphene_simd4x4f_t *m, const graphene_simd4f_t *p, graphene_simd4f_t *res)
static void graphene_simd4x4f_translation(graphene_simd4x4f_t *m, float x, float y, float z)
static void graphene_simd4x4f_init_from_float(graphene_simd4x4f_t *m, const float *f)
static void graphene_simd4x4f_rotation(graphene_simd4x4f_t *m, float rad, graphene_simd4f_t axis)
static void graphene_simd4x4f_vec4_mul(const graphene_simd4x4f_t *a, const graphene_simd4f_t *b, graphene_simd4f_t *res)
static bool graphene_simd4x4f_is_2d(const graphene_simd4x4f_t *m)
static void graphene_simd4x4f_add(const graphene_simd4x4f_t *a, const graphene_simd4x4f_t *b, graphene_simd4x4f_t *res)
static void graphene_simd4x4f_scale(graphene_simd4x4f_t *m, float x, float y, float z)
static void graphene_simd4x4f_inv_ortho_point3_mul(const graphene_simd4x4f_t *a, const graphene_simd4f_t *b, graphene_simd4f_t *res)
static void graphene_simd4x4f_init_identity(graphene_simd4x4f_t *m)
#define GRAPHENE_AVAILABLE_IN_1_0
CURL_EXTERN CURLMcode curl_socket_t s