Data Structures | Typedefs | Functions
Quaternion

Data Structures

struct  _Eina_Quaternion
 
struct  _Eina_Quaternion_F16p16
 
struct  _Eina_Point_3D
 
struct  _Eina_Point_3D_F16p16
 

Typedefs

typedef struct _Eina_Quaternion_F16p16 Eina_Quaternion_F16p16
 
typedef struct _Eina_Quaternion Eina_Quaternion
 
typedef struct _Eina_Point_3D Eina_Point_3D
 
typedef struct _Eina_Point_3D_F16p16 Eina_Point_3D_F16p16
 

Functions

EINA_API void eina_quaternion_f16p16_set (Eina_Quaternion *out, Eina_F16p16 x, Eina_F16p16 y, Eina_F16p16 z, Eina_F16p16 w)
 
EINA_API Eina_F16p16 eina_quaternion_f16p16_norm (const Eina_Quaternion_F16p16 *q)
 
EINA_API void eina_quaternion_f16p16_negative (Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *in)
 
EINA_API void eina_quaternion_f16p16_add (Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *a, const Eina_Quaternion_F16p16 *b)
 
EINA_API void eina_quaternion_f16p16_mul (Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *a, const Eina_Quaternion_F16p16 *b)
 
EINA_API void eina_quaternion_f16p16_scale (Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *a, Eina_F16p16 b)
 
EINA_API void eina_quaternion_f16p16_conjugate (Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *in)
 
EINA_API Eina_F16p16 eina_quaternion_f16p16_dot (const Eina_Quaternion_F16p16 *a, const Eina_Quaternion_F16p16 *b)
 
EINA_API void eina_quaternion_f16p16_lerp (Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *a, const Eina_Quaternion_F16p16 *b, Eina_F16p16 pos)
 
EINA_API void eina_quaternion_f16p16_slerp (Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *a, const Eina_Quaternion_F16p16 *b, Eina_F16p16 pos)
 
EINA_API void eina_quaternion_f16p16_nlerp (Eina_Quaternion_F16p16 *out, const Eina_Quaternion_F16p16 *a, const Eina_Quaternion_F16p16 *b, Eina_F16p16 pos)
 
EINA_API void eina_quaternion_f16p16_rotate (Eina_Point_3D_F16p16 *p, const Eina_Point_3D_F16p16 *center, const Eina_Quaternion_F16p16 *q)
 
EINA_API void eina_quaternion_f16p16_rotation_matrix3_get (Eina_Matrix3_F16p16 *m, const Eina_Quaternion_F16p16 *q)
 
EINA_API void eina_quaternion_set (Eina_Quaternion *q, double x, double y, double z, double w)
 
EINA_API double eina_quaternion_norm (const Eina_Quaternion *q)
 
EINA_API void eina_quaternion_negative (Eina_Quaternion *out, const Eina_Quaternion *in)
 
EINA_API void eina_quaternion_add (Eina_Quaternion *out, const Eina_Quaternion *a, const Eina_Quaternion *b)
 
EINA_API void eina_quaternion_mul (Eina_Quaternion *out, const Eina_Quaternion *a, const Eina_Quaternion *b)
 
EINA_API void eina_quaternion_scale (Eina_Quaternion *out, const Eina_Quaternion *a, double b)
 
EINA_API void eina_quaternion_conjugate (Eina_Quaternion *out, const Eina_Quaternion *in)
 
EINA_API double eina_quaternion_dot (const Eina_Quaternion *a, const Eina_Quaternion *b)
 
EINA_API void eina_quaternion_normalized (Eina_Quaternion *out, const Eina_Quaternion *in)
 
EINA_API void eina_quaternion_lerp (Eina_Quaternion *out, const Eina_Quaternion *a, const Eina_Quaternion *b, double pos)
 
EINA_API void eina_quaternion_slerp (Eina_Quaternion *out, const Eina_Quaternion *a, const Eina_Quaternion *b, double pos)
 
EINA_API void eina_quaternion_nlerp (Eina_Quaternion *out, const Eina_Quaternion *a, const Eina_Quaternion *b, double pos)
 
EINA_API void eina_quaternion_rotate (Eina_Point_3D *p, const Eina_Point_3D *center, const Eina_Quaternion *q)
 
EINA_API void eina_quaternion_rotation_matrix3_get (Eina_Matrix3 *m, const Eina_Quaternion *q)
 
EINA_API void eina_matrix3_quaternion_get (Eina_Quaternion *q, const Eina_Matrix3 *m)
 
