Fixes some typos, comment inconsistencies, and incorrect naming conventions.

This commit is contained in:
Cody 2019-05-30 21:33:54 -04:00
parent 02ee63d676
commit a258be7aac
No known key found for this signature in database
GPG Key ID: 4953DADF9B6AD3C8
11 changed files with 124 additions and 124 deletions

View File

@ -53,52 +53,52 @@ impl Animation for IdleAnimation {
* 0.125, * 0.125,
); );
next.wolf_upperhead.offset = Vec3::new(0.0, 7.5, 15.0 + wave_ultra_slow * 0.4) / 11.0; next.wolf_head_upper.offset = Vec3::new(0.0, 7.5, 15.0 + wave_ultra_slow * 0.4) / 11.0;
next.wolf_upperhead.ori = next.wolf_head_upper.ori =
Quaternion::rotation_z(wolf_look.x) * Quaternion::rotation_x(wolf_look.y); Quaternion::rotation_z(wolf_look.x) * Quaternion::rotation_x(wolf_look.y);
next.wolf_upperhead.scale = Vec3::one() / 10.88; next.wolf_head_upper.scale = Vec3::one() / 10.88;
next.wolf_jaw.offset = next.wolf_jaw.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0 + wave_slow * 0.2); Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0 + wave_slow * 0.2);
next.wolf_jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); next.wolf_jaw.ori = Quaternion::rotation_x(wave_slow * 0.05);
next.wolf_jaw.scale = Vec3::one() * 1.01; next.wolf_jaw.scale = Vec3::one() * 1.01;
next.wolf_lowerhead.offset = Vec3::new(0.0, 3.1, -4.5 + wave_ultra_slow * 0.20); next.wolf_head_lower.offset = Vec3::new(0.0, 3.1, -4.5 + wave_ultra_slow * 0.20);
next.wolf_lowerhead.ori = Quaternion::rotation_z(0.0); next.wolf_head_lower.ori = Quaternion::rotation_z(0.0);
next.wolf_lowerhead.scale = Vec3::one() * 0.98; next.wolf_head_lower.scale = Vec3::one() * 0.98;
next.wolf_tail.offset = Vec3::new(0.0, -13.0, 8.0 + wave_ultra_slow * 1.2) / 11.0; next.wolf_tail.offset = Vec3::new(0.0, -13.0, 8.0 + wave_ultra_slow * 1.2) / 11.0;
next.wolf_tail.ori = Quaternion::rotation_z(0.0 + wave_slow * 0.2 + wolf_tail.x) next.wolf_tail.ori = Quaternion::rotation_z(0.0 + wave_slow * 0.2 + wolf_tail.x)
* Quaternion::rotation_x(wolf_tail.y); * Quaternion::rotation_x(wolf_tail.y);
next.wolf_tail.scale = Vec3::one() / 11.0; next.wolf_tail.scale = Vec3::one() / 11.0;
next.wolf_torsoback.offset = Vec3::new(0.0, -11.7, 11.0 + wave_ultra_slow * 1.2) / 11.0; next.wolf_torso_back.offset = Vec3::new(0.0, -11.7, 11.0 + wave_ultra_slow * 1.2) / 11.0;
next.wolf_torsoback.ori = Quaternion::rotation_y(wave_slow_cos * 0.015); next.wolf_torso_back.ori = Quaternion::rotation_y(wave_slow_cos * 0.015);
next.wolf_torsoback.scale = Vec3::one() / 11.0; next.wolf_torso_back.scale = Vec3::one() / 11.0;
next.wolf_torsomid.offset = Vec3::new(0.0, 0.0, 12.0 + wave_ultra_slow * 0.7) / 11.0; next.wolf_torso_mid.offset = Vec3::new(0.0, 0.0, 12.0 + wave_ultra_slow * 0.7) / 11.0;
next.wolf_torsomid.ori = Quaternion::rotation_y(wave_slow * 0.015); next.wolf_torso_mid.ori = Quaternion::rotation_y(wave_slow * 0.015);
next.wolf_torsomid.scale = Vec3::one() / 10.5; next.wolf_torso_mid.scale = Vec3::one() / 10.5;
next.wolf_ears.offset = Vec3::new(0.0, 0.75, 5.25); next.wolf_ears.offset = Vec3::new(0.0, 0.75, 5.25);
next.wolf_ears.ori = Quaternion::rotation_x(0.0 + wave_slow * 0.1); next.wolf_ears.ori = Quaternion::rotation_x(0.0 + wave_slow * 0.1);
next.wolf_ears.scale = Vec3::one() * 1.05; next.wolf_ears.scale = Vec3::one() * 1.05;
next.wolf_LFFoot.offset = Vec3::new(-5.0, 5.0, 2.5) / 11.0; next.wolf_foot_lf.offset = Vec3::new(-5.0, 5.0, 2.5) / 11.0;
next.wolf_LFFoot.ori = Quaternion::rotation_x(0.0); next.wolf_foot_lf.ori = Quaternion::rotation_x(0.0);
next.wolf_LFFoot.scale = Vec3::one() / 11.0; next.wolf_foot_lf.scale = Vec3::one() / 11.0;
next.wolf_RFFoot.offset = Vec3::new(5.0, 5.0, 2.5) / 11.0; next.wolf_foot_rf.offset = Vec3::new(5.0, 5.0, 2.5) / 11.0;
next.wolf_RFFoot.ori = Quaternion::rotation_x(0.0); next.wolf_foot_rf.ori = Quaternion::rotation_x(0.0);
next.wolf_RFFoot.scale = Vec3::one() / 11.0; next.wolf_foot_rf.scale = Vec3::one() / 11.0;
next.wolf_LBFoot.offset = Vec3::new(-5.0, -10.0, 2.5) / 11.0; next.wolf_foot_lb.offset = Vec3::new(-5.0, -10.0, 2.5) / 11.0;
next.wolf_LBFoot.ori = Quaternion::rotation_x(0.0); next.wolf_foot_lb.ori = Quaternion::rotation_x(0.0);
next.wolf_LBFoot.scale = Vec3::one() / 11.0; next.wolf_foot_lb.scale = Vec3::one() / 11.0;
next.wolf_RBFoot.offset = Vec3::new(5.0, -10.0, 2.5) / 11.0; next.wolf_foot_rb.offset = Vec3::new(5.0, -10.0, 2.5) / 11.0;
next.wolf_RBFoot.ori = Quaternion::rotation_x(0.0); next.wolf_foot_rb.ori = Quaternion::rotation_x(0.0);
next.wolf_RBFoot.scale = Vec3::one() / 11.0; next.wolf_foot_rb.scale = Vec3::one() / 11.0;
next next
} }

