• Home
  • Raw
  • Download

Lines Matching refs:q

31  * Adds two quaternions, i.e. *q += *rhs;
34 * q: Destination quaternion to add to.
39 rsQuaternionAdd(rs_quaternion* q, const rs_quaternion* rhs) {
40 q->w += rhs->w;
41 q->x += rhs->x;
42 q->y += rhs->y;
43 q->z += rhs->z;
53 * q: Quaternion to modify.
57 rsQuaternionConjugate(rs_quaternion* q) {
58 q->x = -q->x;
59 q->y = -q->y;
60 q->z = -q->z;
87 * q: Normalized quaternion.
91 rsQuaternionGetMatrixUnit(rs_matrix4x4* m, const rs_quaternion* q) {
92 float xx = q->x * q->x;
93 float xy = q->x * q->y;
94 float xz = q->x * q->z;
95 float xw = q->x * q->w;
96 float yy = q->y * q->y;
97 float yz = q->y * q->z;
98 float yw = q->y * q->w;
99 float zz = q->z * q->z;
100 float zw = q->z * q->w;
122 * q: Destination quaternion.
130 rsQuaternionLoadRotateUnit(rs_quaternion* q, float rot, float x, float y, float z) {
135 q->w = c;
136 q->x = x * s;
137 q->y = y * s;
138 q->z = z * s;
148 * q: Destination quaternion.
157 rsQuaternionSet(rs_quaternion* q, float w, float x, float y, float z) {
158 q->w = w;
159 q->x = x;
160 q->y = y;
161 q->z = z;
167 rsQuaternionSet(rs_quaternion* q, const rs_quaternion* rhs) {
168 q->w = rhs->w;
169 q->x = rhs->x;
170 q->y = rhs->y;
171 q->z = rhs->z;
182 * q: Destination quaternion.
190 rsQuaternionLoadRotate(rs_quaternion* q, float rot, float x, float y, float z) {
198 rsQuaternionLoadRotateUnit(q, rot, x, y, z);
208 * q: Quaternion to normalize.
212 rsQuaternionNormalize(rs_quaternion* q) {
213 const float len = rsQuaternionDot(q, q);
216 q->w *= recipLen;
217 q->x *= recipLen;
218 q->y *= recipLen;
219 q->z *= recipLen;
228 * *q = *q * scalar; or *q = *q * *rhs;.
231 * q: Destination quaternion.
237 rsQuaternionMultiply(rs_quaternion* q, float scalar) {
238 q->w *= scalar;
239 q->x *= scalar;
240 q->y *= scalar;
241 q->z *= scalar;
247 rsQuaternionMultiply(rs_quaternion* q, const rs_quaternion* rhs) {
249 rsQuaternionSet(&qtmp, q);
251 q->w = qtmp.w*rhs->w - qtmp.x*rhs->x - qtmp.y*rhs->y - qtmp.z*rhs->z;
252 q->x = qtmp.w*rhs->x + qtmp.x*rhs->w + qtmp.y*rhs->z - qtmp.z*rhs->y;
253 q->y = qtmp.w*rhs->y + qtmp.y*rhs->w + qtmp.z*rhs->x - qtmp.x*rhs->z;
254 q->z = qtmp.w*rhs->z + qtmp.z*rhs->w + qtmp.x*rhs->y - qtmp.y*rhs->x;
255 rsQuaternionNormalize(q);
265 * q: Result quaternion from the interpolation.
272 rsQuaternionSlerp(rs_quaternion* q, const rs_quaternion* q0, const rs_quaternion* q1, float t) {
274 rsQuaternionSet(q, q0);
278 rsQuaternionSet(q, q1);
309 rsQuaternionSet(q, tempq0.w*scale + tempq1.w*invScale, tempq0.x*scale + tempq1.x*invScale,
316 rsQuaternionAdd(rs_quaternion* q, const rs_quaternion* rhs);
321 rsQuaternionConjugate(rs_quaternion* q);
331 rsQuaternionGetMatrixUnit(rs_matrix4x4* m, const rs_quaternion* q);
336 rsQuaternionLoadRotateUnit(rs_quaternion* q, float rot, float x, float y, float z);
341 rsQuaternionSet(rs_quaternion* q, float w, float x, float y, float z);
346 rsQuaternionSet(rs_quaternion* q, const rs_quaternion* rhs);
351 rsQuaternionLoadRotate(rs_quaternion* q, float rot, float x, float y, float z);
356 rsQuaternionNormalize(rs_quaternion* q);
361 rsQuaternionMultiply(rs_quaternion* q, float scalar);
366 rsQuaternionMultiply(rs_quaternion* q, const rs_quaternion* rhs);
371 rsQuaternionSlerp(rs_quaternion* q, const rs_quaternion* q0, const rs_quaternion* q1, float t);