EINA_API Eina_Bool eina_matrix4_quaternion_to (Eina_Quaternion *rotation, Eina_Quaternion *perspective, Eina_Point_3D *translation, Eina_Point_3D *scale, Eina_Point_3D *skew, const Eina_Matrix4 *m)
 
EINA_API void eina_quaternion_matrix4_to (Eina_Matrix4 *m, const Eina_Quaternion *rotation, const Eina_Quaternion *perspective, const Eina_Point_3D *translation, const Eina_Point_3D *scale, const Eina_Point_3D *skew)
 
EINA_API void eina_quaternion_inverse (Eina_Quaternion *out, const Eina_Quaternion *q)
 Compute the inverse of the given quaternion. More...
 
EINA_API void eina_quaternion_array_set (Eina_Quaternion *dst, const double *v)
 Set array to quaternion. More...
 
EINA_API void eina_quaternion_copy (Eina_Quaternion *dst, const Eina_Quaternion *src)
 Copy quaternion. More...
 
EINA_API void eina_quaternion_homogeneous_regulate (Eina_Quaternion *out, const Eina_Quaternion *v)
 Homogeneous quaternion. More...
 
EINA_API void eina_quaternion_subtract (Eina_Quaternion *out, const Eina_Quaternion *a, const Eina_Quaternion *b)
 Subtract two quaternions. More...
 
EINA_API double eina_quaternion_length_get (const Eina_Quaternion *v)
 Return the length of the given quaternion. More...
 
EINA_API double eina_quaternion_length_square_get (const Eina_Quaternion *v)
 Return the length in square of the given quaternion. More...
 
EINA_API double eina_quaternion_distance_get (const Eina_Quaternion *a, const Eina_Quaternion *b)
 Return the distance between of two quaternions. More...
 
EINA_API double eina_quaternion_distance_square_get (const Eina_Quaternion *a, const Eina_Quaternion *b)
 Return the distance in square between of two quaternions. More...
 
EINA_API void eina_quaternion_transform (Eina_Quaternion *out, const Eina_Quaternion *v, const Eina_Matrix4 *m)
 Transform quaternion. More...
 
EINA_API double eina_quaternion_angle_plains (Eina_Quaternion *a, Eina_Quaternion *b)
 Return the angle plains between of two quaternions. More...
 

Detailed Description

Function Documentation

◆ eina_quaternion_f16p16_set()

EINA_API void eina_quaternion_f16p16_set ( Eina_Quaternion out,
Eina_F16p16  x,
Eina_F16p16  y,
Eina_F16p16  z,
Eina_F16p16  w 
)
Since
1.15

◆ eina_quaternion_f16p16_norm()

EINA_API Eina_F16p16 eina_quaternion_f16p16_norm ( const Eina_Quaternion_F16p16 q)

◆ eina_quaternion_f16p16_negative()

EINA_API void eina_quaternion_f16p16_negative ( Eina_Quaternion_F16p16 out,
const Eina_Quaternion_F16p16 in 
)

◆ eina_quaternion_f16p16_add()

EINA_API void eina_quaternion_f16p16_add ( Eina_Quaternion_F16p16 out,
const Eina_Quaternion_F16p16 a,
const Eina_Quaternion_F16p16 b 
)

◆ eina_quaternion_f16p16_mul()

EINA_API void eina_quaternion_f16p16_mul ( Eina_Quaternion_F16p16 out,
const Eina_Quaternion_F16p16 a,
const Eina_Quaternion_F16p16 b 
)

◆ eina_quaternion_f16p16_scale()

EINA_API void eina_quaternion_f16p16_scale ( Eina_Quaternion_F16p16 out,
const Eina_Quaternion_F16p16 a,
Eina_F16p16  b 
)

◆ eina_quaternion_f16p16_conjugate()

EINA_API void eina_quaternion_f16p16_conjugate ( Eina_Quaternion_F16p16 out,
const Eina_Quaternion_F16p16 in 
)
Since
1.15

References eina_f16p16_sub().

◆ eina_quaternion_f16p16_dot()

EINA_API Eina_F16p16 eina_quaternion_f16p16_dot ( const Eina_Quaternion_F16p16 a,
const Eina_Quaternion_F16p16 b 
)

◆ eina_quaternion_f16p16_lerp()

EINA_API void eina_quaternion_f16p16_lerp ( Eina_Quaternion_F16p16 out,
const Eina_Quaternion_F16p16 a,
const Eina_Quaternion_F16p16 b,
Eina_F16p16  pos 
)