View File

@ -28,56 +28,56 @@ impl Animation for JumpAnimation {
let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos(); let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos();
let wave_stop = (anim_time as f32 * 5.0).min(PI / 2.0).sin(); let wave_stop = (anim_time as f32 * 5.0).min(PI / 2.0).sin();
next.wolf_upperhead.offset = Vec3::new(0.0, 7.5, 15.0 + wave_stop * 4.8) / 11.0; next.wolf_head_upper.offset = Vec3::new(0.0, 7.5, 15.0 + wave_stop * 4.8) / 11.0;
next.wolf_upperhead.ori = next.wolf_head_upper.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_slow * -0.25); Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_slow * -0.25);
next.wolf_upperhead.scale = Vec3::one() / 10.88; next.wolf_head_upper.scale = Vec3::one() / 10.88;
next.wolf_jaw.offset = Vec3::new(0.0, 4.5, 2.0); next.wolf_jaw.offset = Vec3::new(0.0, 4.5, 2.0);
next.wolf_jaw.ori = Quaternion::rotation_x(0.0); next.wolf_jaw.ori = Quaternion::rotation_x(0.0);
next.wolf_jaw.scale = Vec3::one() * 1.01; next.wolf_jaw.scale = Vec3::one() * 1.01;
next.wolf_lowerhead.offset = Vec3::new(0.0, 3.1, -4.5); next.wolf_head_lower.offset = Vec3::new(0.0, 3.1, -4.5);
next.wolf_lowerhead.ori = Quaternion::rotation_x(wave_stop * -0.1); next.wolf_head_lower.ori = Quaternion::rotation_x(wave_stop * -0.1);
next.wolf_lowerhead.scale = Vec3::one() * 0.98; next.wolf_head_lower.scale = Vec3::one() * 0.98;
next.wolf_tail.offset = Vec3::new(0.0, -12.0, 8.0) / 11.0; next.wolf_tail.offset = Vec3::new(0.0, -12.0, 8.0) / 11.0;
next.wolf_tail.ori = next.wolf_tail.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_slow * -0.25); Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_slow * -0.25);
next.wolf_tail.scale = Vec3::one() / 11.0; next.wolf_tail.scale = Vec3::one() / 11.0;
next.wolf_torsoback.offset = next.wolf_torso_back.offset =
Vec3::new(0.0, -9.5 + wave_stop * 1.0, 11.0 + wave_stop * 2.2) / 11.0; Vec3::new(0.0, -9.5 + wave_stop * 1.0, 11.0 + wave_stop * 2.2) / 11.0;
next.wolf_torsoback.ori = Quaternion::rotation_x(wave_slow * -0.25); next.wolf_torso_back.ori = Quaternion::rotation_x(wave_slow * -0.25);
next.wolf_torsoback.scale = Vec3::one() / 11.0; next.wolf_torso_back.scale = Vec3::one() / 11.0;
next.wolf_torsomid.offset = Vec3::new(0.0, 0.0, 12.0 + wave_stop * 3.6) / 11.0; next.wolf_torso_mid.offset = Vec3::new(0.0, 0.0, 12.0 + wave_stop * 3.6) / 11.0;
next.wolf_torsomid.ori = Quaternion::rotation_x(wave_slow * -0.25); next.wolf_torso_mid.ori = Quaternion::rotation_x(wave_slow * -0.25);
next.wolf_torsomid.scale = Vec3::one() / 10.5; next.wolf_torso_mid.scale = Vec3::one() / 10.5;
next.wolf_ears.offset = Vec3::new(0.0, 0.75, 6.25); next.wolf_ears.offset = Vec3::new(0.0, 0.75, 6.25);
next.wolf_ears.ori = Quaternion::rotation_x(0.0); next.wolf_ears.ori = Quaternion::rotation_x(0.0);
next.wolf_ears.scale = Vec3::one() * 1.05; next.wolf_ears.scale = Vec3::one() * 1.05;
next.wolf_LFFoot.offset = next.wolf_foot_lf.offset =
Vec3::new(-5.0, 5.0 + wave_stop * 3.0, 5.0 + wave_stop * 7.0) / 11.0; Vec3::new(-5.0, 5.0 + wave_stop * 3.0, 5.0 + wave_stop * 7.0) / 11.0;
next.wolf_LFFoot.ori = Quaternion::rotation_x(wave_stop * 1.0 + wave * 0.15); next.wolf_foot_lf.ori = Quaternion::rotation_x(wave_stop * 1.0 + wave * 0.15);
next.wolf_LFFoot.scale = Vec3::one() / 11.0; next.wolf_foot_lf.scale = Vec3::one() / 11.0;
next.wolf_RFFoot.offset = next.wolf_foot_rf.offset =
Vec3::new(5.0, 5.0 - wave_stop * 3.0, 5.0 + wave_stop * 5.0) / 11.0; Vec3::new(5.0, 5.0 - wave_stop * 3.0, 5.0 + wave_stop * 5.0) / 11.0;
next.wolf_RFFoot.ori = Quaternion::rotation_x(wave_stop * -1.0 + wave * 0.15); next.wolf_foot_rf.ori = Quaternion::rotation_x(wave_stop * -1.0 + wave * 0.15);
next.wolf_RFFoot.scale = Vec3::one() / 11.0; next.wolf_foot_rf.scale = Vec3::one() / 11.0;
next.wolf_LBFoot.offset = next.wolf_foot_lb.offset =
Vec3::new(-5.0, -10.0 - wave_stop * 2.0, 5.0 + wave_stop * 0.0) / 11.0; Vec3::new(-5.0, -10.0 - wave_stop * 2.0, 5.0 + wave_stop * 0.0) / 11.0;
next.wolf_LBFoot.ori = Quaternion::rotation_x(wave_stop * -1.0 + wave * 0.15); next.wolf_foot_lb.ori = Quaternion::rotation_x(wave_stop * -1.0 + wave * 0.15);
next.wolf_LBFoot.scale = Vec3::one() / 11.0; next.wolf_foot_lb.scale = Vec3::one() / 11.0;
next.wolf_RBFoot.offset = next.wolf_foot_rb.offset =
Vec3::new(5.0, -10.0 + wave_stop * 2.0, 5.0 + wave_stop * 2.0) / 11.0; Vec3::new(5.0, -10.0 + wave_stop * 2.0, 5.0 + wave_stop * 2.0) / 11.0;
next.wolf_RBFoot.ori = Quaternion::rotation_x(wave_stop * 1.0 + wave * 0.15); next.wolf_foot_rb.ori = Quaternion::rotation_x(wave_stop * 1.0 + wave * 0.15);
next.wolf_RBFoot.scale = Vec3::one() / 11.0; next.wolf_foot_rb.scale = Vec3::one() / 11.0;
next next
} }

