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", unsafe(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                    if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
224                        match spec.as_str() {
225                            "Tidal Warrior" => {
226                                next.control_l.position = Vec3::new(-1.0, 4.0, 8.0);
227                                next.control_r.position = Vec3::new(10.0, 2.0, 2.0);
228
229                                next.control.position = Vec3::new(
230                                    -3.0,
231                                    3.0 + s_a.grip.0 / 1.2,
232                                    -11.0 + -s_a.grip.0 / 2.0 + short * -1.5,
233                                );
234
235                                next.control_l.orientation =
236                                    Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.9);
237                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.5)
238                                    * Quaternion::rotation_y(0.9)
239                                    * Quaternion::rotation_z(0.0);
240
241                                next.control.orientation =
242                                    Quaternion::rotation_x(-0.2 + short * 0.2)
243                                        * Quaternion::rotation_y(-0.3);
244                            },
245                            _ => {
246                                next.control_l.position = Vec3::new(-1.0, 3.0, 12.0);
247                                next.control_r.position = Vec3::new(1.0, 2.0, 2.0);
248
249                                next.control.position = Vec3::new(
250                                    -3.0,
251                                    3.0 + s_a.grip.0 / 1.2,
252                                    -11.0 + -s_a.grip.0 / 2.0 + short * -1.5,
253                                );
254
255                                next.control_l.orientation =
256                                    Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.5);
257                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.5)
258                                    * Quaternion::rotation_y(0.5)
259                                    * Quaternion::rotation_z(0.0);
260
261                                next.control.orientation =
262                                    Quaternion::rotation_x(-0.2 + short * 0.2)
263                                        * Quaternion::rotation_y(-0.1);
264                            },
265                        }
266                    }
267                },
268                Some(ToolKind::Spear) => {
269                    if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
270                        match spec.as_str() {
271                            "Tidal Warrior" => {
272                                next.control_l.position = Vec3::new(-1.0, 4.0, 8.0);
273                                next.control_r.position = Vec3::new(10.0, 2.0, 2.0);
274
275                                next.control.position = Vec3::new(
276                                    -3.0,
277                                    3.0 + s_a.grip.0 / 1.2,
278                                    -11.0 + -s_a.grip.0 / 2.0 + short * -1.5,
279                                );
280
281                                next.control_l.orientation =
282                                    Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.9);
283                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.5)
284                                    * Quaternion::rotation_y(0.9)
285                                    * Quaternion::rotation_z(0.0);
286
287                                next.control.orientation =
288                                    Quaternion::rotation_x(-0.2 + short * 0.2)
289                                        * Quaternion::rotation_y(-0.3);
290                            },
291                            _ => {},
292                        }
293                    }
294                },
295                Some(ToolKind::Natural) => {
296                    if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
297                        match spec.as_str() {
298                            "Wendigo Magic" => {
299                                next.control_l.position = Vec3::new(-9.0, 19.0, -13.0);
300                                next.control_r.position = Vec3::new(9.0, 19.0, -13.0);
301
302                                next.control_l.orientation = Quaternion::rotation_x(PI / 3.0)
303                                    * Quaternion::rotation_y(-0.15);
304                                next.control_r.orientation =
305                                    Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_y(0.15);
306                            },
307                            "Tidal Warrior" => {
308                                next.hand_l.position = Vec3::new(-14.0, 2.0, -4.0);
309                                next.hand_r.position = Vec3::new(14.0, 2.0, -4.0);
310
311                                next.hand_l.orientation = Quaternion::rotation_x(PI / 3.0)
312                                    * Quaternion::rotation_z(-0.35);
313                                next.hand_r.orientation =
314                                    Quaternion::rotation_x(PI / 3.0) * Quaternion::rotation_z(0.35);
315                            },
316                            "Beast Claws" | "Tursus Claws" | "Strigoi Claws" => {
317                                next.shoulder_l.position =
318                                    Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
319
320                                next.shoulder_r.position =
321                                    Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
322
323                                next.hand_l.position =
324                                    Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
325
326                                next.hand_r.position =
327                                    Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
328
329                                if speed < 0.5 {
330                                    next.head.position =
331                                        Vec3::new(0.0, s_a.head.0, s_a.head.1 + torso * 0.2) * 1.02;
332                                    next.head.orientation = Quaternion::rotation_z(look.x * 0.6)
333                                        * Quaternion::rotation_x(look.y * 0.6);
334
335                                    next.upper_torso.position = Vec3::new(
336                                        0.0,
337                                        s_a.upper_torso.0,
338                                        s_a.upper_torso.1 + torso * 0.5,
339                                    );
340
341                                    next.lower_torso.position = Vec3::new(
342                                        0.0,
343                                        s_a.lower_torso.0,
344                                        s_a.lower_torso.1 + torso * 0.15,
345                                    );
346
347                                    next.jaw.orientation = Quaternion::rotation_x(-0.1);
348
349                                    next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
350                                    next.tail.orientation =
351                                        Quaternion::rotation_z(slow * 0.2 + tailmove.x);
352
353                                    next.second.orientation = Quaternion::rotation_x(PI);
354
355                                    next.main.position = Vec3::new(0.0, 0.0, 0.0);
356                                    next.main.orientation = Quaternion::rotation_y(0.0);
357
358                                    next.shoulder_l.position =
359                                        Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
360
361                                    next.hand_l.position = Vec3::new(
362                                        -s_a.hand.0,
363                                        s_a.hand.1,
364                                        s_a.hand.2 + torso * 0.6,
365                                    );
366
367                                    next.hand_r.position =
368                                        Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
369
370                                    next.leg_l.position =
371                                        Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
372                                    next.leg_l.orientation =
373                                        Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
374
375                                    next.leg_r.position =
376                                        Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
377                                    next.leg_r.orientation =
378                                        Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
379                                } else {
380                                    next.head.position =
381                                        Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
382                                    next.head.orientation = Quaternion::rotation_z(short * -0.18)
383                                        * Quaternion::rotation_x(-0.05);
384                                    next.head.scale = Vec3::one() * 1.02;
385
386                                    next.upper_torso.position = Vec3::new(
387                                        0.0,
388                                        s_a.upper_torso.0,
389                                        s_a.upper_torso.1 + shortalt * -1.5,
390                                    );
391                                    next.upper_torso.orientation =
392                                        Quaternion::rotation_z(short * 0.18);
393
394                                    next.lower_torso.position =
395                                        Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
396                                    next.lower_torso.orientation =
397                                        Quaternion::rotation_z(short * 0.15)
398                                            * Quaternion::rotation_x(0.14);
399                                    next.lower_torso.scale = Vec3::one() * 1.02;
400
401                                    next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
402                                    next.jaw.orientation = Quaternion::rotation_x(0.0);
403                                    next.jaw.scale = Vec3::one() * 1.02;
404
405                                    next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
406                                    next.tail.orientation = Quaternion::rotation_x(shortalt * 0.3);
407
408                                    next.second.position = Vec3::new(0.0, 0.0, 0.0);
409                                    next.second.orientation = Quaternion::rotation_x(PI)
410                                        * Quaternion::rotation_y(0.0)
411                                        * Quaternion::rotation_z(0.0);
412                                    next.second.scale = Vec3::one() * 0.0;
413
414                                    next.control.position = Vec3::new(0.0, 0.0, 0.0);
415                                    next.control.orientation = Quaternion::rotation_z(0.0);
416
417                                    next.main.position = Vec3::new(0.0, 0.0, 0.0);
418                                    next.main.orientation = Quaternion::rotation_y(0.0);
419
420                                    next.shoulder_l.position = Vec3::new(
421                                        -s_a.shoulder.0,
422                                        s_a.shoulder.1 + foothoril * -3.0,
423                                        s_a.shoulder.2,
424                                    );
425                                    next.shoulder_l.orientation =
426                                        Quaternion::rotation_x(footrotl * -0.36)
427                                            * Quaternion::rotation_y(0.1)
428                                            * Quaternion::rotation_z(footrotl * 0.3);
429
430                                    next.shoulder_r.position = Vec3::new(
431                                        s_a.shoulder.0,
432                                        s_a.shoulder.1 + foothorir * -3.0,
433                                        s_a.shoulder.2,
434                                    );
435                                    next.shoulder_r.orientation =
436                                        Quaternion::rotation_x(footrotr * -0.36)
437                                            * Quaternion::rotation_y(-0.1)
438                                            * Quaternion::rotation_z(footrotr * -0.3);
439
440                                    next.hand_l.position = Vec3::new(
441                                        -1.0 + -s_a.hand.0,
442                                        s_a.hand.1 + foothoril * -4.0,
443                                        s_a.hand.2 + foothoril * 1.0,
444                                    );
445                                    next.hand_l.orientation =
446                                        Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3))
447                                            * Quaternion::rotation_y(handhoril * -0.1);
448
449                                    next.hand_r.position = Vec3::new(
450                                        1.0 + s_a.hand.0,
451                                        s_a.hand.1 + foothorir * -4.0,
452                                        s_a.hand.2 + foothorir * 1.0,
453                                    );
454                                    next.hand_r.orientation =
455                                        Quaternion::rotation_x(0.15 + (handhorir * -1.2).max(-0.3))
456                                            * Quaternion::rotation_y(handhorir * 0.1);
457                                    next.hand_r.scale = Vec3::one() * 1.04;
458
459                                    next.leg_l.position =
460                                        Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) * 0.98;
461                                    next.leg_l.orientation = Quaternion::rotation_z(short * 0.18)
462                                        * Quaternion::rotation_x(foothoril * 0.3);
463                                    next.leg_r.position =
464                                        Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) * 0.98;
465
466                                    next.leg_r.orientation = Quaternion::rotation_z(short * 0.18)
467                                        * Quaternion::rotation_x(foothorir * 0.3);
468
469                                    next.foot_l.position = Vec3::new(
470                                        -s_a.foot.0,
471                                        s_a.foot.1 + foothoril * 8.5,
472                                        s_a.foot.2 + ((footvertl * 6.5).max(0.0)),
473                                    );
474                                    next.foot_l.orientation =
475                                        Quaternion::rotation_x(-0.5 + footrotl * 0.85);
476
477                                    next.foot_r.position = Vec3::new(
478                                        s_a.foot.0,
479                                        s_a.foot.1 + foothorir * 8.5,
480                                        s_a.foot.2 + ((footvertr * 6.5).max(0.0)),
481                                    );
482                                    next.foot_r.orientation =
483                                        Quaternion::rotation_x(-0.5 + footrotr * 0.85);
484
485                                    next.torso.orientation = Quaternion::rotation_x(-0.25);
486                                }
487                            },
488                            "Minotaur" => {
489                                next.control_l.position = Vec3::new(0.0, 4.0, 5.0);
490                                next.control_r.position = Vec3::new(0.0, 4.0, 5.0);
491                                next.weapon_l.position = Vec3::new(-12.0, -6.0, -18.0);
492                                next.weapon_r.position = Vec3::new(12.0, -6.0, -18.0);
493
494                                next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
495                                next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
496
497                                next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
498                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
499
500                                next.control.orientation =
501                                    Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
502                                next.shoulder_l.orientation = Quaternion::rotation_x(-0.3);
503
504                                next.shoulder_r.orientation = Quaternion::rotation_x(-0.3);
505                                next.second.scale = Vec3::one() * 1.0;
506                            },
507                            "Yeti" => {
508                                next.second.scale = Vec3::one() * 0.0;
509                                next.control_l.position = Vec3::new(-0.5, 4.0, 1.0);
510                                next.control_r.position = Vec3::new(-0.5, 4.0, 1.0);
511                                next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0);
512                                next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0);
513
514                                next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
515                                next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
516
517                                next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
518                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
519
520                                next.control.orientation =
521                                    Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
522                                next.shoulder_l.orientation = Quaternion::rotation_x(-0.3);
523
524                                next.shoulder_r.orientation = Quaternion::rotation_x(-0.3);
525                            },
526                            "Harvester" => {
527                                next.control_l.position = Vec3::new(1.0, 2.0, 8.0);
528                                next.control_r.position = Vec3::new(1.0, 1.0, -2.0);
529
530                                next.control.position = Vec3::new(
531                                    -7.0,
532                                    0.0 + s_a.grip.0 / 1.0,
533                                    -s_a.grip.0 / 0.8 + short * -1.5,
534                                );
535
536                                next.control_l.orientation =
537                                    Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI);
538                                next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2)
539                                    * Quaternion::rotation_y(-1.0)
540                                    * Quaternion::rotation_z(0.0);
541
542                                next.control.orientation =
543                                    Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8);
544
545                                next.shoulder_l.position = Vec3::new(
546                                    -s_a.shoulder.0,
547                                    s_a.shoulder.1,
548                                    s_a.shoulder.2 - foothorir * 1.0,
549                                );
550                                next.shoulder_l.orientation = Quaternion::rotation_x(-0.4);
551                                next.shoulder_r.orientation =
552                                    Quaternion::rotation_y(0.4) * Quaternion::rotation_x(0.4);
553                            },
554                            "Husk Brute" | "TerracottaDemolisher" => {
555                                if speed > 0.1 {
556                                    next.hand_l.position =
557                                        Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
558                                    next.hand_l.orientation =
559                                        Quaternion::rotation_x(1.4 + slow * 0.1)
560                                            * Quaternion::rotation_z(-PI / 2.0);
561
562                                    next.hand_r.position =
563                                        Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
564                                    next.hand_r.orientation =
565                                        Quaternion::rotation_x(1.4 - slow * 0.1)
566                                            * Quaternion::rotation_z(PI / 2.0);
567
568                                    next.shoulder_l.position =
569                                        Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
570                                    next.shoulder_l.orientation =
571                                        Quaternion::rotation_x(1.1 + slow * 0.1);
572
573                                    next.shoulder_r.position =
574                                        Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
575                                    next.shoulder_r.orientation =
576                                        Quaternion::rotation_x(1.1 - slow * 0.1);
577                                } else {
578                                    next.shoulder_l.position =
579                                        Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
580                                    next.shoulder_l.orientation = Quaternion::rotation_x(breathe);
581
582                                    next.shoulder_r.position =
583                                        Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
584                                    next.shoulder_r.orientation = Quaternion::rotation_x(breathe);
585
586                                    next.hand_l.position = Vec3::new(
587                                        -s_a.hand.0,
588                                        s_a.hand.1,
589                                        s_a.hand.2 + torso * -0.1,
590                                    );
591
592                                    next.hand_r.position = Vec3::new(
593                                        s_a.hand.0,
594                                        s_a.hand.1,
595                                        s_a.hand.2 + torso * -0.1,
596                                    );
597
598                                    next.leg_l.position =
599                                        Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * -0.2);
600
601                                    next.leg_r.position =
602                                        Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * -0.2);
603
604                                    next.foot_l.position =
605                                        Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
606
607                                    next.foot_r.position =
608                                        Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
609                                }
610                            },
611                            _ => {},
612                        }
613                    }
614                },
615                _ => {},
616            }
617        }
618
619        if s_a.float {
620            next.upper_torso.position = Vec3::new(
621                0.0,
622                s_a.upper_torso.0,
623                s_a.upper_torso.1 + slower * 1.0 + 4.0,
624            );
625            next.foot_l.orientation = Quaternion::rotation_x(-0.5 + slow * 0.1);
626            next.foot_r.orientation = Quaternion::rotation_x(-0.5 + slow * 0.1);
627        }
628
629        next
630    }
631}