◆ eina_quaternion_f16p16_slerp()

EINA_API void eina_quaternion_f16p16_slerp ( Eina_Quaternion_F16p16 out,
const Eina_Quaternion_F16p16 a,
const Eina_Quaternion_F16p16 b,
Eina_F16p16  pos 
)

◆ eina_quaternion_f16p16_nlerp()

EINA_API void eina_quaternion_f16p16_nlerp ( Eina_Quaternion_F16p16 out,
const Eina_Quaternion_F16p16 a,
const Eina_Quaternion_F16p16 b,
Eina_F16p16  pos 
)

◆ eina_quaternion_f16p16_rotate()

EINA_API void eina_quaternion_f16p16_rotate ( Eina_Point_3D_F16p16 p,
const Eina_Point_3D_F16p16 center,
const Eina_Quaternion_F16p16 q 
)

◆ eina_quaternion_f16p16_rotation_matrix3_get()

EINA_API void eina_quaternion_f16p16_rotation_matrix3_get ( Eina_Matrix3_F16p16 m,
const Eina_Quaternion_F16p16 q 
)

◆ eina_quaternion_norm()

EINA_API double eina_quaternion_norm ( const Eina_Quaternion q)
Since
1.15

Referenced by eina_quaternion_normalized().

◆ eina_quaternion_negative()

EINA_API void eina_quaternion_negative ( Eina_Quaternion out,
const Eina_Quaternion in 
)
Since
1.15

Referenced by eina_quaternion_nlerp(), and eina_quaternion_slerp().

◆ eina_quaternion_add()

EINA_API void eina_quaternion_add ( Eina_Quaternion out,
const Eina_Quaternion a,
const Eina_Quaternion b 
)
Since
1.15

Referenced by eina_quaternion_nlerp(), and eina_quaternion_slerp().

◆ eina_quaternion_mul()

EINA_API void eina_quaternion_mul ( Eina_Quaternion out,
const Eina_Quaternion a,
const Eina_Quaternion b 
)
Since
1.15

◆ eina_quaternion_scale()

EINA_API void eina_quaternion_scale ( Eina_Quaternion out,
const Eina_Quaternion a,
double  b 
)

◆ eina_quaternion_conjugate()

EINA_API void eina_quaternion_conjugate ( Eina_Quaternion out,
const Eina_Quaternion in 
)
Since
1.15

◆ eina_quaternion_dot()

EINA_API double eina_quaternion_dot ( const Eina_Quaternion a,
const Eina_Quaternion b 
)
Since
1.15

Referenced by eina_quaternion_nlerp(), and eina_quaternion_slerp().

◆ eina_quaternion_normalized()

EINA_API void eina_quaternion_normalized ( Eina_Quaternion out,
const Eina_Quaternion in 
)
Since
1.15

References eina_quaternion_norm(), and eina_quaternion_scale().

Referenced by eina_quaternion_nlerp().

◆ eina_quaternion_lerp()

EINA_API void eina_quaternion_lerp ( Eina_Quaternion out,
const Eina_Quaternion a,
const Eina_Quaternion b,
double  pos 
)
Since
1.15

References EINA_DBL_EQ.

◆ eina_quaternion_slerp()

EINA_API void eina_quaternion_slerp ( Eina_Quaternion out,
const Eina_Quaternion a,
const Eina_Quaternion b,
double  pos 
)

◆ eina_quaternion_nlerp()

EINA_API void eina_quaternion_nlerp ( Eina_Quaternion out,
const Eina_Quaternion a,
const Eina_Quaternion b,
double  pos 
)

◆ eina_quaternion_rotate()

EINA_API void eina_quaternion_rotate ( Eina_Point_3D p,
const Eina_Point_3D center,
const Eina_Quaternion q 
)
Since
1.15

◆ eina_quaternion_rotation_matrix3_get()

EINA_API void eina_quaternion_rotation_matrix3_get ( Eina_Matrix3 m,
const Eina_Quaternion q 
)
Since
1.15

◆ eina_matrix3_quaternion_get()

EINA_API void eina_matrix3_quaternion_get ( Eina_Quaternion q,
const Eina_Matrix3 m 
)
Since
1.15

◆ eina_matrix4_quaternion_to()