View File

@ -17,33 +17,33 @@ const SCALE: f32 = 11.0;
#[derive(Clone)] #[derive(Clone)]
pub struct QuadrupedMediumSkeleton { pub struct QuadrupedMediumSkeleton {
wolf_upperhead: Bone, wolf_head_upper: Bone,
wolf_jaw: Bone, wolf_jaw: Bone,
wolf_lowerhead: Bone, wolf_head_lower: Bone,
wolf_tail: Bone, wolf_tail: Bone,
wolf_torsoback: Bone, wolf_torso_back: Bone,
wolf_torsomid: Bone, wolf_torso_mid: Bone,
wolf_ears: Bone, wolf_ears: Bone,
wolf_LFFoot: Bone, wolf_foot_lf: Bone,
wolf_RFFoot: Bone, wolf_foot_rf: Bone,
wolf_LBFoot: Bone, wolf_foot_lb: Bone,
wolf_RBFoot: Bone, wolf_foot_rb: Bone,
} }
impl QuadrupedMediumSkeleton { impl QuadrupedMediumSkeleton {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
wolf_upperhead: Bone::default(), wolf_head_upper: Bone::default(),
wolf_jaw: Bone::default(), wolf_jaw: Bone::default(),
wolf_lowerhead: Bone::default(), wolf_head_lower: Bone::default(),
wolf_tail: Bone::default(), wolf_tail: Bone::default(),
wolf_torsoback: Bone::default(), wolf_torso_back: Bone::default(),
wolf_torsomid: Bone::default(), wolf_torso_mid: Bone::default(),
wolf_ears: Bone::default(), wolf_ears: Bone::default(),
wolf_LFFoot: Bone::default(), wolf_foot_lf: Bone::default(),
wolf_RFFoot: Bone::default(), wolf_foot_rf: Bone::default(),
wolf_LBFoot: Bone::default(), wolf_foot_lb: Bone::default(),
wolf_RBFoot: Bone::default(), wolf_foot_rb: Bone::default(),
} }
} }
} }
@ -51,23 +51,23 @@ impl QuadrupedMediumSkeleton {
impl Skeleton for QuadrupedMediumSkeleton { impl Skeleton for QuadrupedMediumSkeleton {
fn compute_matrices(&self) -> [FigureBoneData; 16] { fn compute_matrices(&self) -> [FigureBoneData; 16] {
let ears_mat = self.wolf_ears.compute_base_matrix(); let ears_mat = self.wolf_ears.compute_base_matrix();
let upperhead_mat = self.wolf_upperhead.compute_base_matrix(); let head_upper_mat = self.wolf_head_upper.compute_base_matrix();
let lowerhead_mat = self.wolf_lowerhead.compute_base_matrix(); let head_lower_mat = self.wolf_head_lower.compute_base_matrix();
[ [
FigureBoneData::new(upperhead_mat), FigureBoneData::new(head_upper_mat),
FigureBoneData::new( FigureBoneData::new(
upperhead_mat * lowerhead_mat * self.wolf_jaw.compute_base_matrix(), head_upper_mat * head_lower_mat * self.wolf_jaw.compute_base_matrix(),
), ),
FigureBoneData::new(upperhead_mat * lowerhead_mat), FigureBoneData::new(head_upper_mat * head_lower_mat),
FigureBoneData::new(self.wolf_tail.compute_base_matrix()), FigureBoneData::new(self.wolf_tail.compute_base_matrix()),
FigureBoneData::new(self.wolf_torsoback.compute_base_matrix()), FigureBoneData::new(self.wolf_torso_back.compute_base_matrix()),
FigureBoneData::new(self.wolf_torsomid.compute_base_matrix()), FigureBoneData::new(self.wolf_torso_mid.compute_base_matrix()),
FigureBoneData::new(upperhead_mat * ears_mat), FigureBoneData::new(head_upper_mat * ears_mat),
FigureBoneData::new(self.wolf_LFFoot.compute_base_matrix()), FigureBoneData::new(self.wolf_foot_lf.compute_base_matrix()),
FigureBoneData::new(self.wolf_RFFoot.compute_base_matrix()), FigureBoneData::new(self.wolf_foot_rf.compute_base_matrix()),
FigureBoneData::new(self.wolf_LBFoot.compute_base_matrix()), FigureBoneData::new(self.wolf_foot_lb.compute_base_matrix()),
FigureBoneData::new(self.wolf_RBFoot.compute_base_matrix()), FigureBoneData::new(self.wolf_foot_rb.compute_base_matrix()),
FigureBoneData::default(), FigureBoneData::default(),
FigureBoneData::default(), FigureBoneData::default(),
FigureBoneData::default(), FigureBoneData::default(),
@ -77,16 +77,16 @@ impl Skeleton for QuadrupedMediumSkeleton {
} }
fn interpolate(&mut self, target: &Self) { fn interpolate(&mut self, target: &Self) {
self.wolf_upperhead.interpolate(&target.wolf_upperhead); self.wolf_head_upper.interpolate(&target.wolf_head_upper);
self.wolf_jaw.interpolate(&target.wolf_jaw); self.wolf_jaw.interpolate(&target.wolf_jaw);
self.wolf_lowerhead.interpolate(&target.wolf_lowerhead); self.wolf_head_lower.interpolate(&target.wolf_head_lower);
self.wolf_tail.interpolate(&target.wolf_tail); self.wolf_tail.interpolate(&target.wolf_tail);
self.wolf_torsoback.interpolate(&target.wolf_torsoback); self.wolf_torso_back.interpolate(&target.wolf_torso_back);
self.wolf_torsomid.interpolate(&target.wolf_torsomid); self.wolf_torso_mid.interpolate(&target.wolf_torso_mid);
self.wolf_ears.interpolate(&target.wolf_ears); self.wolf_ears.interpolate(&target.wolf_ears);
self.wolf_LFFoot.interpolate(&target.wolf_LFFoot); self.wolf_foot_lf.interpolate(&target.wolf_foot_lf);
self.wolf_RFFoot.interpolate(&target.wolf_RFFoot); self.wolf_foot_rf.interpolate(&target.wolf_foot_rf);
self.wolf_LBFoot.interpolate(&target.wolf_LBFoot); self.wolf_foot_lb.interpolate(&target.wolf_foot_lb);
self.wolf_RBFoot.interpolate(&target.wolf_RBFoot); self.wolf_foot_rb.interpolate(&target.wolf_foot_rb);
} }
} }

View File

@ -58,58 +58,58 @@ impl Animation for RunAnimation {
* 0.125, * 0.125,
); );
next.wolf_upperhead.offset = next.wolf_head_upper.offset =
Vec3::new(0.0, 9.5 + wave_quick_cos * 2.0, 15.0 + wave_med * 3.0) / 11.0; Vec3::new(0.0, 9.5 + wave_quick_cos * 2.0, 15.0 + wave_med * 3.0) / 11.0;
next.wolf_upperhead.ori = next.wolf_head_upper.ori =
Quaternion::rotation_x(-0.12 + wave_quick_cos * 0.12 + wolf_look.y) Quaternion::rotation_x(-0.12 + wave_quick_cos * 0.12 + wolf_look.y)
* Quaternion::rotation_z(wolf_look.x); * Quaternion::rotation_z(wolf_look.x);
next.wolf_upperhead.scale = Vec3::one() / 10.88; next.wolf_head_upper.scale = Vec3::one() / 10.88;
next.wolf_jaw.offset = Vec3::new(0.0, 4.5, 2.0 + wave_slow_cos * 1.0); next.wolf_jaw.offset = Vec3::new(0.0, 4.5, 2.0 + wave_slow_cos * 1.0);
next.wolf_jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); next.wolf_jaw.ori = Quaternion::rotation_x(wave_slow * 0.05);
next.wolf_jaw.scale = Vec3::one() * 1.01; next.wolf_jaw.scale = Vec3::one() * 1.01;
next.wolf_lowerhead.offset = Vec3::new(0.0, 3.1, -4.5 + wave_med * 1.0); next.wolf_head_lower.offset = Vec3::new(0.0, 3.1, -4.5 + wave_med * 1.0);
next.wolf_lowerhead.ori = Quaternion::rotation_z(0.0); next.wolf_head_lower.ori = Quaternion::rotation_z(0.0);
next.wolf_lowerhead.scale = Vec3::one() * 0.98; next.wolf_head_lower.scale = Vec3::one() * 0.98;
next.wolf_tail.offset = Vec3::new(0.0, -12.0, 10.0) / 11.0; next.wolf_tail.offset = Vec3::new(0.0, -12.0, 10.0) / 11.0;
next.wolf_tail.ori = Quaternion::rotation_x(wave_quick * 0.18); next.wolf_tail.ori = Quaternion::rotation_x(wave_quick * 0.18);
next.wolf_tail.scale = Vec3::one() / 11.0; next.wolf_tail.scale = Vec3::one() / 11.0;
next.wolf_torsoback.offset = next.wolf_torso_back.offset =
Vec3::new(0.0, -9.5 + wave_quick_cos * 2.2, 13.0 + wave_med * 2.8) / 11.0; Vec3::new(0.0, -9.5 + wave_quick_cos * 2.2, 13.0 + wave_med * 2.8) / 11.0;
next.wolf_torsoback.ori = Quaternion::rotation_x(-0.15 + wave_med_cos * 0.14); next.wolf_torso_back.ori = Quaternion::rotation_x(-0.15 + wave_med_cos * 0.14);
next.wolf_torsoback.scale = Vec3::one() / 11.0; next.wolf_torso_back.scale = Vec3::one() / 11.0;
next.wolf_torsomid.offset = next.wolf_torso_mid.offset =
Vec3::new(0.0, 0.0 + wave_quick_cos * 2.2, 14.0 + wave_med * 3.2) / 11.0; Vec3::new(0.0, 0.0 + wave_quick_cos * 2.2, 14.0 + wave_med * 3.2) / 11.0;
next.wolf_torsomid.ori = Quaternion::rotation_x(-0.15 + wave_med_cos * 0.12); next.wolf_torso_mid.ori = Quaternion::rotation_x(-0.15 + wave_med_cos * 0.12);
next.wolf_torsomid.scale = Vec3::one() / 10.5; next.wolf_torso_mid.scale = Vec3::one() / 10.5;
next.wolf_ears.offset = Vec3::new(0.0, 0.75 + wave * 0.4, 6.25); next.wolf_ears.offset = Vec3::new(0.0, 0.75 + wave * 0.4, 6.25);
next.wolf_ears.ori = Quaternion::rotation_x(wave * 0.2); next.wolf_ears.ori = Quaternion::rotation_x(wave * 0.2);
next.wolf_ears.scale = Vec3::one() * 1.05; next.wolf_ears.scale = Vec3::one() * 1.05;
next.wolf_LFFoot.offset = next.wolf_foot_lf.offset =
Vec3::new(-5.0, 5.0 + wave_quick * 3.0, 7.0 + wave_quick_cos * 4.0) / 11.0; Vec3::new(-5.0, 5.0 + wave_quick * 3.0, 7.0 + wave_quick_cos * 4.0) / 11.0;
next.wolf_LFFoot.ori = Quaternion::rotation_x(0.0 + wave_quick * 0.8); next.wolf_foot_lf.ori = Quaternion::rotation_x(0.0 + wave_quick * 0.8);
next.wolf_LFFoot.scale = Vec3::one() / 11.0; next.wolf_foot_lf.scale = Vec3::one() / 11.0;
next.wolf_RFFoot.offset = next.wolf_foot_rf.offset =
Vec3::new(5.0, 5.0 - wave_quick_cos * 3.0, 7.0 + wave_quick * 4.0) / 11.0; Vec3::new(5.0, 5.0 - wave_quick_cos * 3.0, 7.0 + wave_quick * 4.0) / 11.0;
next.wolf_RFFoot.ori = Quaternion::rotation_x(0.0 - wave_quick_cos * 0.8); next.wolf_foot_rf.ori = Quaternion::rotation_x(0.0 - wave_quick_cos * 0.8);
next.wolf_RFFoot.scale = Vec3::one() / 11.0; next.wolf_foot_rf.scale = Vec3::one() / 11.0;
next.wolf_LBFoot.offset = next.wolf_foot_lb.offset =
Vec3::new(-5.0, -10.0 - wave_quick_cos * 3.0, 7.0 + wave_quick * 4.0) / 11.0; Vec3::new(-5.0, -10.0 - wave_quick_cos * 3.0, 7.0 + wave_quick * 4.0) / 11.0;
next.wolf_LBFoot.ori = Quaternion::rotation_x(0.0 - wave_quick_cos * 0.8); next.wolf_foot_lb.ori = Quaternion::rotation_x(0.0 - wave_quick_cos * 0.8);
next.wolf_LBFoot.scale = Vec3::one() / 11.0; next.wolf_foot_lb.scale = Vec3::one() / 11.0;
next.wolf_RBFoot.offset = next.wolf_foot_rb.offset =
Vec3::new(5.0, -10.0 + wave_quick * 3.0, 7.0 + wave_quick_cos * 4.0) / 11.0; Vec3::new(5.0, -10.0 + wave_quick * 3.0, 7.0 + wave_quick_cos * 4.0) / 11.0;
next.wolf_RBFoot.ori = Quaternion::rotation_x(0.0 + wave_quick * 0.8); next.wolf_foot_rb.ori = Quaternion::rotation_x(0.0 + wave_quick * 0.8);
next.wolf_RBFoot.scale = Vec3::one() / 11.0; next.wolf_foot_rb.scale = Vec3::one() / 11.0;
next next
} }

