Re-address approx_constant lint without using fractional constants and

re-add a few blank lines
This commit is contained in:
Imbris 2021-07-17 20:31:13 -04:00
parent 9c72333741
commit 30119a6afc
57 changed files with 274 additions and 252 deletions

View File

@ -178,6 +178,7 @@ impl<'a, VIE: VoxelImageEncoding> VoxelImageEncoding for &'a VIE {
fn finish(ws: &Self::Workspace) -> Option<Self::Output> { VIE::finish(ws) }
}
impl<'a, VIE: VoxelImageDecoding> VoxelImageDecoding for &'a VIE {
fn start(ws: &Self::Output) -> Option<Self::Workspace> { VIE::start(ws) }
@ -185,6 +186,7 @@ impl<'a, VIE: VoxelImageDecoding> VoxelImageDecoding for &'a VIE {
VIE::get_block(ws, x, y, is_border)
}
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub struct QuadPngEncoding<const RESOLUTION_DIVIDER: u32>();

View File

@ -21,6 +21,7 @@ use std::{
};
use strum_macros::Display;
use vek::*;
pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0;
impl Body {

View File

@ -6,7 +6,7 @@ use common::{
comp::item::tool::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct AlphaAnimation;
@ -27,7 +27,6 @@ impl Animation for AlphaAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_alpha\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_alpha")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(
@ -286,8 +285,10 @@ impl Animation for AlphaAnimation {
* Quaternion::rotation_y(move1 * 0.3 + move2 * -0.6)
* Quaternion::rotation_z(move1 * -0.8 + move2 * 1.8);
next.control_l.orientation = Quaternion::rotation_x(1.57 + move2 * 1.0);
next.control_r.orientation = Quaternion::rotation_x(1.57 + move2 * 1.0);
next.control_l.orientation =
Quaternion::rotation_x(PI / 2.0 + move2 * 1.0);
next.control_r.orientation =
Quaternion::rotation_x(PI / 2.0 + move2 * 1.0);
next.shoulder_l.orientation = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(move1 * 0.7 + move2 * -0.7);

View File

@ -6,7 +6,7 @@ use common::{
comp::item::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct BeamAnimation;
@ -182,14 +182,14 @@ impl Animation for BeamAnimation {
Quaternion::rotation_x(move2 * -0.5 + move2shake * -0.1);
next.control_l.position = Vec3::new(-0.5, 4.0, 1.0);
next.control_r.position = Vec3::new(-0.5, 4.0, 1.0);
next.control_l.orientation = Quaternion::rotation_x(1.57);
next.control_r.orientation = Quaternion::rotation_x(1.57);
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0);
next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0);
next.weapon_l.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.arm_control_r.orientation =
Quaternion::rotation_x(move1 * 1.1 + move2 * -1.6)

View File

@ -3,7 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct BlinkAnimation;
@ -22,7 +22,6 @@ impl Animation for BlinkAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_blink\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_blink")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'a>,

View File

@ -3,6 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::comp::item::ToolKind;
use core::f32::consts::PI;
pub struct ChargeAnimation;
@ -34,7 +35,8 @@ impl Animation for ChargeAnimation {
let foot = ((5.0 / (0.2 + 4.8 * ((anim_time * lab * 8.0).sin()).powi(2))).sqrt())
* ((anim_time * lab * 8.0).sin());
let foote = ((5.0 / (0.5 + 4.5 * ((anim_time * lab * 8.0 + 1.57).sin()).powi(2))).sqrt())
let foote = ((5.0 / (0.5 + 4.5 * ((anim_time * lab * 8.0 + PI / 2.0).sin()).powi(2)))
.sqrt())
* ((anim_time * lab * 8.0).sin());
let stress = ((5.0 / (0.5 + 4.5 * ((anim_time * lab * 20.0).cos()).powi(2))).sqrt())
* ((anim_time * lab * 20.0).cos());
@ -99,7 +101,7 @@ impl Animation for ChargeAnimation {
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
next.hold.position = Vec3::new(0.0, -1.0, -15.2);
next.hold.orientation = Quaternion::rotation_x(-1.57);
next.hold.orientation = Quaternion::rotation_x(-PI / 2.0);
next.hold.scale = Vec3::one() * 1.0;
next.control.position = Vec3::new(

View File

@ -6,7 +6,7 @@ use common::{
comp::item::tool::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct ChargeMeleeAnimation;
@ -26,7 +26,6 @@ impl Animation for ChargeMeleeAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_chargemelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_chargemelee")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(
@ -136,9 +135,9 @@ impl Animation for ChargeMeleeAnimation {
) * Quaternion::rotation_z(0.0);
next.control_l.orientation =
Quaternion::rotation_x(1.57 + move1 * 0.2 + move2 * 0.1);
Quaternion::rotation_x(PI / 2.0 + move1 * 0.2 + move2 * 0.1);
next.control_r.orientation =
Quaternion::rotation_x(1.57 + move1 * 0.4 + move2 * -0.4);
Quaternion::rotation_x(PI / 2.0 + move1 * 0.4 + move2 * -0.4);
next.control.orientation =
Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
@ -157,16 +156,16 @@ impl Animation for ChargeMeleeAnimation {
next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3);
next.control_l.position = Vec3::new(-0.5, 4.0, 1.0);
next.control_r.position = Vec3::new(-0.5, 4.0, 1.0);
next.control_l.orientation = Quaternion::rotation_x(1.57);
next.control_r.orientation = Quaternion::rotation_x(1.57);
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.weapon_l.position =
Vec3::new(-12.0 + (move1 * 10.0).min(6.0), -1.0, -15.0);
next.weapon_r.position =
Vec3::new(12.0 + (move1 * -10.0).max(-6.0), -1.0, -15.0);
next.weapon_l.orientation = Quaternion::rotation_x(-1.57 - 0.1)
next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1)
* Quaternion::rotation_z(move1 * -0.8);
next.weapon_r.orientation = Quaternion::rotation_x(-1.57 - 0.1)
next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1)
* Quaternion::rotation_z(move1 * 0.8);
next.shoulder_l.orientation =

View File

@ -6,7 +6,7 @@ use common::{
comp::item::tool::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct DashAnimation;
@ -187,8 +187,8 @@ impl Animation for DashAnimation {
* Quaternion::rotation_y(move1 * 0.6 + move2 * -0.6)
* Quaternion::rotation_z(move3 * -0.5);
next.control_l.orientation = Quaternion::rotation_x(1.57);
next.control_r.orientation = Quaternion::rotation_x(1.57);
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.control.orientation =
Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
@ -200,7 +200,7 @@ impl Animation for DashAnimation {
next.head.orientation =
Quaternion::rotation_x(0.0) * Quaternion::rotation_z(move1 * -0.3);
next.upper_torso.orientation = Quaternion::rotation_x(move1 * -0.1)
* Quaternion::rotation_z(move1 * 1.57);
* Quaternion::rotation_z(move1 * PI / 2.0);
next.lower_torso.orientation = Quaternion::rotation_x(move1 * 0.1)
* Quaternion::rotation_x(move1 * -0.1)
* Quaternion::rotation_z(move1 * -0.2);

View File

@ -3,7 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::comp::item::ToolKind;
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct EquipAnimation;
@ -15,7 +15,6 @@ impl Animation for EquipAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_equip\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_equip")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, _velocity, _global_time): Self::Dependency<'a>,
@ -28,8 +27,8 @@ impl Animation for EquipAnimation {
let equip_slow = 1.0 + (anim_time * 12.0 + PI).cos();
let equip_slowa = 1.0 + (anim_time * 12.0 + PI / 4.0).cos();
next.hand_l.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(-1.57);
next.hand_r.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(1.57);
next.hand_l.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(-PI / 2.0);
next.hand_r.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(PI / 2.0);
next.control.position = Vec3::new(equip_slowa * -1.5, 0.0, equip_slow * 1.5);
match active_tool_kind {
@ -49,9 +48,9 @@ impl Animation for EquipAnimation {
next.hand_l.position = Vec3::new(4.0, -6.0, 0.0);
next.hand_r.position = Vec3::new(6.0, -6.0, 6.0);
next.hand_l.orientation =
Quaternion::rotation_y(2.2) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.2) * Quaternion::rotation_z(PI / 2.0);
next.hand_r.orientation =
Quaternion::rotation_y(2.2) * Quaternion::rotation_z(-1.57);
Quaternion::rotation_y(2.2) * Quaternion::rotation_z(-PI / 2.0);
},
Some(ToolKind::Bow) => {
next.hand_l.position = Vec3::new(-9.0, -5.0, -8.0);

View File

@ -3,7 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::comp::item::ToolKind;
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct IdleAnimation;
@ -91,26 +91,31 @@ impl Animation for IdleAnimation {
match active_tool_kind {
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, -6.0, 0.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.main.position = Vec3::new(-6.0, -5.0, -12.0);
next.main.orientation = Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Sword) => {
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Hammer) | Some(ToolKind::Axe) => {
next.main.position = Vec3::new(-6.0, -8.0, 8.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
next.second.position = Vec3::new(6.0, -8.0, 8.0);
next.second.orientation =
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {
next.main.position = Vec3::new(-2.0, -5.0, -6.0);
next.main.orientation = Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(PI / 2.0);
},
}

View File

@ -3,7 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::comp::item::ToolKind;
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct JumpAnimation;
@ -64,23 +64,28 @@ impl Animation for JumpAnimation {
match active_tool_kind {
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(-2.0, -5.0, -6.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.main.position = Vec3::new(-6.0, -5.0, -12.0);
next.main.orientation = Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Sword) => {
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Hammer) | Some(ToolKind::Axe) => {
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {
next.main.position = Vec3::new(-2.0, -5.0, -6.0);
next.main.orientation = Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(PI / 2.0);
},
}

View File

@ -3,6 +3,8 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use core::f32::consts::PI;
pub struct LeapAnimation;
impl Animation for LeapAnimation {
@ -19,7 +21,6 @@ impl Animation for LeapAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_leapmelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_leapmelee")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency<'a>,
@ -54,7 +55,7 @@ impl Animation for LeapAnimation {
s_a.hc.2 + movement2 * 5.0 + movement3 * -10.0,
);
next.control.orientation =
Quaternion::rotation_x(s_a.hc.3 + movement2 * 1.57 + movement3 * -2.3)
Quaternion::rotation_x(s_a.hc.3 + movement2 * PI / 2.0 + movement3 * -2.3)
* Quaternion::rotation_y(s_a.hc.4 + movement2 * 1.3)
* Quaternion::rotation_z(s_a.hc.5 + movement2 * -1.0 + movement3 * 0.5);
next.upper_torso.orientation =

View File

@ -33,7 +33,7 @@ pub use self::{
use super::{make_bone, vek::*, FigureBoneData, Skeleton};
use common::comp::{self};
use core::convert::TryFrom;
use core::{convert::TryFrom, f32::consts::PI};
pub type Body = comp::biped_large::Body;
@ -483,16 +483,16 @@ impl<'a> From<&'a Body> for SkeletonAttr {
_ => (-7.0, 7.0, -10.0, -0.1, 0.0, 0.0),
},
hhl: match (body.species, body.body_type) {
(Ogre, Male) => (-9.0, -10.0, 23.0, 1.57, -0.57, 0.0),
_ => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0),
(Ogre, Male) => (-9.0, -10.0, 23.0, PI / 2.0, -0.57, 0.0),
_ => (-6.0, -10.0, 17.0, PI / 2.0, -0.57, 0.0),
},
hhr: match (body.species, body.body_type) {
(Ogre, Male) => (-5.0, -13.0, 0.0, 1.57, -0.57, 0.0),
_ => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0),
(Ogre, Male) => (-5.0, -13.0, 0.0, PI / 2.0, -0.57, 0.0),
_ => (-6.0, -10.0, 0.0, PI / 2.0, -0.57, 0.0),
},
hc: match (body.species, body.body_type) {
(Ogre, Male) => (11.5, 9.0, -13.0, -0.57, -1.57, 1.0),
_ => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0),
(Ogre, Male) => (11.5, 9.0, -13.0, -0.57, -PI / 2.0, 1.0),
_ => (8.5, 6.0, -12.0, -0.57, -PI / 2.0, 1.0),
},
sthl: match (body.species, body.body_type) {
(Ogre, Female) => (-1.0, -5.0, 12.0, 1.27, 0.0, 0.0),
@ -501,10 +501,10 @@ impl<'a> From<&'a Body> for SkeletonAttr {
_ => (11.0, 5.0, -4.0, 1.27, 0.0, 0.0),
},
sthr: match (body.species, body.body_type) {
(Ogre, Female) => (5.0, -3.5, 18.0, 1.57, 0.8, 0.0),
(Occultsaurok, _) => (7.0, -3.5, 18.0, 1.57, 0.8, 0.0),
(Mindflayer, _) => (7.0, -9.0, 13.0, 1.57, 0.8, 0.0),
_ => (17.0, 7.5, 2.0, 1.57, 0.8, 0.0),
(Ogre, Female) => (5.0, -3.5, 18.0, PI / 2.0, 0.8, 0.0),
(Occultsaurok, _) => (7.0, -3.5, 18.0, PI / 2.0, 0.8, 0.0),
(Mindflayer, _) => (7.0, -9.0, 13.0, PI / 2.0, 0.8, 0.0),
_ => (17.0, 7.5, 2.0, PI / 2.0, 0.8, 0.0),
},
stc: match (body.species, body.body_type) {
(Ogre, Female) => (-10.0, 7.0, -23.0, -0.3, 0.15, 0.0),
@ -513,11 +513,11 @@ impl<'a> From<&'a Body> for SkeletonAttr {
_ => (-18.0, 1.0, -2.0, -0.3, 0.15, 0.0),
},
bhl: match (body.species, body.body_type) {
(Slysaurok, _) => (-1.0, -12.0, 1.0, 1.57, 0.0, 0.0),
(Slysaurok, _) => (-1.0, -12.0, 1.0, PI / 2.0, 0.0, 0.0),
_ => (3.0, 2.5, 0.0, 1.2, -0.6, -0.3),
},
bhr: match (body.species, body.body_type) {
(Slysaurok, _) => (0.0, -6.0, -2.0, 1.57, 0.0, 0.0),
(Slysaurok, _) => (0.0, -6.0, -2.0, PI / 2.0, 0.0, 0.0),
_ => (5.9, 5.5, -5.0, 1.2, -0.6, -0.3),
},
bc: match (body.species, body.body_type) {

View File

@ -3,7 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::comp::item::ToolKind;
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct RunAnimation;
@ -99,7 +99,7 @@ impl Animation for RunAnimation {
let foot3b = (acc_vel * lab * speedmult + 0.3 + shift3).sin();
//BR
let foot4a = (acc_vel * lab * speedmult + 0.0 + canceler * 0.05 + shift4).sin();
let foot4b = (acc_vel * lab * speedmult + 1.57 + canceler * 0.05 + shift4).sin();
let foot4b = (acc_vel * lab * speedmult + PI / 2.0 + canceler * 0.05 + shift4).sin();
//
let slow = (acc_vel * lab * speedmult + PI).sin();
@ -297,30 +297,30 @@ impl Animation for RunAnimation {
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, -6.0, 0.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.main.position = Vec3::new(-6.0, -5.0, -12.0);
next.main.orientation =
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Sword) => {
next.main.position = Vec3::new(-10.0, -8.0, 12.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Hammer) | Some(ToolKind::Axe) => {
next.main.position = Vec3::new(-6.0, -8.0, 8.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
next.second.position = Vec3::new(6.0, -8.0, 8.0);
next.second.orientation =
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {
next.main.position = Vec3::new(-2.0, -5.0, -6.0);
next.main.orientation =
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(0.6) * Quaternion::rotation_z(PI / 2.0);
},
}

View File

@ -6,7 +6,7 @@ use common::{
comp::item::tool::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct SelfBuffAnimation;
@ -137,9 +137,11 @@ impl Animation for SelfBuffAnimation {
* Quaternion::rotation_y(move1 * -0.85 + tension * 0.12)
* Quaternion::rotation_z(move1 * 0.7);
next.control_l.orientation = Quaternion::rotation_x(1.57 + move1 * 0.1)
next.control_l.orientation =
Quaternion::rotation_x(PI / 2.0 + move1 * 0.1)
* Quaternion::rotation_y(0.0);
next.control_r.orientation = Quaternion::rotation_x(1.57 + move1 * 0.1)
next.control_r.orientation =
Quaternion::rotation_x(PI / 2.0 + move1 * 0.1)
* Quaternion::rotation_y(0.0);
next.control.orientation =

View File

@ -6,6 +6,7 @@ use common::{
comp::item::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use core::f32::consts::PI;
pub struct ShockwaveAnimation;
@ -136,16 +137,16 @@ impl Animation for ShockwaveAnimation {
next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3);
next.control_l.position = Vec3::new(-0.5, 4.0, 1.0);
next.control_r.position = Vec3::new(-0.5, 4.0, 1.0);
next.control_l.orientation = Quaternion::rotation_x(1.57);
next.control_r.orientation = Quaternion::rotation_x(1.57);
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.weapon_l.position =
Vec3::new(-12.0 + (move1pow * 20.0).min(10.0), -1.0, -15.0);
next.weapon_r.position =
Vec3::new(12.0 + (move1pow * -20.0).max(-10.0), -1.0, -15.0);
next.weapon_l.orientation = Quaternion::rotation_x(-1.57 - 0.1)
next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1)
* Quaternion::rotation_z(move1pow * -1.0);
next.weapon_r.orientation = Quaternion::rotation_x(-1.57 - 0.1)
next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1)
* Quaternion::rotation_z(move1pow * 1.0);
next.shoulder_l.orientation =

View File

@ -6,7 +6,7 @@ use common::{
comp::item::tool::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct ShootAnimation;
@ -234,13 +234,13 @@ impl Animation for ShootAnimation {
next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3);
next.control_l.position = Vec3::new(-0.5, 4.0, 1.0);
next.control_r.position = Vec3::new(-0.5, 4.0, 1.0);
next.control_l.orientation = Quaternion::rotation_x(1.57);
next.control_r.orientation = Quaternion::rotation_x(1.57);
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0);
next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0);
next.weapon_l.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
let twist = move1 * 0.8 + move3 * -0.8;
next.upper_torso.position =

View File

@ -3,7 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct SpinAnimation;
@ -67,7 +67,7 @@ impl Animation for SpinAnimation {
);
next.control.orientation = Quaternion::rotation_x(-0.5 + s_a.sc.3 + movement1 * -1.2)
* Quaternion::rotation_y(s_a.sc.4 - 0.6 + movement1 * 1.0)
* Quaternion::rotation_z(s_a.sc.5 + 0.1 + movement1 * 1.57);
* Quaternion::rotation_z(s_a.sc.5 + 0.1 + movement1 * PI / 2.0);
next.head.position = Vec3::new(
0.0 + 2.0 + movement2 * -2.0,
2.0 + movement2 * -2.0 + s_a.head.0,

View File

@ -3,7 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct SpinMeleeAnimation;
@ -22,7 +22,6 @@ impl Animation for SpinMeleeAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_spinmelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_spinmelee")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section, acc_vel): Self::Dependency<'a>,

View File

@ -6,7 +6,7 @@ use common::{
comp::item::tool::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct StunnedAnimation;
@ -403,11 +403,11 @@ impl Animation for StunnedAnimation {
next.weapon_l.position = Vec3::new(-12.0, -6.0, -18.0);
next.weapon_r.position = Vec3::new(12.0, -6.0, -18.0);
next.weapon_l.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.control_l.orientation = Quaternion::rotation_x(1.57);
next.control_r.orientation = Quaternion::rotation_x(1.57);
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.control.orientation =
Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);

View File

@ -6,7 +6,7 @@ use common::{
comp::item::{AbilitySpec, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct SummonAnimation;
@ -26,7 +26,6 @@ impl Animation for SummonAnimation {
const UPDATE_FN: &'static [u8] = b"biped_large_summon\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_summon")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(

View File

@ -3,7 +3,7 @@ use super::{
BipedLargeSkeleton, SkeletonAttr,
};
use common::comp::item::tool::{AbilitySpec, ToolKind};
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct WieldAnimation;
@ -438,11 +438,11 @@ impl Animation for WieldAnimation {
next.weapon_l.position = Vec3::new(-12.0, -6.0, -18.0);
next.weapon_r.position = Vec3::new(12.0, -6.0, -18.0);
next.weapon_l.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.control_l.orientation = Quaternion::rotation_x(1.57);
next.control_r.orientation = Quaternion::rotation_x(1.57);
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.control.orientation =
Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
@ -458,11 +458,11 @@ impl Animation for WieldAnimation {
next.weapon_l.position = Vec3::new(-12.0, -1.0, -15.0);
next.weapon_r.position = Vec3::new(12.0, -1.0, -15.0);
next.weapon_l.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-1.57 - 0.1);
next.weapon_l.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.weapon_r.orientation = Quaternion::rotation_x(-PI / 2.0 - 0.1);
next.control_l.orientation = Quaternion::rotation_x(1.57);
next.control_r.orientation = Quaternion::rotation_x(1.57);
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.control.orientation =
Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);

View File

@ -2,6 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedSmallSkeleton, SkeletonAttr,
};
use core::f32::consts::PI;
pub struct IdleAnimation;
@ -36,7 +37,7 @@ impl Animation for IdleAnimation {
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.3) * s_a.scaler / 11.0;
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);
next.main.position = Vec3::new(2.0, -3.0, -3.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + slow * -0.1);

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedSmallSkeleton, SkeletonAttr,
};
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct RunAnimation;
@ -96,7 +96,7 @@ impl Animation for RunAnimation {
* Quaternion::rotation_y(tilt * 1.6)
* Quaternion::rotation_x(shortalter * 0.035 + speednorm * -0.4 + (tilt.abs()));
next.main.position = Vec3::new(2.0, -3.0, -3.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);
next.pants.orientation = Quaternion::rotation_x(0.1 * speednorm)

View File

@ -3,7 +3,7 @@ use super::{
BipedSmallSkeleton, SkeletonAttr,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct StunnedAnimation;
@ -171,7 +171,7 @@ impl Animation for StunnedAnimation {
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);
next.main.position = Vec3::new(2.0, -3.0, -3.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
BirdLargeSkeleton, SkeletonAttr,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct RunAnimation;
@ -47,10 +47,10 @@ impl Animation for RunAnimation {
//FL
let foot1a = (mixed_vel * 1.0 * lab * speedmult + 0.0 + PI).sin() * speednorm; //1.5
let foot1b = (mixed_vel * 1.0 * lab * speedmult + 1.57 + PI).sin() * speednorm; //1.9
let foot1b = (mixed_vel * 1.0 * lab * speedmult + PI / 2.0 + PI).sin() * speednorm; //1.9
//FR
let foot2a = (mixed_vel * 1.0 * lab * speedmult).sin() * speednorm; //1.2
let foot2b = (mixed_vel * 1.0 * lab * speedmult + 1.57).sin() * speednorm; //1.6
let foot2b = (mixed_vel * 1.0 * lab * speedmult + PI / 2.0).sin() * speednorm; //1.6
let ori: Vec2<f32> = Vec2::from(orientation);
let last_ori = Vec2::from(last_ori);
let tilt = if ::vek::Vec2::new(ori, last_ori)

View File

@ -16,7 +16,6 @@ impl Animation for SummonAnimation {
const UPDATE_FN: &'static [u8] = b"bird_large_summon\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_summon")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(global_time, stage_section, timer, look_dir, on_ground): Self::Dependency<'a>,

View File

@ -6,7 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct AlphaAnimation;
@ -23,7 +23,6 @@ impl Animation for AlphaAnimation {
const UPDATE_FN: &'static [u8] = b"character_alpha\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_alpha")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(hands, stage_section, ability_info): Self::Dependency<'a>,
@ -124,7 +123,7 @@ impl Animation for AlphaAnimation {
);
next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + move1 * -1.3)
* Quaternion::rotation_y(s_a.sc.4 + move1 * -0.7 + move2 * 1.2)
* Quaternion::rotation_z(s_a.sc.5 + move1 * -1.57 + move3 * -1.57);
* Quaternion::rotation_z(s_a.sc.5 + move1 * -PI / 2.0 + move3 * -PI / 2.0);
},
Some(ToolKind::Axe) => {
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
@ -181,7 +180,9 @@ impl Animation for AlphaAnimation {
);
next.control.orientation =
Quaternion::rotation_x(s_a.hc.3 + (moveret1 * 1.5 + moveret2 * -2.55))
* Quaternion::rotation_y(s_a.hc.4 + moveret1 * 1.57 + moveret2 * 0.5)
* Quaternion::rotation_y(
s_a.hc.4 + moveret1 * PI / 2.0 + moveret2 * 0.5,
)
* Quaternion::rotation_z(s_a.hc.5 + (moveret2 * -0.5));
},
_ => {},
@ -197,7 +198,7 @@ impl Animation for AlphaAnimation {
* Quaternion::rotation_y(move1 * -1.2 + move2 * -1.5)
* Quaternion::rotation_z(move2 * 1.5);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Axe) => {
next.control_l.position = Vec3::new(
@ -209,7 +210,7 @@ impl Animation for AlphaAnimation {
* Quaternion::rotation_y(move1 * -1.2 + move2 * -2.5)
* Quaternion::rotation_z(move2 * 1.5);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
next.control_l.position = Vec3::new(
@ -222,7 +223,7 @@ impl Animation for AlphaAnimation {
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
@ -238,7 +239,7 @@ impl Animation for AlphaAnimation {
* Quaternion::rotation_y(move1 * -1.8 + move2 * -1.5)
* Quaternion::rotation_z(move2 * 1.5);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Axe) => {
next.control_r.position = Vec3::new(
@ -250,7 +251,7 @@ impl Animation for AlphaAnimation {
* Quaternion::rotation_y(move1 * -1.8 + move2 * -1.5)
* Quaternion::rotation_z(move2 * 1.5);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
next.control_r.position = Vec3::new(
@ -263,7 +264,7 @@ impl Animation for AlphaAnimation {
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
}

View File

@ -6,6 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use core::f32::consts::PI;
pub struct BetaAnimation;
@ -73,7 +74,7 @@ impl Animation for BetaAnimation {
* Quaternion::rotation_y(
s_a.sc.4 + (0.4 + move1 * 1.5 + move2 * -2.5) * pullback,
)
* Quaternion::rotation_z(s_a.sc.5 + (1.67 + move2 * 1.57) * pullback);
* Quaternion::rotation_z(s_a.sc.5 + (1.67 + move2 * PI / 2.0) * pullback);
},
_ => {},
},
@ -89,7 +90,7 @@ impl Animation for BetaAnimation {
* Quaternion::rotation_y(-3.7 + move1 * -0.75 + move2 * 1.0)
* Quaternion::rotation_z(3.69);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
@ -106,7 +107,7 @@ impl Animation for BetaAnimation {
* Quaternion::rotation_y(-2.3 + move1 * -2.3 + move2 * 1.0)
* Quaternion::rotation_z(3.69);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},

View File

@ -6,7 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct BlockAnimation;
@ -159,7 +159,7 @@ impl Animation for BlockAnimation {
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
next.hold.position = Vec3::new(0.0, -1.0, -5.2);
next.hold.orientation = Quaternion::rotation_x(-1.57);
next.hold.orientation = Quaternion::rotation_x(-PI / 2.0);
next.hold.scale = Vec3::one() * 1.0;
next.control.position = Vec3::new(s_a.bc.0, s_a.bc.1, s_a.bc.2);
@ -175,9 +175,9 @@ impl Animation for BlockAnimation {
},
Some(ToolKind::Farming) => {
next.hand_l.position = Vec3::new(9.0, 1.0, 1.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57);
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.position = Vec3::new(9.0, 1.0, 11.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.main.position = Vec3::new(7.5, 7.5, 13.2);
next.main.orientation = Quaternion::rotation_y(PI);
@ -196,7 +196,7 @@ impl Animation for BlockAnimation {
next.control_l.orientation =
Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
(_, _) => {},
};
@ -206,7 +206,7 @@ impl Animation for BlockAnimation {
next.control_r.orientation =
Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
(_, _) => {},
};

View File

@ -6,6 +6,8 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use core::f32::consts::PI;
pub struct ChargeswingAnimation;
type ChargeswingAnimationDependency = (
@ -24,7 +26,6 @@ impl Animation for ChargeswingAnimation {
const UPDATE_FN: &'static [u8] = b"character_chargeswing\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_chargeswing")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency<'a>,
@ -126,7 +127,7 @@ impl Animation for ChargeswingAnimation {
* Quaternion::rotation_y(tension * 0.07 + move1 * -1.2 + slowrise * 0.5)
* Quaternion::rotation_z(move2 * 1.0);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
@ -150,7 +151,7 @@ impl Animation for ChargeswingAnimation {
)
* Quaternion::rotation_z(move2 * 1.0);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
}

View File

@ -6,7 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct DashAnimation;
@ -125,7 +125,7 @@ impl Animation for DashAnimation {
* Quaternion::rotation_y(move1 * -1.2 + move3 * -1.5)
* Quaternion::rotation_z(move2 * 1.0 + move3 * 1.5);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
@ -148,7 +148,7 @@ impl Animation for DashAnimation {
)
* Quaternion::rotation_z(move3 * 1.5);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
}

View File

@ -3,7 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::ToolKind;
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct EquipAnimation;
@ -15,7 +15,6 @@ impl Animation for EquipAnimation {
const UPDATE_FN: &'static [u8] = b"character_equip\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_equip")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, _velocity, _global_time): Self::Dependency<'a>,
@ -27,8 +26,8 @@ impl Animation for EquipAnimation {
let mut next = (*skeleton).clone();
let equip_slow = 1.0 + (anim_time * 12.0 + PI).cos();
let equip_slowa = 1.0 + (anim_time * 12.0 + PI / 4.0).cos();
next.hand_l.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(1.57);
next.hand_r.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(1.57);
next.hand_l.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(PI / 2.0);
next.hand_r.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(PI / 2.0);
next.control.position = Vec3::new(equip_slowa * -1.5, 0.0, equip_slow * 1.5);
match active_tool_kind {

View File

@ -3,6 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use core::f32::consts::PI;
use std::ops::Mul;
pub struct IdleAnimation;
@ -92,17 +93,17 @@ impl Animation for IdleAnimation {
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, -5.0, 6.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.main.position = Vec3::new(2.0, -5.0, -1.0);
next.main.orientation =
Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
},
(_, _) => {},
@ -113,7 +114,7 @@ impl Animation for IdleAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.main.position = Vec3::new(-4.0, -5.0, 10.0);
next.main.orientation =
Quaternion::rotation_y(2.35) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.35) * Quaternion::rotation_z(PI / 2.0);
},
_ => {},
@ -125,7 +126,7 @@ impl Animation for IdleAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.second.position = Vec3::new(4.0, -6.0, 10.0);
next.second.orientation =
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-1.57);
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-PI / 2.0);
},
_ => {},
},

View File

@ -3,7 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct JumpAnimation;
impl Animation for JumpAnimation {
@ -155,15 +155,18 @@ impl Animation for JumpAnimation {
},
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.main.position = Vec3::new(2.0, -5.0, -1.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, -5.0, 6.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
}
@ -182,7 +185,7 @@ impl Animation for JumpAnimation {
_ => {
next.second.position = Vec3::new(-7.0, -5.0, 15.0);
next.second.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
}
@ -211,7 +214,7 @@ impl Animation for JumpAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.main.position = Vec3::new(-4.0, -5.0, 10.0);
next.main.orientation =
Quaternion::rotation_y(2.35) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.35) * Quaternion::rotation_z(PI / 2.0);
},
_ => {},
@ -223,7 +226,7 @@ impl Animation for JumpAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.second.position = Vec3::new(4.0, -6.0, 10.0);
next.second.orientation =
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-1.57);
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-PI / 2.0);
},
_ => {},
},

View File

@ -6,6 +6,8 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use core::f32::consts::PI;
pub struct LeapAnimation;
type LeapAnimationDependency = (
@ -23,7 +25,6 @@ impl Animation for LeapAnimation {
const UPDATE_FN: &'static [u8] = b"character_leapmelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_leapmelee")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency<'a>,
@ -133,7 +134,7 @@ impl Animation for LeapAnimation {
s_a.hc.2 + move2 * 5.0 + move3 * -10.0,
);
next.control.orientation =
Quaternion::rotation_x(s_a.hc.3 + move2 * 1.57 + move3 * -2.3)
Quaternion::rotation_x(s_a.hc.3 + move2 * PI / 2.0 + move3 * -2.3)
* Quaternion::rotation_y(s_a.hc.4 + move2 * 1.3)
* Quaternion::rotation_z(s_a.hc.5 + move2 * -1.0 + move3 * 0.5);
},
@ -170,7 +171,7 @@ impl Animation for LeapAnimation {
Quaternion::rotation_x(-0.3 + move2 * 1.0 + move3 * -2.0)
* Quaternion::rotation_y(move2 * -0.5 + move3 * 1.9);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
next.control_l.position = Vec3::new(
@ -181,7 +182,7 @@ impl Animation for LeapAnimation {
next.control_l.orientation =
Quaternion::rotation_x(-0.3 + move2 * 1.5 + move3 * -2.5);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
@ -200,7 +201,7 @@ impl Animation for LeapAnimation {
next.control_r.orientation = Quaternion::rotation_x(-0.3 + move3 * -2.2)
* Quaternion::rotation_y(move2 * -0.5 + move3 * 1.2);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
next.control_r.position = Vec3::new(
@ -212,7 +213,7 @@ impl Animation for LeapAnimation {
Quaternion::rotation_x(-0.3 + move2 * 1.5 + move3 * -2.5)
* Quaternion::rotation_y(move2 * -0.75 + move3 * 0.75);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
}

View File

@ -44,8 +44,7 @@ pub use self::{
};
use super::{make_bone, vek::*, FigureBoneData, Skeleton};
use common::comp;
use core::convert::TryFrom;
use std::f32::consts::PI;
use core::{convert::TryFrom, f32::consts::PI};
pub type Body = comp::humanoid::Body;
@ -298,7 +297,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
_ => (0.0, 0.0, 0.0, 4.71, 0.0, PI),
},
hc: match (body.species, body.body_type) {
_ => (6.0, 7.0, 1.0, -0.3, -1.57, 3.64),
_ => (6.0, 7.0, 1.0, -0.3, -PI / 2.0, 3.64),
},
sthl: match (body.species, body.body_type) {
_ => (0.0, 0.0, 6.0, 1.97, 0.0, 0.0),
@ -319,10 +318,10 @@ impl<'a> From<&'a Body> for SkeletonAttr {
_ => (-8.0, 11.0, 3.0, 2.0, 0.0, 0.0),
},
bhl: match (body.species, body.body_type) {
_ => (0.0, -4.0, 1.0, 1.57, 0.0, 0.0),
_ => (0.0, -4.0, 1.0, PI / 2.0, 0.0, 0.0),
},
bhr: match (body.species, body.body_type) {
_ => (1.0, 2.0, -2.0, 1.57, 0.0, 0.0),
_ => (1.0, 2.0, -2.0, PI / 2.0, 0.0, 0.0),
},
bc: match (body.species, body.body_type) {
_ => (-5.0, 9.0, 1.0, 0.0, 1.2, -0.6),

View File

@ -6,6 +6,8 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use core::f32::consts::PI;
pub struct RepeaterAnimation;
impl Animation for RepeaterAnimation {
@ -23,7 +25,6 @@ impl Animation for RepeaterAnimation {
const UPDATE_FN: &'static [u8] = b"character_repeater\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_repeater")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(ability_info, hands, velocity, _global_time, stage_section): Self::Dependency<'a>,
@ -57,7 +58,7 @@ impl Animation for RepeaterAnimation {
next.main.orientation = Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0);
next.hold.position = Vec3::new(0.0, -1.0 + move3 * 2.0, -5.2);
next.hold.orientation = Quaternion::rotation_x(-1.57) * Quaternion::rotation_z(0.0);
next.hold.orientation = Quaternion::rotation_x(-PI / 2.0) * Quaternion::rotation_z(0.0);
next.hold.scale = Vec3::one() * (1.0);
if speed < 0.5 {
next.foot_l.position = Vec3::new(

View File

@ -3,7 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct RunAnimation;
@ -219,16 +219,18 @@ impl Animation for RunAnimation {
},
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.main.position = Vec3::new(2.0, -5.0, -1.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, -5.0, 6.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + shorte * -0.2);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0 + shorte * -0.2);
},
}
@ -246,7 +248,7 @@ impl Animation for RunAnimation {
_ => {
next.second.position = Vec3::new(-7.0, -5.0, 15.0);
next.second.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
}
@ -281,7 +283,7 @@ impl Animation for RunAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.main.position = Vec3::new(-4.0, -5.0, 10.0);
next.main.orientation =
Quaternion::rotation_y(2.35) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.35) * Quaternion::rotation_z(PI / 2.0);
},
_ => {},
@ -293,7 +295,7 @@ impl Animation for RunAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.second.position = Vec3::new(4.0, -6.0, 10.0);
next.second.orientation =
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-1.57);
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-PI / 2.0);
},
_ => {},
},

View File

@ -7,7 +7,7 @@ use common::{
states::utils::{AbilityInfo, StageSection},
util::Dir,
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct ShootAnimation;
@ -29,7 +29,6 @@ impl Animation for ShootAnimation {
const UPDATE_FN: &'static [u8] = b"character_shoot\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_shoot")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(
@ -141,7 +140,7 @@ impl Animation for ShootAnimation {
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
next.hold.position = Vec3::new(0.0, -1.0 + move2 * 2.0, -5.2 + move2 * 7.0);
next.hold.orientation = Quaternion::rotation_x(-1.57);
next.hold.orientation = Quaternion::rotation_x(-PI / 2.0);
next.hold.scale = Vec3::one() * 1.0 * (1.0 - move2);
next.control.position = Vec3::new(

View File

@ -6,7 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct SpinAnimation;
@ -144,7 +144,7 @@ impl Animation for SpinAnimation {
next.control.orientation =
Quaternion::rotation_x(-0.5 + s_a.sc.3 + movement1base * -1.2)
* Quaternion::rotation_y(s_a.sc.4 - 0.6 + movement2base * -0.2)
* Quaternion::rotation_z(s_a.sc.5 - 1.57 + movement1base * PI);
* Quaternion::rotation_z(s_a.sc.5 - PI / 2.0 + movement1base * PI);
},
Some(ToolKind::Axe) => {
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
@ -183,7 +183,7 @@ impl Animation for SpinAnimation {
* Quaternion::rotation_y(-2.7 + movement1base * -1.0 + movement2base * 2.0)
* Quaternion::rotation_z(1.5 + movement1base * PI);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Axe) => {
next.control_l.position = Vec3::new(
@ -193,9 +193,9 @@ impl Animation for SpinAnimation {
);
next.control_l.orientation = Quaternion::rotation_x(1.7 + movement2base * 1.5)
* Quaternion::rotation_y(-3.7)
* Quaternion::rotation_z(1.5 + movement2base * 1.57);
* Quaternion::rotation_z(1.5 + movement2base * PI / 2.0);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
@ -212,7 +212,7 @@ impl Animation for SpinAnimation {
* Quaternion::rotation_y(-3.3 + move1 * -1.0 + move2 * 2.0)
* Quaternion::rotation_z(1.5 + move1 * PI);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Axe) => {
next.control_r.position = Vec3::new(
@ -222,9 +222,9 @@ impl Animation for SpinAnimation {
);
next.control_r.orientation = Quaternion::rotation_x(1.7 + move2 * 1.5)
* Quaternion::rotation_y(-3.3)
* Quaternion::rotation_z(1.5 + move2 * 1.57);
* Quaternion::rotation_z(1.5 + move2 * PI / 2.0);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},

View File

@ -6,7 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::{AbilityInfo, StageSection},
};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct SpinMeleeAnimation;
@ -25,7 +25,6 @@ impl Animation for SpinMeleeAnimation {
const UPDATE_FN: &'static [u8] = b"character_spinmelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_spinmelee")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency<'a>,
@ -150,16 +149,16 @@ impl Animation for SpinMeleeAnimation {
Some(ToolKind::Sword) => {
next.control_l.position = Vec3::new(-7.0, 8.0, 2.0);
next.control_l.orientation = Quaternion::rotation_x(-0.3 + move1 * -0.5)
* Quaternion::rotation_z(move1 * 1.57);
* Quaternion::rotation_z(move1 * PI / 2.0);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Axe) => {
next.control_l.position = Vec3::new(-7.0, 8.0, 2.0);
next.control_l.orientation = Quaternion::rotation_x(-0.3 + move1 * -1.3)
* Quaternion::rotation_z(move1 * -1.57);
* Quaternion::rotation_z(move1 * -PI / 2.0);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
@ -173,16 +172,16 @@ impl Animation for SpinMeleeAnimation {
next.control_r.position = Vec3::new(7.0, 8.0, 2.0 + move1 * 10.0);
next.control_r.orientation = Quaternion::rotation_x(-0.3 + move1 * -1.2)
* Quaternion::rotation_y(move1 * 0.8)
* Quaternion::rotation_z(move1 * 1.57);
* Quaternion::rotation_z(move1 * PI / 2.0);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
Some(ToolKind::Axe) => {
next.control_r.position = Vec3::new(7.0, 8.0, 2.0);
next.control_r.orientation = Quaternion::rotation_x(-0.3 + move1 * -1.6)
* Quaternion::rotation_z(move1 * -1.57);
* Quaternion::rotation_z(move1 * -PI / 2.0);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
_ => {},
}

View File

@ -6,6 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use core::f32::consts::PI;
pub struct StaggeredAnimation;
@ -27,7 +28,6 @@ impl Animation for StaggeredAnimation {
const UPDATE_FN: &'static [u8] = b"character_staggered\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_staggered")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(
@ -139,7 +139,7 @@ impl Animation for StaggeredAnimation {
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
next.hold.position = Vec3::new(0.0, -1.0, -5.2);
next.hold.orientation = Quaternion::rotation_x(-1.57);
next.hold.orientation = Quaternion::rotation_x(-PI / 2.0);
next.hold.scale = Vec3::one() * 1.0;
next.control.position = Vec3::new(s_a.bc.0, s_a.bc.1, s_a.bc.2);
@ -150,15 +150,15 @@ impl Animation for StaggeredAnimation {
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);
next.hand_l.orientation = Quaternion::rotation_x(1.27);
next.main.position = Vec3::new(-5.0, 5.0, 23.0);
next.main.orientation = Quaternion::rotation_x(3.14);
next.main.orientation = Quaternion::rotation_x(PI);
},
Some(ToolKind::Farming) => {
next.hand_l.position = Vec3::new(9.0, 1.0, 1.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57);
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.position = Vec3::new(9.0, 1.0, 11.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.main.position = Vec3::new(7.5, 7.5, 13.2);
next.main.orientation = Quaternion::rotation_y(3.14);
next.main.orientation = Quaternion::rotation_y(PI);
next.control.position = Vec3::new(-11.0, 1.8, 4.0);
},
@ -172,7 +172,7 @@ impl Animation for StaggeredAnimation {
next.control_l.position = Vec3::new(-7.0, 8.0, 2.0);
next.control_l.orientation = Quaternion::rotation_x(-0.3);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
(_, _) => {},
};
@ -181,7 +181,7 @@ impl Animation for StaggeredAnimation {
next.control_r.position = Vec3::new(7.0, 8.0, 2.0);
next.control_r.orientation = Quaternion::rotation_x(-0.3);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
(_, _) => {},
};

View File

@ -3,6 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use core::f32::consts::PI;
use std::ops::Mul;
pub struct StandAnimation;
@ -114,17 +115,17 @@ impl Animation for StandAnimation {
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, -5.0, 6.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.main.position = Vec3::new(2.0, -5.0, -1.0);
next.main.orientation =
Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
},
((_, _), _, _) => {},
@ -135,7 +136,7 @@ impl Animation for StandAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.main.position = Vec3::new(-4.0, -5.0, 10.0);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {},
@ -147,7 +148,7 @@ impl Animation for StandAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.second.position = Vec3::new(4.0, -6.0, 10.0);
next.second.orientation =
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-1.57);
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-PI / 2.0);
},
_ => {},
},

View File

@ -6,6 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use core::f32::consts::PI;
pub struct StunnedAnimation;
@ -27,7 +28,6 @@ impl Animation for StunnedAnimation {
const UPDATE_FN: &'static [u8] = b"character_stunned\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_stunned")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(
@ -135,7 +135,7 @@ impl Animation for StunnedAnimation {
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
next.hold.position = Vec3::new(0.0, -1.0, -5.2);
next.hold.orientation = Quaternion::rotation_x(-1.57);
next.hold.orientation = Quaternion::rotation_x(-PI / 2.0);
next.hold.scale = Vec3::one() * 1.0;
next.control.position = Vec3::new(s_a.bc.0, s_a.bc.1, s_a.bc.2);
@ -146,15 +146,15 @@ impl Animation for StunnedAnimation {
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);
next.hand_l.orientation = Quaternion::rotation_x(1.27);
next.main.position = Vec3::new(-5.0, 5.0, 23.0);
next.main.orientation = Quaternion::rotation_x(3.14);
next.main.orientation = Quaternion::rotation_x(PI);
},
Some(ToolKind::Farming) => {
next.hand_l.position = Vec3::new(9.0, 1.0, 1.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57);
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.position = Vec3::new(9.0, 1.0, 11.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.main.position = Vec3::new(7.5, 7.5, 13.2);
next.main.orientation = Quaternion::rotation_y(3.14);
next.main.orientation = Quaternion::rotation_y(PI);
next.control.position = Vec3::new(-11.0, 1.8, 4.0);
},
@ -167,7 +167,7 @@ impl Animation for StunnedAnimation {
next.control_l.position = Vec3::new(-7.0, 8.0, 2.0);
next.control_l.orientation = Quaternion::rotation_x(-0.3);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
(_, _) => {},
};
@ -176,7 +176,7 @@ impl Animation for StunnedAnimation {
next.control_r.position = Vec3::new(7.0, 8.0, 2.0);
next.control_r.orientation = Quaternion::rotation_x(-0.3);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
(_, _) => {},
};

View File

@ -3,7 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct SwimAnimation;
@ -190,15 +190,18 @@ impl Animation for SwimAnimation {
},
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.main.position = Vec3::new(2.0, -5.0, -1.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
},
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, -5.0, 6.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
_ => {
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
}
@ -216,7 +219,7 @@ impl Animation for SwimAnimation {
_ => {
next.second.position = Vec3::new(-7.0, -5.0, 15.0);
next.second.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(PI / 2.0);
},
}
@ -231,7 +234,7 @@ impl Animation for SwimAnimation {
};
next.torso.position = Vec3::new(0.0, 0.0, 1.0 - avgspeed * 0.05) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_x(
(((1.0 / switch) * PI / 2.0 + avg_vel.z * 0.12).min(1.57) - PI / 2.0)
(((1.0 / switch) * PI / 2.0 + avg_vel.z * 0.12).min(PI / 2.0) - PI / 2.0)
+ avgspeed * avg_vel.z * -0.003,
) * Quaternion::rotation_y(tilt * 2.0)
* Quaternion::rotation_z(tilt * 3.0);
@ -241,7 +244,7 @@ impl Animation for SwimAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.main.position = Vec3::new(-4.0, -5.0, 10.0);
next.main.orientation =
Quaternion::rotation_y(2.35) * Quaternion::rotation_z(1.57);
Quaternion::rotation_y(2.35) * Quaternion::rotation_z(PI / 2.0);
},
_ => {},
@ -253,7 +256,7 @@ impl Animation for SwimAnimation {
Some(ToolKind::Axe) | Some(ToolKind::Hammer) | Some(ToolKind::Sword) => {
next.second.position = Vec3::new(4.0, -6.0, 10.0);
next.second.orientation =
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-1.57);
Quaternion::rotation_y(-2.5) * Quaternion::rotation_z(-PI / 2.0);
},
_ => {},
},

View File

@ -3,7 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct SwimWieldAnimation;
@ -22,7 +22,6 @@ impl Animation for SwimWieldAnimation {
const UPDATE_FN: &'static [u8] = b"character_swimwield\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_swimwield")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, hands, velocity, global_time): Self::Dependency<'a>,
@ -224,8 +223,8 @@ impl Animation for SwimWieldAnimation {
next.hand_r.scale = Vec3::one() * 1.04;
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(-1.57)
* Quaternion::rotation_z(1.57);
* Quaternion::rotation_y(-PI / 2.0)
* Quaternion::rotation_z(PI / 2.0);
next.control.position = Vec3::new(6.0, 7.0, 1.0);
next.control.orientation = Quaternion::rotation_x(0.3 + u_slow * 0.15)
@ -244,7 +243,7 @@ impl Animation for SwimWieldAnimation {
next.hand_r.scale = Vec3::one() * 1.04;
next.main.position = Vec3::new(12.0, 8.4, 13.2);
next.main.orientation = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(3.14 + 0.3)
* Quaternion::rotation_y(PI + 0.3)
* Quaternion::rotation_z(0.9);
next.control.position = Vec3::new(-14.0, 1.8, 3.0);

View File

@ -3,7 +3,7 @@ use super::{
CharacterSkeleton, SkeletonAttr,
};
use common::{comp::item::ToolKind, util::Dir};
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct TalkAnimation;
@ -15,7 +15,6 @@ impl Animation for TalkAnimation {
const UPDATE_FN: &'static [u8] = b"character_talk\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_talk")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(_active_tool_kind, _second_tool_kind, _velocity, _global_time, look_dir): Self::Dependency<

View File

@ -6,7 +6,7 @@ use common::{
comp::item::{Hands, ToolKind},
util::Dir,
};
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct WieldAnimation;
@ -28,7 +28,6 @@ impl Animation for WieldAnimation {
const UPDATE_FN: &'static [u8] = b"character_wield\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_wield")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(
@ -253,7 +252,7 @@ impl Animation for WieldAnimation {
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
next.hold.position = Vec3::new(0.0, -1.0, -5.2);
next.hold.orientation = Quaternion::rotation_x(-1.57);
next.hold.orientation = Quaternion::rotation_x(-PI / 2.0);
next.hold.scale = Vec3::one() * 1.0;
next.control.position =
@ -274,11 +273,11 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_x(-0.2 + head_look.y.abs() + look_dir.z * 0.7);
}
next.hand_l.position = Vec3::new(9.0, 1.0, 1.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57);
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
next.hand_r.position = Vec3::new(9.0, 1.0, 11.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57);
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.main.position = Vec3::new(7.5, 7.5, 13.2);
next.main.orientation = Quaternion::rotation_y(3.14);
next.main.orientation = Quaternion::rotation_y(PI);
next.control.position = Vec3::new(-11.0 + slow * 2.0, 1.8, 4.0);
next.control.orientation = Quaternion::rotation_x(u_slow * 0.1)
@ -294,7 +293,7 @@ impl Animation for WieldAnimation {
next.control_l.position = Vec3::new(-7.0, 8.0, 2.0);
next.control_l.orientation = Quaternion::rotation_x(-0.3);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
},
(_, _) => {},
};
@ -303,7 +302,7 @@ impl Animation for WieldAnimation {
next.control_r.position = Vec3::new(7.0, 8.0, 2.0);
next.control_r.orientation = Quaternion::rotation_x(-0.3);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
},
(_, _) => {},
};

View File

@ -3,6 +3,8 @@ use super::{
GolemSkeleton, SkeletonAttr,
};
use common::{states::utils::StageSection, util::Dir};
use core::f32::consts::PI;
pub struct ShootAnimation;
impl Animation for ShootAnimation {
@ -46,7 +48,7 @@ impl Animation for ShootAnimation {
next.shoulder_l.orientation =
Quaternion::rotation_y(0.0) * Quaternion::rotation_z(move1 * 0.7);
next.shoulder_r.orientation = Quaternion::rotation_x(move1 * (look_dir.z * 1.2 + 1.57))
next.shoulder_r.orientation = Quaternion::rotation_x(move1 * (look_dir.z * 1.2 + PI / 2.0))
* Quaternion::rotation_y(move1 * 0.0);
next.hand_l.orientation =

View File

@ -3,7 +3,7 @@ use super::{
GolemSkeleton, SkeletonAttr,
};
use common::states::utils::StageSection;
use std::f32::consts::PI;
use core::f32::consts::PI;
pub struct SpinMeleeAnimation;
@ -15,7 +15,6 @@ impl Animation for SpinMeleeAnimation {
const UPDATE_FN: &'static [u8] = b"golem_spinmelee\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "golem_spinmelee")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
stage_section: Self::Dependency<'a>,

View File

@ -22,7 +22,6 @@ impl Animation for BeamAnimation {
const UPDATE_FN: &'static [u8] = b"object_beam\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "object_beam")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(_active_tool_kind, _second_tool_kind, _stage_section, _body): Self::Dependency<'a>,

View File

@ -14,7 +14,6 @@ impl Animation for IdleAnimation {
const UPDATE_FN: &'static [u8] = b"object_idle\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "object_idle")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(_active_tool_kind, _second_tool_kind, _global_time): Self::Dependency<'a>,

View File

@ -22,7 +22,6 @@ impl Animation for ShootAnimation {
const UPDATE_FN: &'static [u8] = b"object_shoot\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "object_shoot")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(_active_tool_kind, _second_tool_kind, stage_section, body): Self::Dependency<'a>,

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
QuadrupedMediumSkeleton, SkeletonAttr,
};
use std::{f32::consts::PI, ops::Mul};
use core::{f32::consts::PI, ops::Mul};
pub struct RunAnimation;
@ -68,10 +68,11 @@ impl Animation for RunAnimation {
let foot2b = (mixed_vel * (1.0) * lab * speedmult + 1.1 + shift2).sin(); //1.0
//BL
let foot3a = (mixed_vel * (1.0) * lab * speedmult + shift3).sin(); //0.0
let foot3b = (mixed_vel * (1.0) * lab * speedmult + 1.57 + shift3).sin(); //0.4
let foot3b = (mixed_vel * (1.0) * lab * speedmult + PI / 2.0 + shift3).sin(); //0.4
//BR
let foot4a = (mixed_vel * (1.0) * lab * speedmult + 0.0 + canceler * 0.05 + shift4).sin(); //0.3
let foot4b = (mixed_vel * (1.0) * lab * speedmult + 1.57 + canceler * 0.05 + shift4).sin(); //0.7
let foot4b =
(mixed_vel * (1.0) * lab * speedmult + PI / 2.0 + canceler * 0.05 + shift4).sin(); //0.7
//
let ori: Vec2<f32> = Vec2::from(orientation);
let last_ori = Vec2::from(last_ori);

View File

@ -21,7 +21,6 @@ impl Animation for IdleAnimation {
const UPDATE_FN: &'static [u8] = b"ship_idle\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "ship_idle")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(_active_tool_kind, _second_tool_kind, _global_time, acc_vel, orientation, last_ori): Self::Dependency<'a>,

View File

@ -1,7 +1,8 @@
use super::{super::Animation, SkeletonAttr, TheropodSkeleton};
//use std::{f32::consts::PI, ops::Mul};
use super::super::vek::*;
use std::f32::consts::PI;
use super::{
super::{vek::*, Animation},
SkeletonAttr, TheropodSkeleton,
};
use core::f32::consts::PI;
pub struct RunAnimation;
@ -43,10 +44,10 @@ impl Animation for RunAnimation {
//FL
let foot1a = (mixed_vel * 1.0 * lab * speedmult + 0.0 + PI).sin() * speednorm; //1.5
let foot1b = (mixed_vel * 1.0 * lab * speedmult + 1.57 + PI).sin() * speednorm; //1.9
let foot1b = (mixed_vel * 1.0 * lab * speedmult + PI / 2.0 + PI).sin() * speednorm; //1.9
//FR
let foot2a = (mixed_vel * 1.0 * lab * speedmult).sin() * speednorm; //1.2
let foot2b = (mixed_vel * 1.0 * lab * speedmult + 1.57).sin() * speednorm; //1.6
let foot2b = (mixed_vel * 1.0 * lab * speedmult + PI / 2.0).sin() * speednorm; //1.6
let ori: Vec2<f32> = Vec2::from(orientation);
let last_ori = Vec2::from(last_ori);
let tilt = if ::vek::Vec2::new(ori, last_ori)