• Home
  • Raw
  • Download

Lines Matching refs:q

12     rsQuaternionAdd(rs_quaternion* q, const rs_quaternion* rhs) {  in rsQuaternionAdd()  argument
13 q->w += rhs->w; in rsQuaternionAdd()
14 q->x += rhs->x; in rsQuaternionAdd()
15 q->y += rhs->y; in rsQuaternionAdd()
16 q->z += rhs->z; in rsQuaternionAdd()
20 rsQuaternionConjugate(rs_quaternion* q) { in rsQuaternionConjugate() argument
21 q->x = -q->x; in rsQuaternionConjugate()
22 q->y = -q->y; in rsQuaternionConjugate()
23 q->z = -q->z; in rsQuaternionConjugate()
32 rsQuaternionGetMatrixUnit(rs_matrix4x4* m, const rs_quaternion* q) { in rsQuaternionGetMatrixUnit() argument
33 float xx = q->x * q->x; in rsQuaternionGetMatrixUnit()
34 float xy = q->x * q->y; in rsQuaternionGetMatrixUnit()
35 float xz = q->x * q->z; in rsQuaternionGetMatrixUnit()
36 float xw = q->x * q->w; in rsQuaternionGetMatrixUnit()
37 float yy = q->y * q->y; in rsQuaternionGetMatrixUnit()
38 float yz = q->y * q->z; in rsQuaternionGetMatrixUnit()
39 float yw = q->y * q->w; in rsQuaternionGetMatrixUnit()
40 float zz = q->z * q->z; in rsQuaternionGetMatrixUnit()
41 float zw = q->z * q->w; in rsQuaternionGetMatrixUnit()
57 rsQuaternionLoadRotateUnit(rs_quaternion* q, float rot, float x, float y, float z) { in rsQuaternionLoadRotateUnit() argument
62 q->w = c; in rsQuaternionLoadRotateUnit()
63 q->x = x * s; in rsQuaternionLoadRotateUnit()
64 q->y = y * s; in rsQuaternionLoadRotateUnit()
65 q->z = z * s; in rsQuaternionLoadRotateUnit()
69 rsQuaternionSet(rs_quaternion* q, float w, float x, float y, float z) { in rsQuaternionSet() argument
70 q->w = w; in rsQuaternionSet()
71 q->x = x; in rsQuaternionSet()
72 q->y = y; in rsQuaternionSet()
73 q->z = z; in rsQuaternionSet()
77 rsQuaternionSet(rs_quaternion* q, const rs_quaternion* rhs) { in rsQuaternionSet() argument
78 q->w = rhs->w; in rsQuaternionSet()
79 q->x = rhs->x; in rsQuaternionSet()
80 q->y = rhs->y; in rsQuaternionSet()
81 q->z = rhs->z; in rsQuaternionSet()
85 rsQuaternionLoadRotate(rs_quaternion* q, float rot, float x, float y, float z) { in rsQuaternionLoadRotate() argument
93 rsQuaternionLoadRotateUnit(q, rot, x, y, z); in rsQuaternionLoadRotate()
97 rsQuaternionNormalize(rs_quaternion* q) { in rsQuaternionNormalize() argument
98 const float len = rsQuaternionDot(q, q); in rsQuaternionNormalize()
101 q->w *= recipLen; in rsQuaternionNormalize()
102 q->x *= recipLen; in rsQuaternionNormalize()
103 q->y *= recipLen; in rsQuaternionNormalize()
104 q->z *= recipLen; in rsQuaternionNormalize()
109 rsQuaternionMultiply(rs_quaternion* q, float scalar) { in rsQuaternionMultiply() argument
110 q->w *= scalar; in rsQuaternionMultiply()
111 q->x *= scalar; in rsQuaternionMultiply()
112 q->y *= scalar; in rsQuaternionMultiply()
113 q->z *= scalar; in rsQuaternionMultiply()
117 rsQuaternionMultiply(rs_quaternion* q, const rs_quaternion* rhs) { in rsQuaternionMultiply() argument
119 rsQuaternionSet(&qtmp, q); in rsQuaternionMultiply()
121 q->w = qtmp.w*rhs->w - qtmp.x*rhs->x - qtmp.y*rhs->y - qtmp.z*rhs->z; in rsQuaternionMultiply()
122 q->x = qtmp.w*rhs->x + qtmp.x*rhs->w + qtmp.y*rhs->z - qtmp.z*rhs->y; in rsQuaternionMultiply()
123 q->y = qtmp.w*rhs->y + qtmp.y*rhs->w + qtmp.z*rhs->x - qtmp.x*rhs->z; in rsQuaternionMultiply()
124 q->z = qtmp.w*rhs->z + qtmp.z*rhs->w + qtmp.x*rhs->y - qtmp.y*rhs->x; in rsQuaternionMultiply()
125 rsQuaternionNormalize(q); in rsQuaternionMultiply()
129 rsQuaternionSlerp(rs_quaternion* q, const rs_quaternion* q0, const rs_quaternion* q1, float t) { in rsQuaternionSlerp() argument
131 rsQuaternionSet(q, q0); in rsQuaternionSlerp()
135 rsQuaternionSet(q, q1); in rsQuaternionSlerp()
166 rsQuaternionSet(q, tempq0.w*scale + tempq1.w*invScale, tempq0.x*scale + tempq1.x*invScale, in rsQuaternionSlerp()