View File

@ -19,7 +19,7 @@ pub struct AudioFrontend {
device: Device, device: Device,
// Performance optimisation, iterating through available audio devices takes time // Performance optimisation, iterating through available audio devices takes time
devices: Vec<Device>, devices: Vec<Device>,
// streams: HashMap<String, SpatialSink>, //always use SpatialSink even if no possition is used for now // streams: HashMap<String, SpatialSink>, //always use SpatialSink even if no position is used for now
stream: SpatialSink, stream: SpatialSink,
} }

View File

@ -88,14 +88,14 @@ impl PlayState for CharSelectionState {
} }
} }
// Mantain global state // Maintain global state.
global_state.maintain(); global_state.maintain();
// Maintain the scene. // Maintain the scene.
self.scene self.scene
.maintain(global_state.window.renderer_mut(), &self.client.borrow()); .maintain(global_state.window.renderer_mut(), &self.client.borrow());
// Render the scene // Render the scene.
self.scene.render( self.scene.render(
global_state.window.renderer_mut(), global_state.window.renderer_mut(),
&self.client.borrow(), &self.client.borrow(),

View File

@ -443,7 +443,7 @@ pub struct FigureMgr {
model_cache: FigureModelCache, model_cache: FigureModelCache,
character_states: HashMap<EcsEntity, FigureState<CharacterSkeleton>>, character_states: HashMap<EcsEntity, FigureState<CharacterSkeleton>>,
quadruped_states: HashMap<EcsEntity, FigureState<QuadrupedSkeleton>>, quadruped_states: HashMap<EcsEntity, FigureState<QuadrupedSkeleton>>,
QuadrupedMedium_states: HashMap<EcsEntity, FigureState<QuadrupedMediumSkeleton>>, quadruped_medium_states: HashMap<EcsEntity, FigureState<QuadrupedMediumSkeleton>>,
} }
impl FigureMgr { impl FigureMgr {
@ -452,7 +452,7 @@ impl FigureMgr {
model_cache: FigureModelCache::new(), model_cache: FigureModelCache::new(),
character_states: HashMap::new(), character_states: HashMap::new(),
quadruped_states: HashMap::new(), quadruped_states: HashMap::new(),
QuadrupedMedium_states: HashMap::new(), quadruped_medium_states: HashMap::new(),
} }
} }
@ -500,7 +500,7 @@ impl FigureMgr {
self.quadruped_states.remove(&entity); self.quadruped_states.remove(&entity);
} }
Body::QuadrupedMedium(_) => { Body::QuadrupedMedium(_) => {
self.QuadrupedMedium_states.remove(&entity); self.quadruped_medium_states.remove(&entity);
} }
}, },
} }
@ -590,7 +590,7 @@ impl FigureMgr {
} }
Body::QuadrupedMedium(body) => { Body::QuadrupedMedium(body) => {
let state = let state =
self.QuadrupedMedium_states self.quadruped_medium_states
.entry(entity) .entry(entity)
.or_insert_with(|| { .or_insert_with(|| {
FigureState::new(renderer, QuadrupedMediumSkeleton::new()) FigureState::new(renderer, QuadrupedMediumSkeleton::new())
@ -634,7 +634,7 @@ impl FigureMgr {
.retain(|entity, _| ecs.entities().is_alive(*entity)); .retain(|entity, _| ecs.entities().is_alive(*entity));
self.quadruped_states self.quadruped_states
.retain(|entity, _| ecs.entities().is_alive(*entity)); .retain(|entity, _| ecs.entities().is_alive(*entity));
self.QuadrupedMedium_states self.quadruped_medium_states
.retain(|entity, _| ecs.entities().is_alive(*entity)); .retain(|entity, _| ecs.entities().is_alive(*entity));
} }
@ -689,7 +689,7 @@ impl FigureMgr {
.get(&entity) .get(&entity)
.map(|state| (state.locals(), state.bone_consts())), .map(|state| (state.locals(), state.bone_consts())),
Body::QuadrupedMedium(_) => self Body::QuadrupedMedium(_) => self
.QuadrupedMedium_states .quadruped_medium_states
.get(&entity) .get(&entity)
.map(|state| (state.locals(), state.bone_consts())), .map(|state| (state.locals(), state.bone_consts())),
} { } {

View File

@ -24,7 +24,7 @@ pub struct Singleplayer {
impl Singleplayer { impl Singleplayer {
pub fn new() -> (Self, SocketAddr) { pub fn new() -> (Self, SocketAddr) {
let (sender, reciever) = channel(); let (sender, receiver) = channel();
let sock = SocketAddr::from(( let sock = SocketAddr::from((
[127, 0, 0, 1], [127, 0, 0, 1],
@ -35,7 +35,7 @@ impl Singleplayer {
let server = Server::bind(sock.clone()).expect("Failed to create server instance!"); let server = Server::bind(sock.clone()).expect("Failed to create server instance!");
let thread = thread::spawn(move || { let thread = thread::spawn(move || {
run_server(server, reciever); run_server(server, receiver);
}); });
( (

View File

@ -315,7 +315,7 @@ impl Ui {
} }
// Primitives still left to draw ingame // Primitives still left to draw ingame
Placement::InWorld(num_prims, res) => match kind { Placement::InWorld(num_prims, res) => match kind {
// Other types don't aren't drawn & shoudn't decrement the number of primitives left to draw ingame // Other types don't aren't drawn & shouldn't decrement the number of primitives left to draw ingame
PrimitiveKind::Other(_) => {} PrimitiveKind::Other(_) => {}
// Decrement the number of primitives left // Decrement the number of primitives left
_ => placement = Placement::InWorld(num_prims - 1, res), _ => placement = Placement::InWorld(num_prims - 1, res),

View File

@ -60,7 +60,7 @@ pub struct IngameParameters {
pub pos: Vec3<f32>, pub pos: Vec3<f32>,
// Number of pixels per 1 unit in world coordinates (ie a voxel) // Number of pixels per 1 unit in world coordinates (ie a voxel)
// Used for widgets that are rasterized before being sent to the gpu (text & images) // Used for widgets that are rasterized before being sent to the gpu (text & images)
// Potentially make this autmatic based on distance to camera? // Potentially make this automatic based on distance to camera?
pub res: f32, pub res: f32,
} }

View File

@ -311,7 +311,7 @@ impl Window {
let mut path = PathBuf::from("./screenshots"); let mut path = PathBuf::from("./screenshots");
if !path.exists() { if !path.exists() {
if let Err(err) = std::fs::create_dir(&path) { if let Err(err) = std::fs::create_dir(&path) {
log::error!("Coudn't create folder for screenshot: {:?}", err); log::error!("Couldn't create folder for screenshot: {:?}", err);
} }
} }
path.push(format!( path.push(format!(
@ -322,11 +322,11 @@ impl Window {
.unwrap_or(0) .unwrap_or(0)
)); ));
if let Err(err) = img.save(&path) { if let Err(err) = img.save(&path) {
log::error!("Coudn't save screenshot: {:?}", err); log::error!("Couldn't save screenshot: {:?}", err);
} }
}); });
} }
Err(err) => log::error!("Coudn't create screenshot due to renderer error: {:?}", err), Err(err) => log::error!("Couldn't create screenshot due to renderer error: {:?}", err),
} }
} }
} }