veloren_voxygen_anim/quadruped_medium/
mod.rs

1pub mod combomelee;
2pub mod dash;
3pub mod feed;
4pub mod hoof;
5pub mod idle;
6pub mod jump;
7pub mod leapmelee;
8pub mod run;
9pub mod shockwave;
10pub mod stunned;
11
12// Reexports
13pub use self::{
14    combomelee::ComboAnimation, dash::DashAnimation, feed::FeedAnimation, hoof::HoofAnimation,
15    idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation, run::RunAnimation,
16    shockwave::ShockwaveAnimation, stunned::StunnedAnimation,
17};
18
19use super::{FigureBoneData, Skeleton, vek::*};
20use common::{
21    comp::{self},
22    states::utils::StageSection,
23};
24use core::convert::TryFrom;
25
26pub type Body = comp::quadruped_medium::Body;
27
28skeleton_impls!(struct QuadrupedMediumSkeleton ComputedQuadrupedMediumSkeleton {
29    + head
30    + neck
31    + jaw
32    + tail
33    + torso_front
34    + torso_back
35    + ears
36    + leg_fl
37    + leg_fr
38    + leg_bl
39    + leg_br
40    + foot_fl
41    + foot_fr
42    + foot_bl
43    + foot_br
44    mount
45});
46
47impl Skeleton for QuadrupedMediumSkeleton {
48    type Attr = SkeletonAttr;
49    type Body = Body;
50    type ComputedSkeleton = ComputedQuadrupedMediumSkeleton;
51
52    const BONE_COUNT: usize = ComputedQuadrupedMediumSkeleton::BONE_COUNT;
53    #[cfg(feature = "use-dyn-lib")]
54    const COMPUTE_FN: &'static [u8] = b"quadruped_medium_compute_mats\0";
55
56    #[cfg_attr(
57        feature = "be-dyn-lib",
58        unsafe(export_name = "quadruped_medium_compute_mats")
59    )]
60    fn compute_matrices_inner(
61        &self,
62        base_mat: Mat4<f32>,
63        buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
64        body: Self::Body,
65    ) -> Self::ComputedSkeleton {
66        let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
67
68        let torso_front_mat = base_mat * Mat4::<f32>::from(self.torso_front);
69        let torso_back_mat = torso_front_mat * Mat4::<f32>::from(self.torso_back);
70        let neck_mat = torso_front_mat * Mat4::<f32>::from(self.neck);
71        let leg_fl_mat = torso_front_mat * Mat4::<f32>::from(self.leg_fl);
72        let leg_fr_mat = torso_front_mat * Mat4::<f32>::from(self.leg_fr);
73        let leg_bl_mat = torso_back_mat * Mat4::<f32>::from(self.leg_bl);
74        let leg_br_mat = torso_back_mat * Mat4::<f32>::from(self.leg_br);
75        let head_mat = neck_mat * Mat4::<f32>::from(self.head);
76
77        let computed_skeleton = ComputedQuadrupedMediumSkeleton {
78            head: head_mat,
79            neck: neck_mat,
80            jaw: head_mat * Mat4::<f32>::from(self.jaw),
81            tail: torso_back_mat * Mat4::<f32>::from(self.tail),
82            torso_front: torso_front_mat,
83            torso_back: torso_back_mat,
84            ears: head_mat * Mat4::<f32>::from(self.ears),
85            leg_fl: leg_fl_mat,
86            leg_fr: leg_fr_mat,
87            leg_bl: leg_bl_mat,
88            leg_br: leg_br_mat,
89            foot_fl: leg_fl_mat * Mat4::<f32>::from(self.foot_fl),
90            foot_fr: leg_fr_mat * Mat4::<f32>::from(self.foot_fr),
91            foot_bl: leg_bl_mat * Mat4::<f32>::from(self.foot_bl),
92            foot_br: leg_br_mat * Mat4::<f32>::from(self.foot_br),
93        };
94
95        computed_skeleton.set_figure_bone_data(buf);
96        computed_skeleton
97    }
98}
99
100pub struct SkeletonAttr {
101    head: (f32, f32),
102    neck: (f32, f32),
103    jaw: (f32, f32),
104    tail: (f32, f32),
105    torso_back: (f32, f32),
106    torso_front: (f32, f32),
107    ears: (f32, f32),
108    leg_f: (f32, f32, f32),
109    leg_b: (f32, f32, f32),
110    feet_f: (f32, f32, f32),
111    feet_b: (f32, f32, f32),
112    scaler: f32,
113    startangle: f32,
114    tempo: f32,
115    spring: f32,
116    feed: (bool, f32),
117}
118
119impl<'a> TryFrom<&'a comp::Body> for SkeletonAttr {
120    type Error = ();
121
122    fn try_from(body: &'a comp::Body) -> Result<Self, Self::Error> {
123        match body {
124            comp::Body::QuadrupedMedium(body) => Ok(SkeletonAttr::from(body)),
125            _ => Err(()),
126        }
127    }
128}
129
130impl Default for SkeletonAttr {
131    fn default() -> Self {
132        Self {
133            head: (0.0, 0.0),
134            neck: (0.0, 0.0),
135            jaw: (0.0, 0.0),
136            tail: (0.0, 0.0),
137            torso_back: (0.0, 0.0),
138            torso_front: (0.0, 0.0),
139            ears: (0.0, 0.0),
140            leg_f: (0.0, 0.0, 0.0),
141            leg_b: (0.0, 0.0, 0.0),
142            feet_f: (0.0, 0.0, 0.0),
143            feet_b: (0.0, 0.0, 0.0),
144            scaler: 0.0,
145            startangle: 0.0,
146            tempo: 0.0,
147            spring: 0.0,
148            feed: (false, 0.0),
149        }
150    }
151}
152
153impl<'a> From<&'a Body> for SkeletonAttr {
154    fn from(body: &'a Body) -> Self {
155        use comp::quadruped_medium::{BodyType::*, Species::*};
156        Self {
157            head: match (body.species, body.body_type) {
158                (Grolgar, _) => (0.0, -1.0),
159                (Saber, _) => (5.0, -3.0),
160                (Tuskram, _) => (0.0, 0.0),
161                (Lion, Male) => (4.5, 2.0),
162                (Lion, Female) => (2.5, -2.0),
163                (Tarasque, _) => (-4.0, 3.5),
164                (Tiger, _) => (2.0, 1.0),
165                (Wolf, _) => (1.5, 3.0),
166                (Frostfang, _) => (1.0, -2.0),
167                (Mouflon, _) => (0.5, 1.5),
168                (Catoblepas, _) => (-1.0, -6.5),
169                (Bonerattler, _) => (0.0, 1.5),
170                (Deer, Male) => (1.5, 3.5),
171                (Deer, Female) => (1.5, 3.5),
172                (Hirdrasil, _) => (0.0, 5.0),
173                (Roshwalr, _) => (1.0, 0.5),
174                (Donkey, _) => (4.5, -3.0),
175                (Camel, _) => (-0.5, 5.0),
176                (Zebra, _) => (3.0, -2.0),
177                (Antelope, _) => (1.5, 2.5),
178                (Kelpie, _) => (4.0, -1.0),
179                (Horse, _) => (4.5, 2.5),
180                (Barghest, _) => (0.5, -2.5),
181                (Cattle, Male) => (2.0, 3.5),
182                (Cattle, Female) => (2.5, 4.0),
183                (Darkhound, _) => (3.0, -1.0),
184                (Highland, _) => (2.5, 5.0),
185                (Yak, _) => (2.5, 5.0),
186                (Panda, _) => (0.0, 0.5),
187                (Bear, _) => (0.5, 1.5),
188                (Dreadhorn, _) => (-2.5, 7.0),
189                (Moose, Male) => (-0.5, 5.0),
190                (Moose, Female) => (3.5, 0.5),
191                (Snowleopard, _) => (1.5, 0.5),
192                (Mammoth, _) => (0.5, -1.5),
193                (Ngoubou, _) => (0.5, -2.5),
194                (Llama, _) => (0.5, 10.0),
195                (Alpaca, _) => (0.5, 7.5),
196                (Akhlut, _) => (1.0, 3.5),
197                (Bristleback, _) => (-3.0, -2.0),
198                (ClaySteed, _) => (-0.5, 6.0),
199            },
200            neck: match (body.species, body.body_type) {
201                (Grolgar, _) => (1.0, -1.0),
202                (Saber, _) => (-3.5, -2.0),
203                (Tuskram, _) => (-1.0, 1.0),
204                (Lion, Male) => (-1.5, 1.0),
205                (Lion, Female) => (-2.0, 8.5),
206                (Tarasque, _) => (-1.5, -4.0),
207                (Tiger, _) => (0.0, 0.0),
208                (Wolf, _) => (-4.5, 2.0),
209                (Frostfang, _) => (0.5, 1.5),
210                (Mouflon, _) => (-1.0, 1.0),
211                (Catoblepas, _) => (19.5, -2.0),
212                (Bonerattler, _) => (7.0, -0.5),
213                (Deer, _) => (-2.5, 1.0),
214                (Hirdrasil, _) => (-1.0, 0.5),
215                (Roshwalr, _) => (0.0, 1.0),
216                (Donkey, _) => (1.0, 3.5),
217                (Camel, _) => (3.5, -1.5),
218                (Zebra, _) => (1.0, 3.5),
219                (Antelope, _) => (0.5, 2.5),
220                (Kelpie, _) => (2.0, 1.0),
221                (Horse, _) => (-2.5, -1.5),
222                (Barghest, _) => (0.5, -0.5),
223                (Cattle, Male) => (0.0, 0.0),
224                (Cattle, Female) => (0.0, 0.0),
225                (Darkhound, _) => (1.0, 1.5),
226                (Highland, _) => (0.0, 1.5),
227                (Yak, _) => (0.0, 0.0),
228                (Panda, _) => (0.5, 0.0),
229                (Bear, _) => (0.5, 0.0),
230                (Dreadhorn, _) => (0.5, 0.0),
231                (Moose, _) => (-0.5, 0.5),
232                (Snowleopard, _) => (0.0, 1.5),
233                (Mammoth, _) => (0.5, -0.5),
234                (Ngoubou, _) => (2.0, 1.0),
235                (Llama, _) => (2.5, 4.5),
236                (Alpaca, _) => (-1.5, 3.0),
237                (Akhlut, _) => (8.5, -1.0),
238                (Bristleback, _) => (6.0, 2.5),
239                (ClaySteed, _) => (1.5, 1.5),
240            },
241            jaw: match (body.species, body.body_type) {
242                (Grolgar, _) => (7.0, 2.0),
243                (Saber, _) => (2.5, -2.0),
244                (Tuskram, _) => (4.0, -5.0),
245                (Lion, Male) => (3.5, -4.0),
246                (Lion, Female) => (3.5, -4.0),
247                (Tarasque, _) => (9.0, -9.5),
248                (Tiger, _) => (3.0, -3.5),
249                (Wolf, _) => (5.0, -2.5),
250                (Frostfang, _) => (4.0, -2.5),
251                (Mouflon, _) => (6.0, 1.0),
252                (Catoblepas, _) => (1.0, -3.5),
253                (Bonerattler, _) => (3.0, -2.5),
254                (Deer, _) => (3.5, 2.5),
255                (Hirdrasil, _) => (2.5, 3.0),
256                (Roshwalr, _) => (4.0, -1.0),
257                (Donkey, _) => (1.0, 1.0),
258                (Camel, _) => (2.0, 2.5),
259                (Zebra, _) => (4.0, 0.0),
260                (Antelope, _) => (3.0, 0.5),
261                (Kelpie, _) => (1.0, 1.0),
262                (Horse, _) => (4.0, 1.0),
263                (Barghest, _) => (6.5, -3.0),
264                (Cattle, Male) => (5.0, -5.5),
265                (Cattle, Female) => (5.0, -5.0),
266                (Darkhound, _) => (2.0, -2.0),
267                (Highland, _) => (5.0, -6.0),
268                (Yak, _) => (6.0, -8.0),
269                (Panda, _) => (3.0, -3.0),
270                (Bear, _) => (3.5, -2.0),
271                (Dreadhorn, _) => (7.0, -5.0),
272                (Moose, Male) => (10.0, -7.0),
273                (Moose, Female) => (6.0, -2.5),
274                (Snowleopard, _) => (3.0, -3.0),
275                (Mammoth, _) => (9.5, -3.0),
276                (Ngoubou, _) => (1.5, -4.0),
277                (Llama, _) => (4.0, -1.0),
278                (Alpaca, _) => (3.0, -2.5),
279                (Akhlut, _) => (0.0, -4.5),
280                (Bristleback, _) => (8.0, -6.0),
281                (ClaySteed, _) => (4.0, -1.0),
282            },
283            tail: match (body.species, body.body_type) {
284                (Grolgar, _) => (-11.5, -0.5),
285                (Saber, _) => (-11.0, 0.0),
286                (Tuskram, _) => (-8.0, 2.0),
287                (Lion, Male) => (-11.0, 1.0),
288                (Lion, Female) => (-11.0, 1.0),
289                (Tarasque, _) => (-11.0, 0.0),
290                (Tiger, _) => (-13.5, 3.0),
291                (Wolf, _) => (-11.0, 0.0),
292                (Frostfang, _) => (-7.0, -3.5),
293                (Mouflon, _) => (-10.5, 3.0),
294                (Catoblepas, _) => (-8.0, -2.0),
295                (Bonerattler, _) => (-10.0, 1.5),
296                (Deer, _) => (-8.5, 0.5),
297                (Hirdrasil, _) => (-11.0, 2.0),
298                (Roshwalr, _) => (-8.5, -1.0),
299                (Donkey, _) => (-11.0, 1.5),
300                (Camel, _) => (-14.0, -1.0),
301                (Zebra, _) => (-10.0, 1.5),
302                (Antelope, _) => (-10.0, 2.0),
303                (Kelpie, _) => (-9.0, 3.0),
304                (Horse, _) => (-9.0, 1.5),
305                (Barghest, _) => (-7.0, -4.0),
306                (Cattle, Male) => (-8.0, 3.5),
307                (Cattle, Female) => (-8.0, 5.5),
308                (Darkhound, _) => (-9.0, -3.0),
309                (Highland, _) => (-9.0, 5.0),
310                (Yak, _) => (-8.0, 2.5),
311                (Panda, _) => (-9.5, 0.0),
312                (Bear, _) => (-10.0, -0.5),
313                (Dreadhorn, _) => (-5.5, 1.5),
314                (Moose, _) => (-12.5, 3.5),
315                (Snowleopard, _) => (-10.5, 3.0),
316                (Mammoth, _) => (-13.0, -1.5),
317                (Ngoubou, _) => (-12.0, 5.5),
318                (Llama, _) => (-9.0, 6.0),
319                (Alpaca, _) => (-8.5, 3.5),
320                (Akhlut, _) => (-14.0, -2.0),
321                (Bristleback, _) => (-7.0, -5.5),
322                (ClaySteed, _) => (-11.0, 4.0),
323            },
324            torso_front: match (body.species, body.body_type) {
325                (Grolgar, _) => (10.0, 13.0),
326                (Saber, _) => (14.0, 13.0),
327                (Tuskram, _) => (10.0, 16.0),
328                (Lion, Male) => (10.0, 13.0),
329                (Lion, Female) => (10.0, 13.5),
330                (Tarasque, _) => (11.5, 17.5),
331                (Tiger, _) => (10.0, 13.0),
332                (Wolf, _) => (12.0, 13.0),
333                (Frostfang, _) => (9.0, 11.5),
334                (Mouflon, _) => (11.0, 14.0),
335                (Catoblepas, _) => (7.5, 19.5),
336                (Bonerattler, _) => (6.0, 11.0),
337                (Deer, _) => (11.0, 13.5),
338                (Hirdrasil, _) => (11.0, 14.5),
339                (Roshwalr, _) => (6.0, 12.5),
340                (Donkey, _) => (10.0, 15.5),
341                (Camel, _) => (11.0, 22.5),
342                (Zebra, _) => (10.0, 16.5),
343                (Antelope, _) => (10.0, 14.0),
344                (Kelpie, _) => (10.0, 16.0),
345                (Horse, _) => (7.0, 16.0),
346                (Barghest, _) => (11.5, 15.5),
347                (Cattle, Male) => (7.0, 15.5),
348                (Cattle, Female) => (7.0, 14.5),
349                (Darkhound, _) => (7.0, 14.0),
350                (Highland, _) => (7.0, 12.5),
351                (Yak, _) => (7.0, 15.5),
352                (Panda, _) => (7.0, 13.5),
353                (Bear, _) => (7.0, 14.5),
354                (Dreadhorn, _) => (1.5, 15.5),
355                (Moose, _) => (1.5, 19.5),
356                (Snowleopard, _) => (1.5, 13.0),
357                (Mammoth, _) => (11.5, 20.5),
358                (Ngoubou, _) => (9.5, 16.5),
359                (Llama, _) => (7.0, 15.0),
360                (Alpaca, _) => (7.0, 11.5),
361                (Akhlut, _) => (5.5, 14.5),
362                (Bristleback, _) => (1.5, 9.0),
363                (ClaySteed, _) => (7.0, 15.0),
364            },
365            torso_back: match (body.species, body.body_type) {
366                (Grolgar, _) => (-10.0, 1.5),
367                (Saber, _) => (-13.5, 0.0),
368                (Tuskram, _) => (-12.0, -2.5),
369                (Lion, Male) => (-12.0, -0.5),
370                (Lion, Female) => (-12.0, -0.5),
371                (Tarasque, _) => (-14.0, -1.0),
372                (Tiger, _) => (-13.0, -0.5),
373                (Wolf, _) => (-12.5, 1.0),
374                (Frostfang, _) => (-10.5, 0.0),
375                (Mouflon, _) => (-8.5, -0.5),
376                (Catoblepas, _) => (-8.5, -4.5),
377                (Bonerattler, _) => (-5.0, 0.0),
378                (Deer, _) => (-9.0, 0.5),
379                (Hirdrasil, _) => (-9.0, -0.5),
380                (Roshwalr, _) => (-9.0, -3.5),
381                (Donkey, _) => (-6.0, -1.0),
382                (Camel, _) => (-12.0, -0.5),
383                (Zebra, _) => (-6.0, -1.0),
384                (Antelope, _) => (-7.0, 0.0),
385                (Kelpie, _) => (-8.0, -1.0),
386                (Horse, _) => (-8.0, -1.5),
387                (Barghest, _) => (-9.0, -1.5),
388                (Cattle, Male) => (-8.0, -0.5),
389                (Cattle, Female) => (-10.0, -2.0),
390                (Darkhound, _) => (-12.0, 0.5),
391                (Highland, _) => (-8.0, -0.5),
392                (Yak, _) => (-8.0, -0.5),
393                (Panda, _) => (-11.0, -0.5),
394                (Bear, _) => (-11.0, -0.5),
395                (Dreadhorn, _) => (-20.0, -1.0),
396                (Moose, _) => (-10.0, -1.0),
397                (Snowleopard, _) => (-11.0, 0.0),
398                (Mammoth, _) => (-13.0, -2.5),
399                (Ngoubou, _) => (-8.0, -2.0),
400                (Llama, _) => (-8.0, 0.0),
401                (Alpaca, _) => (-6.0, 0.0),
402                (Akhlut, _) => (-7.0, 1.0),
403                (Bristleback, _) => (-4.0, 2.0),
404                (ClaySteed, _) => (-6.0, 0.0),
405            },
406            ears: match (body.species, body.body_type) {
407                (Grolgar, _) => (5.0, 8.0),
408                (Saber, _) => (3.0, 5.5),
409                (Tuskram, _) => (0.0, 0.0),
410                (Lion, Male) => (2.0, 3.5),
411                (Lion, Female) => (2.0, 1.0),
412                (Tarasque, _) => (12.0, -3.0),
413                (Tiger, _) => (2.5, 4.0),
414                (Wolf, _) => (3.0, 2.5),
415                (Frostfang, _) => (2.0, 3.5),
416                (Mouflon, _) => (2.5, 5.0),
417                (Catoblepas, _) => (11.0, -3.0),
418                (Bonerattler, _) => (2.0, 3.5),
419                (Deer, _) => (2.5, 5.0),
420                (Hirdrasil, _) => (2.5, 5.0),
421                (Roshwalr, _) => (5.0, 8.0),
422                (Donkey, _) => (-1.0, 8.0),
423                (Camel, _) => (2.5, 5.0),
424                (Zebra, _) => (0.0, 7.0),
425                (Antelope, _) => (2.5, 5.0),
426                (Kelpie, _) => (1.0, 7.5),
427                (Horse, _) => (1.0, 7.0),
428                (Barghest, _) => (12.0, -3.0),
429                (Cattle, Male) => (2.0, -1.5),
430                (Cattle, Female) => (2.0, -1.5),
431                (Darkhound, _) => (1.0, 2.5),
432                (Highland, _) => (2.0, -1.5),
433                (Yak, _) => (3.0, -5.0),
434                (Panda, _) => (1.0, 4.0),
435                (Bear, _) => (1.0, 4.0),
436                (Dreadhorn, _) => (1.5, 3.0),
437                (Moose, Male) => (6.0, 1.0),
438                (Moose, Female) => (2.0, 4.5),
439                (Snowleopard, _) => (1.5, 3.0),
440                (Mammoth, _) => (12.0, -3.0),
441                (Ngoubou, _) => (12.0, -3.0),
442                (Llama, _) => (1.0, 3.5),
443                (Alpaca, _) => (1.0, 2.0),
444                (Akhlut, _) => (12.0, -3.0),
445                (Bristleback, _) => (6.0, 1.0),
446                (ClaySteed, _) => (1.0, 3.5),
447            },
448            leg_f: match (body.species, body.body_type) {
449                (Grolgar, _) => (7.5, -5.5, -1.0),
450                (Saber, _) => (7.0, -4.0, -2.5),
451                (Tuskram, _) => (8.5, -4.5, -2.0),
452                (Lion, Male) => (6.5, -6.5, -1.5),
453                (Lion, Female) => (6.5, -6.5, -1.5),
454                (Tarasque, _) => (7.0, -8.0, -6.0),
455                (Tiger, _) => (6.0, -6.0, -1.5),
456                (Wolf, _) => (4.5, -6.5, -1.5),
457                (Frostfang, _) => (5.5, -5.5, -2.0),
458                (Mouflon, _) => (4.0, -5.0, -4.0),
459                (Catoblepas, _) => (7.0, 2.0, -5.0),
460                (Bonerattler, _) => (5.5, 5.0, -2.5),
461                (Deer, _) => (3.5, -4.5, -3.5),
462                (Hirdrasil, _) => (4.5, -5.0, -2.5),
463                (Roshwalr, _) => (8.0, -2.5, -2.5),
464                (Donkey, _) => (4.0, -3.5, -4.0),
465                (Camel, _) => (4.5, -3.5, -5.5),
466                (Zebra, _) => (4.0, -2.5, -4.5),
467                (Antelope, _) => (4.0, -4.5, -2.5),
468                (Kelpie, _) => (4.5, -3.5, -3.5),
469                (Horse, _) => (4.5, -2.5, -3.0),
470                (Barghest, _) => (9.5, 0.0, -2.5),
471                (Cattle, Male) => (5.5, -2.0, -2.5),
472                (Cattle, Female) => (5.5, -2.5, -1.0),
473                (Darkhound, _) => (4.0, -6.5, -2.0),
474                (Highland, _) => (5.5, -2.5, 0.0),
475                (Yak, _) => (4.5, -2.0, -1.5),
476                (Panda, _) => (7.5, -5.5, -2.0),
477                (Bear, _) => (5.5, -4.5, -3.5),
478                (Dreadhorn, _) => (8.5, -7.0, -0.5),
479                (Moose, _) => (5.5, -4.0, 1.0),
480                (Snowleopard, _) => (6.5, -4.0, -2.5),
481                (Mammoth, _) => (10.0, -5.0, -5.0),
482                (Ngoubou, _) => (7.5, -4.0, -1.5),
483                (Llama, _) => (5.0, -1.5, -1.0),
484                (Alpaca, _) => (3.5, -2.5, -0.5),
485                (Akhlut, _) => (8.0, -2.0, 0.5),
486                (Bristleback, _) => (6.0, 1.0, -2.0),
487                (ClaySteed, _) => (4.0, -1.5, -2.0),
488            },
489            leg_b: match (body.species, body.body_type) {
490                (Grolgar, _) => (6.0, -6.5, -4.0),
491                (Saber, _) => (6.0, -7.0, -3.5),
492                (Tuskram, _) => (6.0, -5.5, -2.5),
493                (Lion, Male) => (6.0, -5.0, -1.5),
494                (Lion, Female) => (6.0, -5.0, -1.5),
495                (Tarasque, _) => (6.0, -6.5, -6.5),
496                (Tiger, _) => (6.0, -7.0, -1.0),
497                (Wolf, _) => (5.0, -6.5, -3.0),
498                (Frostfang, _) => (3.5, -4.5, -2.0),
499                (Mouflon, _) => (3.5, -8.0, -3.5),
500                (Catoblepas, _) => (6.0, -2.5, -2.5),
501                (Bonerattler, _) => (6.0, -8.0, -2.5),
502                (Deer, _) => (3.0, -6.5, -3.5),
503                (Hirdrasil, _) => (4.0, -6.5, -3.0),
504                (Roshwalr, _) => (7.0, -7.0, -2.5),
505                (Donkey, _) => (4.0, -9.0, -3.0),
506                (Camel, _) => (4.5, -10.5, -5.0),
507                (Zebra, _) => (3.5, -8.0, -3.5),
508                (Antelope, _) => (3.5, -7.5, -3.5),
509                (Kelpie, _) => (3.5, -7.0, -2.5),
510                (Horse, _) => (3.5, -7.0, -2.0),
511                (Barghest, _) => (7.0, -3.5, -5.5),
512                (Cattle, Male) => (4.0, -7.0, -1.0),
513                (Cattle, Female) => (4.0, -6.5, 0.0),
514                (Darkhound, _) => (4.0, -6.5, -3.0),
515                (Highland, _) => (4.5, -7.0, 0.0),
516                (Yak, _) => (4.5, -6.0, -1.0),
517                (Panda, _) => (7.0, -7.0, -2.0),
518                (Bear, _) => (6.5, -6.5, -2.0),
519                (Dreadhorn, _) => (6.0, 0.0, -3.0),
520                (Moose, _) => (4.5, -10.0, -2.0),
521                (Snowleopard, _) => (5.5, -5.0, -1.5),
522                (Mammoth, _) => (7.5, -7.0, -5.0),
523                (Ngoubou, _) => (4.5, -9.5, 0.0),
524                (Llama, _) => (5.0, -7.0, -2.0),
525                (Alpaca, _) => (3.5, -7.0, 0.0),
526                (Akhlut, _) => (6.0, -7.5, -2.0),
527                (Bristleback, _) => (4.5, -3.0, -2.0),
528                (ClaySteed, _) => (4.5, -8.0, -3.0),
529            },
530            feet_f: match (body.species, body.body_type) {
531                (Grolgar, _) => (0.0, 0.0, -4.0),
532                (Saber, _) => (1.0, -3.5, -2.5),
533                (Tuskram, _) => (-1.0, -1.5, -6.0),
534                (Lion, Male) => (0.5, 0.5, -3.5),
535                (Lion, Female) => (0.5, 0.5, -3.5),
536                (Tarasque, _) => (1.0, 0.0, -3.0),
537                (Tiger, _) => (0.5, 0.0, -4.5),
538                (Wolf, _) => (0.5, 0.0, -2.0),
539                (Frostfang, _) => (0.5, 1.5, -3.5),
540                (Mouflon, _) => (-0.5, -0.5, -3.0),
541                (Catoblepas, _) => (1.0, 0.0, -6.0),
542                (Bonerattler, _) => (-0.5, -3.0, -2.5),
543                (Deer, _) => (-0.5, -0.5, -2.5),
544                (Hirdrasil, _) => (-0.5, -3.0, -3.5),
545                (Roshwalr, _) => (0.5, 0.0, -3.0),
546                (Donkey, _) => (0.5, 1.0, -3.5),
547                (Camel, _) => (0.0, 0.0, -8.0),
548                (Zebra, _) => (-0.5, 0.5, -4.0),
549                (Antelope, _) => (-0.5, 0.0, -3.5),
550                (Kelpie, _) => (-0.5, 0.5, -4.5),
551                (Horse, _) => (-0.5, 0.5, -5.0),
552                (Barghest, _) => (2.0, 2.5, -6.0),
553                (Cattle, Male) => (-0.5, 1.0, -5.0),
554                (Cattle, Female) => (-0.5, 0.5, -5.5),
555                (Darkhound, _) => (0.0, 0.5, -4.0),
556                (Highland, _) => (-0.5, 0.5, -4.5),
557                (Yak, _) => (-0.5, 0.0, -5.0),
558                (Panda, _) => (-1.0, 2.0, -4.5),
559                (Bear, _) => (0.0, 2.0, -5.5),
560                (Dreadhorn, _) => (-0.5, 0.5, -5.0),
561                (Moose, _) => (-1.0, 1.5, -9.5),
562                (Snowleopard, _) => (0.5, 0.5, -4.5),
563                (Mammoth, _) => (-0.5, -0.5, -6.0),
564                (Ngoubou, _) => (-1.0, 0.5, -6.0),
565                (Llama, _) => (-0.5, 0.5, -6.0),
566                (Alpaca, _) => (0.0, -0.5, -5.0),
567                (Akhlut, _) => (0.0, 0.0, -5.0),
568                (Bristleback, _) => (0.0, -0.5, -2.0),
569                (ClaySteed, _) => (-0.5, 0.0, -6.0),
570            },
571            feet_b: match (body.species, body.body_type) {
572                (Grolgar, _) => (0.5, -1.5, -3.0),
573                (Saber, _) => (1.0, -1.0, -1.0),
574                (Tuskram, _) => (0.5, -1.0, -3.0),
575                (Lion, Male) => (0.5, -1.0, -3.0),
576                (Lion, Female) => (0.5, -1.0, -3.0),
577                (Tarasque, _) => (1.5, -1.0, -2.5),
578                (Tiger, _) => (0.5, -1.0, -4.0),
579                (Wolf, _) => (0.0, -1.0, -1.5),
580                (Frostfang, _) => (0.0, -1.5, -3.5),
581                (Mouflon, _) => (-1.0, 0.0, -0.5),
582                (Catoblepas, _) => (0.5, 0.5, -4.0),
583                (Bonerattler, _) => (0.0, 3.0, -2.5),
584                (Deer, _) => (-1.0, -0.5, -2.0),
585                (Hirdrasil, _) => (-1.0, -2.0, -4.5),
586                (Roshwalr, _) => (0.5, -1.0, -3.5),
587                (Donkey, _) => (0.5, -1.0, -3.5),
588                (Camel, _) => (0.0, 0.5, -9.0),
589                (Zebra, _) => (0.5, -1.0, -3.0),
590                (Antelope, _) => (-0.5, -1.5, -3.5),
591                (Kelpie, _) => (0.5, -0.5, -3.5),
592                (Horse, _) => (0.5, -1.5, -3.5),
593                (Barghest, _) => (0.5, 1.0, -4.5),
594                (Cattle, Male) => (-0.5, -0.5, -5.0),
595                (Cattle, Female) => (-0.5, -1.0, -3.5),
596                (Darkhound, _) => (0.0, -1.0, -3.5),
597                (Highland, _) => (-0.5, -0.5, -3.0),
598                (Yak, _) => (-0.5, -0.5, -5.0),
599                (Panda, _) => (-0.5, 0.5, -5.0),
600                (Bear, _) => (0.5, 0.5, -6.0),
601                (Dreadhorn, _) => (-0.5, 0.5, -3.5),
602                (Moose, _) => (-1.0, 0.0, -6.5),
603                (Snowleopard, _) => (0.5, 0.5, -5.5),
604                (Mammoth, _) => (0.5, -0.5, -4.5),
605                (Ngoubou, _) => (0.5, 1.0, -5.5),
606                (Llama, _) => (0.5, -1.5, -3.5),
607                (Alpaca, _) => (-0.5, -0.5, -5.5),
608                (Akhlut, _) => (1.5, -1.0, -4.5),
609                (Bristleback, _) => (-0.5, 0.0, -4.0),
610                (ClaySteed, _) => (0.0, -0.5, -4.0),
611            },
612            scaler: match (body.species, body.body_type) {
613                (Grolgar, _) => 1.05,
614                (Saber, _) => 0.9,
615                (Tuskram, _) => 0.95,
616                (Lion, Male) => 1.05,
617                (Lion, Female) => 1.05,
618                (Tarasque, _) => 1.05,
619                (Tiger, _) => 0.95,
620                (Catoblepas, _) => 1.05,
621                (Roshwalr, _) => 1.75,
622                (Barghest, _) => 1.2,
623                (Antelope, _) => 0.95,
624                (Kelpie, _) => 1.1,
625                (Donkey, _) => 0.95,
626                (Horse, _) => 1.2,
627                (Zebra, _) => 1.05,
628                (Cattle, _) => 1.25,
629                (Highland, _) => 1.32,
630                (Bear, _) => 1.4,
631                (Yak, _) => 1.4,
632                (Camel, _) => 1.15,
633                (Dreadhorn, _) => 1.6,
634                (Moose, _) => 0.95,
635                (Snowleopard, _) => 0.95,
636                (Mammoth, _) => 3.0,
637                (Ngoubou, _) => 1.2,
638                (Akhlut, _) => 1.4,
639                (Bristleback, _) => 1.1,
640                (ClaySteed, _) => 1.75,
641                (Frostfang, _) => 1.0,
642                _ => 0.9,
643            },
644            startangle: match (body.species, body.body_type) {
645                //changes the default angle of front feet
646                (Grolgar, _) => -0.3,
647                (Saber, _) => -0.2,
648                (Tuskram, _) => 0.3,
649                (Lion, Male) => -0.1,
650                (Lion, Female) => -0.1,
651                (Tarasque, _) => -0.5,
652                (Catoblepas, _) => -0.5,
653                (Bonerattler, _) => -0.7,
654                (Roshwalr, _) => -0.3,
655                (Barghest, _) => -0.5,
656                _ => 0.0,
657            },
658            tempo: match (body.species, body.body_type) {
659                (Grolgar, _) => 0.85,
660                (Saber, _) => 1.1,
661                (Tuskram, _) => 0.9,
662                (Lion, Male) => 0.95,
663                (Lion, Female) => 0.95,
664                (Tarasque, _) => 0.95,
665                (Wolf, _) => 1.1,
666                (Mouflon, _) => 0.85,
667                (Catoblepas, _) => 1.1,
668                (Deer, _) => 0.85,
669                (Hirdrasil, _) => 0.85,
670                (Roshwalr, _) => 0.75,
671                (Donkey, _) => 0.85,
672                (Zebra, _) => 0.85,
673                (Kelpie, _) => 0.85,
674                (Horse, _) => 0.85,
675                (Barghest, _) => 0.95,
676                (Darkhound, _) => 1.1,
677                (Cattle, _) => 0.8,
678                (Highland, _) => 0.8,
679                (Bear, _) => 0.8,
680                (Yak, _) => 0.8,
681                (Camel, _) => 1.8,
682                (Akhlut, _) => 0.95,
683                _ => 1.0,
684            },
685            spring: match (body.species, body.body_type) {
686                (Grolgar, _) => 0.9,
687                (Saber, _) => 0.9,
688                (Tuskram, _) => 0.9,
689                (Wolf, _) => 1.2,
690                (Mouflon, _) => 0.9,
691                (Catoblepas, _) => 0.55,
692                (Bonerattler, _) => 1.1,
693                (Deer, _) => 0.9,
694                (Hirdrasil, _) => 1.1,
695                (Donkey, _) => 0.85,
696                (Camel, _) => 0.85,
697                (Zebra, _) => 0.85,
698                (Antelope, _) => 1.2,
699                (Kelpie, _) => 0.95,
700                (Horse, _) => 0.85,
701                (Darkhound, _) => 1.2,
702                (Dreadhorn, _) => 0.85,
703                (Moose, _) => 0.9,
704                (Snowleopard, _) => 1.1,
705                _ => 1.0,
706            },
707            feed: match (body.species, body.body_type) {
708                // TODO: Rework some species to allow for feed anim
709                (Tuskram, _) => (true, 0.5),
710                (Mouflon, _) => (true, 0.7),
711                (Deer, _) => (true, 1.0),
712                (Hirdrasil, _) => (true, 0.9),
713                (Donkey, _) => (false, 1.0),
714                (Zebra, _) => (true, 1.0),
715                (Antelope, _) => (false, 0.9),
716                (Kelpie, _) => (false, 1.0),
717                (Horse, _) => (true, 0.85),
718                _ => (false, 0.0),
719            },
720        }
721    }
722}
723
724pub fn viewpoint(body: &Body) -> Vec4<f32> {
725    use comp::quadruped_medium::Species::*;
726    match body.species {
727        Akhlut | Catoblepas | Lion => Vec4::new(0.0, 8.0, 0.0, 1.0),
728        Barghest | Saber => Vec4::new(0.0, 8.0, 3.0, 1.0),
729        Cattle | Highland | Bonerattler | Ngoubou | Yak => Vec4::new(0.0, 6.0, -1.0, 1.0),
730        Antelope | Deer | Donkey | Bear | Mouflon | Panda => Vec4::new(0.0, 3.0, 3.0, 1.0),
731        Camel | Hirdrasil | Horse | Kelpie | Zebra => Vec4::new(0.0, 2.0, 5.0, 1.0),
732        Darkhound | Llama | Snowleopard | Tiger | Wolf | ClaySteed => Vec4::new(0.0, 4.0, 1.0, 1.0),
733        Dreadhorn | Mammoth | Moose | Tarasque => Vec4::new(0.0, 13.0, -3.0, 1.0),
734        Frostfang => Vec4::new(0.0, 5.0, 3.0, 1.0),
735        Grolgar | Roshwalr => Vec4::new(0.0, 8.0, 6.0, 1.0),
736        _ => Vec4::new(0.0, 2.0, 0.0, 1.0),
737    }
738}
739
740pub fn mount_mat(
741    body: &Body,
742    computed_skeleton: &ComputedQuadrupedMediumSkeleton,
743    skeleton: &QuadrupedMediumSkeleton,
744) -> (Mat4<f32>, Quaternion<f32>) {
745    use comp::quadruped_medium::Species::*;
746
747    match (body.species, body.body_type) {
748        (Mammoth, _) => (
749            computed_skeleton.head,
750            skeleton.torso_front.orientation
751                * skeleton.neck.orientation
752                * skeleton.head.orientation,
753        ),
754        (Akhlut, _) => (
755            computed_skeleton.neck,
756            skeleton.torso_front.orientation * skeleton.neck.orientation,
757        ),
758        _ => (
759            computed_skeleton.torso_front,
760            skeleton.torso_front.orientation,
761        ),
762    }
763}
764
765pub fn mount_transform(
766    body: &Body,
767    computed_skeleton: &ComputedQuadrupedMediumSkeleton,
768    skeleton: &QuadrupedMediumSkeleton,
769) -> Transform<f32, f32, f32> {
770    use comp::quadruped_medium::{BodyType::*, Species::*};
771
772    let mount_point = match (body.species, body.body_type) {
773        (Grolgar, _) => (0.0, -6.0, 8.0),
774        (Saber, _) => (0.0, -17.0, 5.5),
775        (Tuskram, _) => (0.0, -17.0, 4.0),
776        (Lion, Male) => (0.0, -8.0, 6.0),
777        (Lion, Female) => (0.0, -8.0, 6.0),
778        (Tarasque, _) => (0.0, -6.0, 6.0),
779        (Tiger, _) => (0.0, -8.0, 6.0),
780        (Wolf, _) => (0.0, -9.0, 5.0),
781        (Frostfang, _) => (0.0, -10.0, 3.5),
782        (Mouflon, _) => (0.0, -8.5, 3.5),
783        (Catoblepas, _) => (0.0, -8.5, 3.5),
784        (Bonerattler, _) => (0.0, -1.0, 5.0),
785        (Deer, _) => (0.0, -9.0, 4.0),
786        (Hirdrasil, _) => (0.0, -11.0, 3.5),
787        (Roshwalr, _) => (0.0, -1.0, 8.0),
788        (Donkey, _) => (0.0, -7.0, 5.5),
789        (Camel, _) => (0.0, -13.0, 4.5),
790        (Zebra, _) => (0.0, -7.0, 4.5),
791        (Antelope, _) => (0.0, -8.0, 3.5),
792        (Kelpie, _) => (0.0, -6.0, 4.5),
793        (Horse, _) => (0.0, -8.0, 4.0),
794        (Barghest, _) => (0.0, -8.0, 7.5),
795        (Cattle, Male) => (0.0, -3.0, 8.0),
796        (Cattle, Female) => (0.0, -2.0, 6.5),
797        (Darkhound, _) => (0.0, -2.0, 4.0),
798        (Highland, _) => (0.0, -3.0, 8.5),
799        (Yak, _) => (0.0, -7.5, 9.0),
800        (Panda, _) => (0.0, -10.5, 5.5),
801        (Bear, _) => (0.0, -11.0, 5.5),
802        (Dreadhorn, _) => (0.0, -1.5, 11.5),
803        (Moose, _) => (0.0, -9.0, 7.0),
804        (Snowleopard, _) => (0.0, -9.0, 5.0),
805        (Mammoth, _) => (0.0, 5.0, 8.0),
806        (Ngoubou, _) => (0.0, -7.5, 7.5),
807        (Llama, _) => (0.0, -6.0, 5.0),
808        (Alpaca, _) => (0.0, -9.0, 4.0),
809        (Akhlut, _) => (0.0, -0.5, 8.5),
810        (Bristleback, _) => (0.0, -7.0, 6.0),
811        (ClaySteed, _) => (0.0, -9.0, 3.0),
812    }
813    .into();
814
815    let (mount_mat, orientation) = mount_mat(body, computed_skeleton, skeleton);
816    Transform {
817        position: mount_mat.mul_point(mount_point),
818        orientation,
819        scale: Vec3::one(),
820    }
821}
822
823pub fn quadruped_medium_alpha(
824    next: &mut QuadrupedMediumSkeleton,
825    s_a: &SkeletonAttr,
826    speed: f32,
827    stage_section: StageSection,
828    anim_time: f32,
829    global_time: f32,
830    timer: f32,
831) {
832    let speed = (Vec2::<f32>::from(speed).magnitude()).min(24.0);
833
834    let (movement1base, movement2base, movement3) = match stage_section {
835        StageSection::Buildup => (anim_time.powf(0.25), 0.0, 0.0),
836        StageSection::Action => (1.0, anim_time.powf(0.25), 0.0),
837        StageSection::Recover => (1.0, 1.0, anim_time.powi(4)),
838        _ => (0.0, 0.0, 0.0),
839    };
840    let pullback = 1.0 - movement3;
841    let subtract = global_time - timer;
842    let check = subtract - subtract.trunc();
843    let mirror = (check - 0.5).signum();
844    let movement1 = movement1base * mirror * pullback;
845    let movement1abs = movement1base * pullback;
846    let movement2 = movement2base * mirror * pullback;
847    let movement2abs = movement2base * pullback;
848    let twitch1 = (movement1 * 10.0).sin() * pullback;
849    let twitch2 = (movement3 * 5.0).sin() * pullback;
850    let twitchmovement = twitch1 + twitch2;
851
852    next.head.orientation = Quaternion::rotation_x(movement1abs * -0.3 + movement2abs * 0.6)
853        * Quaternion::rotation_y(movement1 * 0.35 + movement2 * -0.15)
854        * Quaternion::rotation_z(movement1 * 0.15 + movement2 * -0.5);
855
856    next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * -0.2)
857        * Quaternion::rotation_y(movement1 * 0.0)
858        * Quaternion::rotation_z(movement1 * 0.10 + movement1 * -0.15);
859
860    next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 0.4);
861
862    next.tail.orientation =
863        Quaternion::rotation_z(movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror);
864    next.torso_front.position = Vec3::new(
865        0.0,
866        s_a.torso_front.0 + movement1abs * -4.0,
867        s_a.torso_front.1,
868    );
869    next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25)
870        * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45);
871
872    next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25)
873        * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65);
874
875    next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2);
876    if speed < 0.5 {
877        next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6)
878            * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3)
879            * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45);
880
881        next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6)
882            * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3)
883            * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45);
884
885        next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3);
886
887        next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3);
888
889        next.foot_fl.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6);
890
891        next.foot_fr.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6);
892
893        next.foot_bl.orientation =
894            Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3);
895
896        next.foot_br.orientation =
897            Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3);
898    };
899}
900
901pub fn quadruped_medium_beta(
902    next: &mut QuadrupedMediumSkeleton,
903    s_a: &SkeletonAttr,
904    speed: f32,
905    stage_section: StageSection,
906    anim_time: f32,
907    global_time: f32,
908    timer: f32,
909) {
910    let speed = (Vec2::<f32>::from(speed).magnitude()).min(24.0);
911
912    let (movement1base, movement2base, movement3) = match stage_section {
913        StageSection::Buildup => (anim_time.powf(0.25), 0.0, 0.0),
914        StageSection::Action => (1.0, anim_time.sqrt(), 0.0),
915        StageSection::Recover => (1.0, 1.0, anim_time.powi(4)),
916        _ => (0.0, 0.0, 0.0),
917    };
918    let pullback = 1.0 - movement3;
919    let subtract = global_time - timer;
920    let check = subtract - subtract.trunc();
921    let mirror = (check - 0.5).signum();
922    let movement1 = movement1base * mirror * pullback;
923    let movement1abs = movement1base * pullback;
924    let movement2 = movement2base * mirror * pullback;
925    let movement2abs = movement2base * pullback;
926    let twitch1 = (movement1 * 10.0).sin() * pullback;
927    let twitch2 = (movement2abs * -8.0).sin();
928    let twitchmovement = twitch1 + twitch2;
929
930    next.head.orientation = Quaternion::rotation_x(movement1abs * -0.4 + movement2abs * 1.1)
931        * Quaternion::rotation_y(movement1 * -0.35 + movement2 * 0.25)
932        * Quaternion::rotation_z(movement1 * -0.25 + movement2 * 0.5);
933
934    next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.0 + movement2abs * -0.2)
935        * Quaternion::rotation_y(movement1 * 0.0)
936        * Quaternion::rotation_z(movement1 * -0.10 + movement1 * 0.15);
937
938    next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + twitch2 * -0.4);
939
940    next.tail.orientation =
941        Quaternion::rotation_z(movement1 * 0.5 + movement2 * -0.8 + twitchmovement * 0.2 * mirror);
942    next.torso_front.position = Vec3::new(
943        0.0,
944        s_a.torso_front.0 + movement1abs * -4.0,
945        s_a.torso_front.1,
946    );
947    next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25)
948        * Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45);
949
950    next.torso_back.orientation = Quaternion::rotation_y(movement1 * 0.25 + movement1 * -0.25)
951        * Quaternion::rotation_z(movement1 * -0.4 + movement2 * 0.65);
952
953    next.ears.orientation = Quaternion::rotation_x(twitchmovement * 0.2);
954    if speed < 0.5 {
955        next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6)
956            * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3)
957            * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45);
958
959        next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8 + movement2abs * -0.6)
960            * Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3)
961            * Quaternion::rotation_z(movement1 * -0.35 + movement2 * 0.45);
962
963        next.leg_bl.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * -0.3);
964
965        next.leg_br.orientation = Quaternion::rotation_x(movement1 * -0.1 + movement2 * 0.3);
966
967        next.foot_fl.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6);
968
969        next.foot_fr.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.6);
970
971        next.foot_bl.orientation =
972            Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3);
973
974        next.foot_br.orientation =
975            Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * -0.3);
976    };
977}