veloren_voxygen_anim/biped_large/
wield.rs

1use super::{
2    super::{Animation, vek::*},
3    BipedLargeSkeleton, SkeletonAttr,
4};
5use common::comp::item::tool::{AbilitySpec, ToolKind};
6use core::{f32::consts::PI, ops::Mul};
7
8pub struct WieldAnimation;
9
10impl Animation for WieldAnimation {
11    type Dependency<'a> = (
12        (Option<ToolKind>, Option<&'a AbilitySpec>),
13        (Option<ToolKind>, Option<&'a AbilitySpec>),
14        Vec3<f32>,
15        f32,
16        f32,
17    );
18    type Skeleton = BipedLargeSkeleton;
19
20    #[cfg(feature = "use-dyn-lib")]
21    const UPDATE_FN: &'static [u8] = b"biped_large_wield\0";
22
23    #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_wield")]
24    fn update_skeleton_inner(
25        skeleton: &Self::Skeleton,
26        ((active_tool_kind, active_tool_spec), _second_tool, velocity, global_time, acc_vel): Self::Dependency<'_>,
27        anim_time: f32,
28        _rate: &mut f32,
29        s_a: &SkeletonAttr,
30    ) -> Self::Skeleton {
31        let mut next = (*skeleton).clone();
32        let speed = Vec2::<f32>::from(velocity).magnitude();
33
34        let lab: f32 = 0.65 * s_a.tempo; //.65
35        let torso = (anim_time * lab + 1.5 * PI).sin();
36        let speednorm = (speed / 12.0).powf(0.4);
37        let foothoril = (acc_vel * lab + PI * 1.45).sin() * speednorm;
38        let foothorir = (acc_vel * lab + PI * (0.45)).sin() * speednorm;
39        let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 1.4).sin()).powi(2))).sqrt())
40            * ((acc_vel * lab + PI * 1.4).sin());
41
42        let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * lab + PI * 0.4).sin()).powi(2))).sqrt())
43            * ((acc_vel * lab + PI * 0.4).sin());
44        let slower = (anim_time * 1.0 + PI).sin();
45        let slow = (anim_time * 3.5 + PI).sin();
46
47        let tailmove = Vec2::new(
48            (global_time / 2.0 + anim_time / 2.0)
49                .floor()
50                .mul(7331.0)
51                .sin()
52                * 0.25,
53            (global_time / 2.0 + anim_time / 2.0)
54                .floor()
55                .mul(1337.0)
56                .sin()
57                * 0.125,
58        );
59
60        let look = Vec2::new(
61            (global_time / 2.0 + anim_time / 8.0)
62                .floor()
63                .mul(7331.0)
64                .sin()
65                * 0.5,
66            (global_time / 2.0 + anim_time / 8.0)
67                .floor()
68                .mul(1337.0)
69                .sin()
70                * 0.25,
71        );
72
73        let breathe = if s_a.beast {
74            // Controls for the beast breathing
75            let intensity = 0.04;
76            let lenght = 1.5;
77            let chop = 0.2;
78            let chop_freq = 60.0;
79            intensity * (lenght * anim_time).sin()
80                + 0.05 * chop * (anim_time * chop_freq).sin() * (anim_time * lenght).cos()
81        } else {
82            0.0
83        };
84
85        let footvertl = (anim_time * 16.0 * lab).sin();
86        let footvertr = (anim_time * 16.0 * lab + PI).sin();
87        let handhoril = (anim_time * 16.0 * lab + PI * 1.4).sin();
88        let handhorir = (anim_time * 16.0 * lab + PI * 0.4).sin();
89
90        let short = (acc_vel * lab).sin() * speednorm;
91
92        let shortalt = (anim_time * lab * 16.0 + PI / 2.0).sin();
93        next.second.position = Vec3::new(0.0, 0.0, 0.0);
94        next.second.orientation = Quaternion::rotation_x(0.0);
95
96        if s_a.beast {
97            next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
98        } else {
99            next.jaw.position = Vec3::new(0.0, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
100
101            next.hold.scale = Vec3::one() * 0.0;
102
103            next.main.position = Vec3::new(0.0, 0.0, 0.0);
104            next.main.orientation = Quaternion::rotation_x(0.0);
105
106            next.hand_l.position = Vec3::new(s_a.grip.1, 0.0, s_a.grip.0);
107            next.hand_r.position = Vec3::new(-s_a.grip.1, 0.0, s_a.grip.0);
108
109            next.hand_l.orientation = Quaternion::rotation_x(0.0);
110            next.hand_r.orientation = Quaternion::rotation_x(0.0);
111
112            if speed > 0.5 {
113                next.shoulder_l.position = Vec3::new(
114                    -s_a.shoulder.0,
115                    s_a.shoulder.1,
116                    s_a.shoulder.2 - foothorir * 1.0,
117                );
118                next.shoulder_l.orientation =
119                    Quaternion::rotation_x(0.6 * speednorm + (footrotr * -0.2) * speednorm);
120
121                next.shoulder_r.position = Vec3::new(
122                    s_a.shoulder.0,
123                    s_a.shoulder.1,
124                    s_a.shoulder.2 - foothoril * 1.0,
125                );
126                next.shoulder_r.orientation =
127                    Quaternion::rotation_x(0.6 * speednorm + (footrotl * -0.2) * speednorm);
128            } else {
129                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
130                next.head.orientation =
131                    Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
132
133                next.upper_torso.position =
134                    Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + torso * -0.5);
135                next.upper_torso.orientation =
136                    Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
137
138                next.lower_torso.position =
139                    Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + torso * 0.5);
140                next.lower_torso.orientation =
141                    Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
142                next.lower_torso.scale = Vec3::one() * 1.02;
143
144                next.jaw.position =
145                    Vec3::new(0.0, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
146                next.jaw.orientation = Quaternion::rotation_x(-0.1 + breathe * 2.0);
147
148                next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
149                next.tail.orientation = Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x)
150                    * Quaternion::rotation_x(0.0);
151
152                next.shoulder_l.position =
153                    Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
154                next.shoulder_l.orientation =
155                    Quaternion::rotation_y(0.0) * Quaternion::rotation_x(0.3);
156
157                next.shoulder_r.position =
158                    Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
159                next.shoulder_r.orientation =
160                    Quaternion::rotation_y(0.0) * Quaternion::rotation_x(0.3);
161            }
162
163            match active_tool_kind {
164                Some(ToolKind::Sword) => {
165                    next.control_l.position = Vec3::new(-1.0, 1.0, 1.0);
166                    next.control_r.position = Vec3::new(0.0, 2.0, -3.0);
167
168                    next.control.position = Vec3::new(
169                        -3.0,
170                        5.0 + s_a.grip.0 / 1.2,
171                        -4.0 + -s_a.grip.0 / 2.0 + short * -1.5,
172                    );
173                    next.second.scale = Vec3::one() * 0.0;
174
175                    next.control_l.orientation =
176                        Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.2);
177                    next.control_r.orientation =
178                        Quaternion::rotation_x(PI / 2.2) * Quaternion::rotation_y(0.2);
179
180                    next.control.orientation =
181                        Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(-0.1);
182                },
183                Some(ToolKind::Bow) => {
184                    next.control_l.position = Vec3::new(-1.0, -2.0, -3.0);
185                    next.control_r.position = Vec3::new(0.0, 4.0, 1.0);
186
187                    next.control.position = Vec3::new(
188                        -1.0,
189                        6.0 + s_a.grip.0 / 1.2,
190                        -5.0 + -s_a.grip.0 / 2.0 + short * -1.5,
191                    );
192
193                    next.control_l.orientation =
194                        Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.2);
195                    next.control_r.orientation = Quaternion::rotation_x(PI / 2.2)
196                        * Quaternion::rotation_y(0.2)
197                        * Quaternion::rotation_z(0.0);
198
199                    next.control.orientation = Quaternion::rotation_x(-0.2 + short * 0.2)
200                        * Quaternion::rotation_y(1.0)
201                        * Quaternion::rotation_z(-0.3);
202                },
203                Some(ToolKind::Hammer) | Some(ToolKind::Axe) => {
204                    next.control_l.position = Vec3::new(-1.0, 2.0, 12.0);
205                    next.control_r.position = Vec3::new(1.0, 2.0, -2.0);
206
207                    next.control.position = Vec3::new(
208                        4.0,
209                        0.0 + s_a.grip.0 / 1.0,
210                        -s_a.grip.0 / 0.8 + short * -1.5,
211                    );
212
213                    next.control_l.orientation =
214                        Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.0);
215                    next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2)
216                        * Quaternion::rotation_y(0.0)
217                        * Quaternion::rotation_z(0.0);
218
219                    next.control.orientation =
220                        Quaternion::rotation_x(-1.0 + short * 0.2) * Quaternion::rotation_y(-1.8);
221                },
222                Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
223                    next.control_l.position = Vec3::new(-1.0, 3.0, 12.0);
224                    next.control_r.position = Vec3::new(1.0, 2.0, 2.0);
225
226                    next.control.position = Vec3::new(
227                        -3.0,
228                        3.0 + s_a.grip.0 / 1.2,
229                        -11.0 + -s_a.grip.0 / 2.0 + short * -1.5,
230                    );
231
232                    next.control_l.orientation =
233                        Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.5);
234                    next.control_r.orientation = Quaternion::rotation_x(PI / 2.5)
235                        * Quaternion::rotation_y(0.5)
236                        * Quaternion::rotation_z(0.0);
237
238                    next.control.orientation =
239                        Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(-0.1);
240                },
241                Some(ToolKind::Natural) => {
242                    if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
243                        match spec.as_str() {
244                            "Wendigo Magic" => {
245                                next.control_l.position = Vec3::new(-9.0, 19.0, -13.0);
246                                next.control_r.position = Vec3::new(9.0, 19.0, -13.0);
247
248                                next.control_l.orientation = Quaternion::rotation_x(PI / 3.0)
249                                    * Quaternion::rotation_y(-0.15);
250                                next.control_r.orientation =
251                                    Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_y(0.15);
252                            },
253                            "Tidal Warrior" => {
254                                next.hand_l.position = Vec3::new(-14.0, 2.0, -4.0);
255                                next.hand_r.position = Vec3::new(14.0, 2.0, -4.0);
256
257                                next.hand_l.orientation = Quaternion::rotation_x(PI / 3.0)
258                                    * Quaternion::rotation_z(-0.35);
259                                next.hand_r.orientation =
260                                    Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35);
261                            },
262                            "Beast Claws" | "Tursus Claws" | "Strigoi Claws" => {
263                                next.shoulder_l.position =
264                                    Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
265
266                                next.shoulder_r.position =
267                                    Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
268
269                                next.hand_l.position =
270                                    Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
271
272                                next.hand_r.position =
273                                    Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
274
275                                if speed < 0.5 {
276                                    next.head.position =
277                                        Vec3::new(0.0, s_a.head.0, s_a.head.1 + torso * 0.2) * 1.02;
278                                    next.head.orientation = Quaternion::rotation_z(look.x * 0.6)
279                                        * Quaternion::rotation_x(look.y * 0.6);
280
281                                    next.upper_torso.position = Vec3::new(
282                                        0.0,
283                                        s_a.upper_torso.0,
284                                        s_a.upper_torso.1 + torso * 0.5,
285                                    );
286
287                                    next.lower_torso.position = Vec3::new(
288                                        0.0,
289                                        s_a.lower_torso.0,
290                                        s_a.lower_torso.1 + torso * 0.15,
291                                    );
292
293                                    next.jaw.orientation = Quaternion::rotation_x(-0.1);
294
295                                    next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
296                                    next.tail.orientation =
297                                        Quaternion::rotation_z(slow * 0.2 + tailmove.x);
298
299                                    next.second.orientation = Quaternion::rotation_x(PI);
300
301                                    next.main.position = Vec3::new(0.0, 0.0, 0.0);
302                                    next.main.orientation = Quaternion::rotation_y(0.0);
303
304                                    next.shoulder_l.position =
305                                        Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
306
307                                    next.hand_l.position = Vec3::new(
308                                        -s_a.hand.0,
309                                        s_a.hand.1,
310                                        s_a.hand.2 + torso * 0.6,
311                                    );
312
313                                    next.hand_r.position =
314                                        Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
315
316                                    next.leg_l.position =
317                                        Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
318                                    next.leg_l.orientation =
319                                        Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
320
321                                    next.leg_r.position =
322                                        Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
323                                    next.leg_r.orientation =
324                                        Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
325                                } else {
326                                    next.head.position =
327                                        Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
328                                    next.head.orientation = Quaternion::rotation_z(short * -0.18)
329                                        * Quaternion::rotation_x(-0.05);
330                                    next.head.scale = Vec3::one() * 1.02;
331
332                                    next.upper_torso.position = Vec3::new(
333                                        0.0,
334                                        s_a.upper_torso.0,
335                                        s_a.upper_torso.1 + shortalt * -1.5,
336                                    );
337                                    next.upper_torso.orientation =
338                                        Quaternion::rotation_z(short * 0.18);
339
340                                    next.lower_torso.position =
341                                        Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
342                                    next.lower_torso.orientation =
343                                        Quaternion::rotation_z(short * 0.15)
344                                            * Quaternion::rotation_x(0.14);
345                                    next.lower_torso.scale = Vec3::one() * 1.02;
346
347                                    next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
348                                    next.jaw.orientation = Quaternion::rotation_x(0.0);
349                                    next.jaw.scale = Vec3::one() * 1.02;
350
351                                    next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
352                                    next.tail.orientation = Quaternion::rotation_x(shortalt * 0.3);
353
354                                    next.second.position = Vec3::new(0.0, 0.0, 0.0);
355                                    next.second.orientation = Quaternion::rotation_x(PI)
356                                        * Quaternion::rotation_y(0.0)
357                                        * Quaternion::rotation_z(0.0);
358                                    next.second.scale = Vec3::one() * 0.0;
359
360                                    next.control.position = Vec3::new(0.0, 0.0, 0.0);
361                                    next.control.orientation = Quaternion::rotation_z(0.0);
362
363                                    next.main.position = Vec3::new(0.0, 0.0, 0.0);
364                                    next.main.orientation = Quaternion::rotation_y(0.0);
365
366                                    next.shoulder_l.position = Vec3::new(
367                                        -s_a.shoulder.0,
368                                        s_a.shoulder.1 + foothoril * -3.0,
369                                        s_a.shoulder.2,
370                                    );
371                                    next.shoulder_l.orientation =
372                                        Quaternion::rotation_x(footrotl * -0.36)
373                                            * Quaternion::rotation_y(0.1)
374                                            * Quaternion::rotation_z(footrotl * 0.3);
375
376                                    next.shoulder_r.position = Vec3::new(
377                                        s_a.shoulder.0,
378                                        s_a.shoulder.1 + foothorir * -3.0,
379                                        s_a.shoulder.2,
380                                    );
381                                    next.shoulder_r.orientation =
382                                        Quaternion::rotation_x(footrotr * -0.36)
383                                            * Quaternion::rotation_y(-0.1)
384                                            * Quaternion::rotation_z(footrotr * -0.3);
385
386                                    next.hand_l.position = Vec3::new(
387                                        -1.0 + -s_a.hand.0,
388                                        s_a.hand.1 + foothoril * -4.0,
389                                        s_a.hand.2 + foothoril * 1.0,
390                                    );
391                                    next.hand_l.orientation =
392                                        Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3))
393                                            * Quaternion::rotation_y(handhoril * -0.1);
394
395                                    next.hand_r.position = Vec3::new(
396                                        1.0 + s_a.hand.0,
397                                        s_a.hand.1 + foothorir * -4.0,
398                                        s_a.hand.2 + foothorir * 1.0,
399                                    );
400                                    next.hand_r.orientation =
401                                        Quaternion::rotation_x(0.15 + (handhorir * -1.2).max(-0.3))
402                                            * Quaternion::rotation_y(handhorir * 0.1);
403                                    next.hand_r.scale = Vec3::one() * 1.04;
404
405                                    next.leg_l.position =
406                                        Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) * 0.98;
407                                    next.leg_l.orientation = Quaternion::rotation_z(short * 0.18)
408                                        * Quaternion::rotation_x(foothoril * 0.3);
409                                    next.leg_r.position =
410                                        Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) * 0.98;
411
412                                    next.leg_r.orientation = Quaternion::rotation_z(short * 0.18)
413                                        * Quaternion::rotation_x(foothorir * 0.3);
414
415                                    next.foot_l.position = Vec3::new(
416                                        -s_a.foot.0,
417                                        s_a.foot.1 + foothoril * 8.5,
418                                        s_a.foot.2 + ((footvertl * 6.5).max(0.0)),
419                                    );
420                                    next.foot_l.orientation =
421                                        Quaternion::rotation_x(-0.5 + footrotl * 0.85);
422
423                                    next.foot_r.position = Vec3::new(
424                                        s_a.foot.0,
425                                        s_a.foot.1 + foothorir * 8.5,
426                                        s_a.foot.2 + ((footvertr * 6.5).max(0.0)),
427                                    );
428                                    next.foot_r.orientation =
429                                        Quaternion::rotation_x(-0.5 + footrotr * 0.85);
430
431                                    next.torso.orientation = Quaternion::rotation_x(-0.25);
432                                }
433                            },
434                            "Minotaur" => {
435                                next.control_l.position = Vec3::new(0.0, 4.0, 5.0);
436                                next.control_r.position = Vec3::new(0.0, 4.0, 5.0);
437                                next.weapon_l.position = Vec3::new(-12.0, -6.0, -18.0);
438                                next.weapon_r.position = Vec3::new(12.0, -6.0, -18.0);
439
440                                next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
441                                next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
442
443                                next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
444                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
445
446                                next.control.orientation =
447                                    Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
448                                next.shoulder_l.orientation = Quaternion::rotation_x(-0.3);
449
450                                next.shoulder_r.orientation = Quaternion::rotation_x(-0.3);
451                                next.second.scale = Vec3::one() * 1.0;
452                            },
453                            "Yeti" => {
454                                next.second.scale = Vec3::one() * 0.0;
455                                next.control_l.position = Vec3::new(-0.5, 4.0, 1.0);
456                                next.control_r.position = Vec3::new(-0.5, 4.0, 1.0);
457                                next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0);
458                                next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0);
459
460                                next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
461                                next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
462
463                                next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
464                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
465
466                                next.control.orientation =
467                                    Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
468                                next.shoulder_l.orientation = Quaternion::rotation_x(-0.3);
469
470                                next.shoulder_r.orientation = Quaternion::rotation_x(-0.3);
471                            },
472                            "Harvester" => {
473                                next.control_l.position = Vec3::new(1.0, 2.0, 8.0);
474                                next.control_r.position = Vec3::new(1.0, 1.0, -2.0);
475
476                                next.control.position = Vec3::new(
477                                    -7.0,
478                                    0.0 + s_a.grip.0 / 1.0,
479                                    -s_a.grip.0 / 0.8 + short * -1.5,
480                                );
481
482                                next.control_l.orientation =
483                                    Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI);
484                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2)
485                                    * Quaternion::rotation_y(-1.0)
486                                    * Quaternion::rotation_z(0.0);
487
488                                next.control.orientation =
489                                    Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8);
490
491                                next.shoulder_l.position = Vec3::new(
492                                    -s_a.shoulder.0,
493                                    s_a.shoulder.1,
494                                    s_a.shoulder.2 - foothorir * 1.0,
495                                );
496                                next.shoulder_l.orientation = Quaternion::rotation_x(-0.4);
497                                next.shoulder_r.orientation =
498                                    Quaternion::rotation_y(0.4) * Quaternion::rotation_x(0.4);
499                            },
500                            "Husk Brute" | "TerracottaDemolisher" => {
501                                if speed > 0.1 {
502                                    next.hand_l.position =
503                                        Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
504                                    next.hand_l.orientation =
505                                        Quaternion::rotation_x(1.4 + slow * 0.1)
506                                            * Quaternion::rotation_z(-PI / 2.0);
507
508                                    next.hand_r.position =
509                                        Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
510                                    next.hand_r.orientation =
511                                        Quaternion::rotation_x(1.4 - slow * 0.1)
512                                            * Quaternion::rotation_z(PI / 2.0);
513
514                                    next.shoulder_l.position =
515                                        Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
516                                    next.shoulder_l.orientation =
517                                        Quaternion::rotation_x(1.1 + slow * 0.1);
518
519                                    next.shoulder_r.position =
520                                        Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
521                                    next.shoulder_r.orientation =
522                                        Quaternion::rotation_x(1.1 - slow * 0.1);
523                                } else {
524                                    next.shoulder_l.position =
525                                        Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
526                                    next.shoulder_l.orientation = Quaternion::rotation_x(breathe);
527
528                                    next.shoulder_r.position =
529                                        Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
530                                    next.shoulder_r.orientation = Quaternion::rotation_x(breathe);
531
532                                    next.hand_l.position = Vec3::new(
533                                        -s_a.hand.0,
534                                        s_a.hand.1,
535                                        s_a.hand.2 + torso * -0.1,
536                                    );
537
538                                    next.hand_r.position = Vec3::new(
539                                        s_a.hand.0,
540                                        s_a.hand.1,
541                                        s_a.hand.2 + torso * -0.1,
542                                    );
543
544                                    next.leg_l.position =
545                                        Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * -0.2);
546
547                                    next.leg_r.position =
548                                        Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * -0.2);
549
550                                    next.foot_l.position =
551                                        Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
552
553                                    next.foot_r.position =
554                                        Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
555                                }
556                            },
557                            _ => {},
558                        }
559                    }
560                },
561                _ => {},
562            }
563        }
564
565        if s_a.float {
566            next.upper_torso.position = Vec3::new(
567                0.0,
568                s_a.upper_torso.0,
569                s_a.upper_torso.1 + slower * 1.0 + 4.0,
570            );
571            next.foot_l.orientation = Quaternion::rotation_x(-0.5 + slow * 0.1);
572            next.foot_r.orientation = Quaternion::rotation_x(-0.5 + slow * 0.1);
573        }
574
575        next
576    }
577}