mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'slipped-animation-warnings' into 'master'
Slipped animation warnings See merge request veloren/veloren!306
This commit is contained in:
commit
5dfdcbf1ea
@ -1,14 +1,7 @@
|
||||
use client::{Client, Event};
|
||||
use common::{clock::Clock, comp};
|
||||
use log::{error, info};
|
||||
use std::{
|
||||
io,
|
||||
net::{SocketAddr, ToSocketAddrs},
|
||||
str::FromStr,
|
||||
sync::mpsc,
|
||||
thread,
|
||||
time::Duration,
|
||||
};
|
||||
use std::{io, net::ToSocketAddrs, sync::mpsc, thread, time::Duration};
|
||||
|
||||
const TPS: u64 = 10; // Low value is okay, just reading messages.
|
||||
|
||||
|
@ -2,7 +2,7 @@ use super::{
|
||||
super::{Animation, SkeletonAttr},
|
||||
CharacterSkeleton,
|
||||
};
|
||||
use std::{f32::consts::PI, ops::Mul};
|
||||
use std::f32::consts::PI;
|
||||
use vek::*;
|
||||
|
||||
pub struct Input {
|
||||
@ -16,7 +16,7 @@ impl Animation for AttackAnimation {
|
||||
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
global_time: f64,
|
||||
_global_time: f64,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
@ -25,7 +25,6 @@ impl Animation for AttackAnimation {
|
||||
let wave_quicken = 1.0 - (anim_time as f32 * 16.0).cos();
|
||||
let wave_quicken_slow = 1.0 - (anim_time as f32 * 12.0).cos();
|
||||
let wave_quicken_double = 1.0 - (anim_time as f32 * 24.0).cos();
|
||||
let wave_quick = (anim_time as f32 * 0.5).sin();
|
||||
let wave_stop_quick = (anim_time as f32 * 16.0).min(PI / 2.0).sin();
|
||||
|
||||
next.head.offset = Vec3::new(
|
||||
|
@ -22,8 +22,6 @@ impl Animation for CidleAnimation {
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
let wave = (anim_time as f32 * 4.0).sin();
|
||||
|
||||
let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin();
|
||||
let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos();
|
||||
let wave_slow_cos = (anim_time as f32 * 6.0 + PI).cos();
|
||||
|
@ -13,15 +13,14 @@ impl Animation for CjumpAnimation {
|
||||
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
global_time: f64,
|
||||
_global_time: f64,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
let wave = (anim_time as f32 * 14.0).sin();
|
||||
|
||||
let wave_slow = (anim_time as f32 * 7.0).sin();
|
||||
let wave_stop = (anim_time as f32 * 4.5).min(PI / 2.0).sin();
|
||||
let wave_stop_alt = (anim_time as f32 * 5.0).min(PI / 2.0).sin();
|
||||
|
||||
next.head.offset = Vec3::new(
|
||||
0.0 + skeleton_attr.neck_right,
|
||||
|
@ -25,8 +25,6 @@ impl Animation for GlidingAnimation {
|
||||
let wave_very_slow_alt = (anim_time as f32 * 2.5).sin();
|
||||
let wave_very_slow_cos = (anim_time as f32 * 3.0).cos();
|
||||
|
||||
let wave_slow_test = (anim_time as f32).min(PI / 2.0).sin();
|
||||
|
||||
let head_look = Vec2::new(
|
||||
((global_time + anim_time) as f32 / 4.0)
|
||||
.floor()
|
||||
|
@ -22,8 +22,6 @@ impl Animation for IdleAnimation {
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
let wave = (anim_time as f32 * 4.0).sin();
|
||||
|
||||
let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin();
|
||||
let wave_ultra_slow_cos = (anim_time as f32 * 1.0 + PI).cos();
|
||||
|
||||
|
@ -13,7 +13,7 @@ impl Animation for JumpAnimation {
|
||||
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
global_time: f64,
|
||||
_global_time: f64,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
|
@ -22,8 +22,6 @@ pub use self::run::RunAnimation;
|
||||
use super::{Bone, Skeleton};
|
||||
use crate::render::FigureBoneData;
|
||||
|
||||
const SCALE: f32 = 11.0;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct CharacterSkeleton {
|
||||
head: Bone,
|
||||
|
@ -2,7 +2,7 @@ use super::{
|
||||
super::{Animation, SkeletonAttr},
|
||||
CharacterSkeleton,
|
||||
};
|
||||
use std::{f32::consts::PI, ops::Mul};
|
||||
use std::f32::consts::PI;
|
||||
use vek::*;
|
||||
|
||||
pub struct RollAnimation;
|
||||
@ -13,7 +13,7 @@ impl Animation for RollAnimation {
|
||||
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
global_time: f64,
|
||||
_global_time: f64,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
@ -22,7 +22,6 @@ impl Animation for RollAnimation {
|
||||
let wave = (anim_time as f32 * 5.5).sin();
|
||||
let wave_quick = (anim_time as f32 * 9.5).sin();
|
||||
let wave_quick_cos = (anim_time as f32 * 9.5).cos();
|
||||
let wave_cos = (anim_time as f32 * 5.5).cos();
|
||||
let wave_slow = (anim_time as f32 * 2.8 + PI).sin();
|
||||
let wave_dub = (anim_time as f32 * 5.5).sin();
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
use super::Skeleton;
|
||||
use crate::render::FigureBoneData;
|
||||
|
||||
const SCALE: f32 = 44.0;
|
||||
|
||||
pub struct FixtureSkeleton;
|
||||
|
||||
impl FixtureSkeleton {
|
||||
@ -33,5 +31,5 @@ impl Skeleton for FixtureSkeleton {
|
||||
]
|
||||
}
|
||||
|
||||
fn interpolate(&mut self, target: &Self, dt: f32) {}
|
||||
fn interpolate(&mut self, _target: &Self, _dt: f32) {}
|
||||
}
|
||||
|
@ -87,7 +87,6 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
(Undead, Female) => 0.93,
|
||||
(Danari, Male) => 0.85,
|
||||
(Danari, Female) => 0.82,
|
||||
_ => 1.0,
|
||||
},
|
||||
head_scale: match (body.race, body.body_type) {
|
||||
(Orc, Male) => 0.9,
|
||||
@ -102,7 +101,6 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
(Undead, Female) => 1.0,
|
||||
(Danari, Male) => 1.11,
|
||||
(Danari, Female) => 1.11,
|
||||
_ => 1.0,
|
||||
},
|
||||
neck_height: match (body.race, body.body_type) {
|
||||
(Orc, Male) => -2.0,
|
||||
@ -117,7 +115,6 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
(Undead, Female) => -0.5,
|
||||
(Danari, Male) => 0.5,
|
||||
(Danari, Female) => -0.5,
|
||||
_ => 1.0,
|
||||
},
|
||||
neck_forward: match (body.race, body.body_type) {
|
||||
(Orc, Male) => 1.0,
|
||||
@ -132,7 +129,6 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
(Undead, Female) => 1.0,
|
||||
(Danari, Male) => 0.5,
|
||||
(Danari, Female) => 0.0,
|
||||
_ => 1.0,
|
||||
},
|
||||
neck_right: match (body.race, body.body_type) {
|
||||
(Orc, Male) => 0.0,
|
||||
@ -147,7 +143,6 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
(Undead, Female) => 0.0,
|
||||
(Danari, Male) => 0.0,
|
||||
(Danari, Female) => 0.0,
|
||||
_ => 1.0,
|
||||
},
|
||||
weapon_x: match Weapon::Sword {
|
||||
// TODO: Inventory
|
||||
@ -158,8 +153,6 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
Weapon::Staff => 3.0,
|
||||
Weapon::Bow => 0.0,
|
||||
Weapon::Daggers => 0.0,
|
||||
|
||||
_ => 1.0,
|
||||
},
|
||||
weapon_y: match Weapon::Sword {
|
||||
// TODO: Inventory
|
||||
@ -170,8 +163,6 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
Weapon::Staff => 0.0,
|
||||
Weapon::Bow => -2.0,
|
||||
Weapon::Daggers => -2.0,
|
||||
|
||||
_ => 1.0,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ impl Animation for IdleAnimation {
|
||||
skeleton: &Self::Skeleton,
|
||||
global_time: Self::Dependency,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
_skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
|
@ -13,9 +13,9 @@ impl Animation for JumpAnimation {
|
||||
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(velocity, global_time): Self::Dependency,
|
||||
(_velocity, _global_time): Self::Dependency,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
_skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
|
@ -10,8 +10,6 @@ pub use self::run::RunAnimation;
|
||||
use super::{Bone, Skeleton};
|
||||
use crate::render::FigureBoneData;
|
||||
|
||||
const SCALE: f32 = 11.0;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct QuadrupedSkeleton {
|
||||
pig_head: Bone,
|
||||
|
@ -2,7 +2,6 @@ use super::{
|
||||
super::{Animation, SkeletonAttr},
|
||||
QuadrupedSkeleton,
|
||||
};
|
||||
use std::f32::consts::PI;
|
||||
use vek::*;
|
||||
|
||||
pub struct RunAnimation;
|
||||
@ -13,9 +12,9 @@ impl Animation for RunAnimation {
|
||||
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(velocity, global_time): Self::Dependency,
|
||||
(_velocity, _global_time): Self::Dependency,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
_skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
|
@ -15,7 +15,7 @@ impl Animation for IdleAnimation {
|
||||
skeleton: &Self::Skeleton,
|
||||
global_time: Self::Dependency,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
_skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
|
@ -13,9 +13,9 @@ impl Animation for JumpAnimation {
|
||||
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
global_time: Self::Dependency,
|
||||
_global_time: Self::Dependency,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
_skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
|
@ -10,8 +10,6 @@ pub use self::run::RunAnimation;
|
||||
use super::{Bone, Skeleton};
|
||||
use crate::render::FigureBoneData;
|
||||
|
||||
const SCALE: f32 = 11.0;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct QuadrupedMediumSkeleton {
|
||||
wolf_head_upper: Bone,
|
||||
|
@ -13,9 +13,9 @@ impl Animation for RunAnimation {
|
||||
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(velocity, global_time): Self::Dependency,
|
||||
(_velocity, global_time): Self::Dependency,
|
||||
anim_time: f64,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
_skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
@ -39,18 +39,6 @@ impl Animation for RunAnimation {
|
||||
.sin()
|
||||
* 0.125,
|
||||
);
|
||||
let wolf_tail = Vec2::new(
|
||||
((global_time + anim_time) as f32 / 2.0)
|
||||
.floor()
|
||||
.mul(7331.0)
|
||||
.sin()
|
||||
* 0.25,
|
||||
((global_time + anim_time) as f32 / 2.0)
|
||||
.floor()
|
||||
.mul(1337.0)
|
||||
.sin()
|
||||
* 0.125,
|
||||
);
|
||||
|
||||
next.wolf_head_upper.offset =
|
||||
Vec3::new(0.0, 9.5 + wave_quick_cos * 2.0, 15.0 + wave_med * 3.0) / 11.0;
|
||||
|
Loading…
Reference in New Issue
Block a user