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