EINA_API Eina_Bool eina_matrix4_quaternion_to ( Eina_Quaternion rotation,
Eina_Quaternion perspective,
Eina_Point_3D translation,
Eina_Point_3D scale,
Eina_Point_3D skew,
const Eina_Matrix4 m 
)

◆ eina_quaternion_matrix4_to()

EINA_API void eina_quaternion_matrix4_to ( Eina_Matrix4 m,
const Eina_Quaternion rotation,
const Eina_Quaternion perspective,
const Eina_Point_3D translation,
const Eina_Point_3D scale,
const Eina_Point_3D skew 
)

◆ eina_quaternion_inverse()

EINA_API void eina_quaternion_inverse ( Eina_Quaternion out,
const Eina_Quaternion q 
)

Compute the inverse of the given quaternion.

Parameters
[out]outThe quaternion to invert.
[in]qThe quaternion matrix.

This function inverses the quaternion q and stores the result in out.

Since
1.17

◆ eina_quaternion_array_set()

EINA_API void eina_quaternion_array_set ( Eina_Quaternion dst,
const double *  v 
)

Set array to quaternion.

Parameters
[out]dstThe result quaternion
[in]vThe the array[4] for set

Set to quaternion first 4 elements from array

Since
1.17

◆ eina_quaternion_copy()

EINA_API void eina_quaternion_copy ( Eina_Quaternion dst,
const Eina_Quaternion src 
)

Copy quaternion.

Parameters
[out]dstThe quaternion copy
[in]srcThe quaternion for copy.
Since
1.17

Referenced by eina_quaternion_transform().

◆ eina_quaternion_homogeneous_regulate()

EINA_API void eina_quaternion_homogeneous_regulate ( Eina_Quaternion out,
const Eina_Quaternion v 
)

Homogeneous quaternion.

Parameters
[out]outThe resulting quaternion
[in]vThe given quaternion
Since
1.17

References EINA_DBL_EQ.

◆ eina_quaternion_subtract()

EINA_API void eina_quaternion_subtract ( Eina_Quaternion out,
const Eina_Quaternion a,
const Eina_Quaternion b 
)

Subtract two quaternions.

Parameters
[out]outThe resulting quaternion
[in]aThe first member of the subtract
[in]bThe second member of the subtract
Since
1.17

Referenced by eina_quaternion_distance_get(), and eina_quaternion_distance_square_get().

◆ eina_quaternion_length_get()

EINA_API double eina_quaternion_length_get ( const Eina_Quaternion v)

Return the length of the given quaternion.

Parameters
[out]vThe quaternion.
Returns
The length.
Since
1.17

Referenced by eina_quaternion_distance_get().

◆ eina_quaternion_length_square_get()

EINA_API double eina_quaternion_length_square_get ( const Eina_Quaternion v)

Return the length in square of the given quaternion.

Parameters
[out]vThe quaternion.
Returns
The length in square.
Since
1.17

Referenced by eina_quaternion_distance_square_get().

◆ eina_quaternion_distance_get()

EINA_API double eina_quaternion_distance_get ( const Eina_Quaternion a,
const Eina_Quaternion b 
)

Return the distance between of two quaternions.

Parameters
[in]aThe first quaternion.
[in]bThe second quaternion.
Returns
The distance.
Since
1.17

References eina_quaternion_length_get(), and eina_quaternion_subtract().

◆ eina_quaternion_distance_square_get()

EINA_API double eina_quaternion_distance_square_get ( const Eina_Quaternion a,
const Eina_Quaternion b 
)

Return the distance in square between of two quaternions.

Parameters
[in]aThe first quaternion.
[in]bThe second quaternion.
Returns
The distance in square.
Since
1.17

References eina_quaternion_length_square_get(), and eina_quaternion_subtract().

◆ eina_quaternion_transform()

EINA_API void eina_quaternion_transform ( Eina_Quaternion out,
const Eina_Quaternion v,
const Eina_Matrix4 m 
)

Transform quaternion.

Parameters
[out]outThe result quaternion.
[in]vThe quaternion for transform.
[in]mThe matrix for transform.
Since
1.17

References eina_matrix4_type_get(), EINA_MATRIX_TYPE_IDENTITY, and eina_quaternion_copy().

◆ eina_quaternion_angle_plains()

EINA_API double eina_quaternion_angle_plains ( Eina_Quaternion a,
Eina_Quaternion b 
)

Return the angle plains between of two quaternions.

Parameters
[in]aThe first quaternion.
[in]bThe second quaternion.
Returns
The angle.
Since
1.17