Dragon work 2

This commit is contained in:
Robin Gilh 2020-04-26 01:47:35 +02:00 committed by jshipsey
parent 40360ff149
commit edcde84505
6 changed files with 85 additions and 45 deletions

View File

@ -1,45 +1,45 @@
({
(Reddragon, Male): (
head: (
offset: (-7.0, -9.0, -5.5),
offset: (-4.5, -2.0, -7.5),
center: ("npc.reddragon.male.head"),
),
chest_front: (
offset: (-7.0, 4.5, 5.0),
offset: (-6.5, -6.0, -6.0),
center: ("npc.reddragon.male.chest_front"),
),
chest_rear: (
offset: (-7.0, -4.5, 5.0),
offset: (-6.5, -7.0, -6.0),
center: ("npc.reddragon.male.chest_rear"),
),
tail_front: (
offset: (-7.0, -4.5, -5.0),
offset: (-2.5, -5.5, -3.0),
center: ("npc.reddragon.male.tail_front"),
),
tail_rear: (
offset: (-7.0, -4.5, -5.0),
offset: (-1.5, -7.0, -2.5),
center: ("npc.reddragon.male.tail_rear"),
)
),
(Reddragon, Female): (
head: (
offset: (-7.0, -9.0, -5.5),
offset: (-4.5, -2.0, -7.5),
center: ("npc.reddragon.female.head"),
),
chest_front: (
offset: (-7.0, 4.5, 5.0),
offset: (-6.5, -6.0, -6.0),
center: ("npc.reddragon.female.chest_front"),
),
chest_rear: (
offset: (-7.0, -4.5, 5.0),
offset: (-6.5, -7.0, -6.0),
center: ("npc.reddragon.female.chest_rear"),
),
tail_front: (
offset: (-7.0, -4.5, -5.0),
offset: (-2.5, -5.5, -3.0),
center: ("npc.reddragon.female.tail_front"),
),
tail_rear: (
offset: (-7.0, -4.5, -5.0),
offset: (-1.5, -7.0, -2.5),
center: ("npc.reddragon.female.tail_rear"),
)
),

View File

@ -1,35 +1,35 @@
({
(Reddragon, Male): (
wing_in_l: (
offset: (20.0, 20.0, 5.0),
offset: (-0.5, -3.5, -27.0),
lateral: ("npc.reddragon.male.wing_in_l"),
),
wing_in_r: (
offset: (20.0, 20.0, 5.0),
offset: (-0.5, -3.5, -27.0),
lateral: ("npc.reddragon.male.wing_in_r"),
),
wing_out_l: (
offset: (20.0, 20.0, 5.0),
offset: (-0.5, -3.5, -27.0),
lateral: ("npc.reddragon.male.wing_out_l"),
),
wing_out_r: (
offset: (20.0, 20.0, 5.0),
offset: (-0.5, -3.5, -27.0),
lateral: ("npc.reddragon.male.wing_out_r"),
),
foot_fl: (
offset: (-2.5, -4.0, -1.5),
offset: (-2.5, 0.0, -6.0),
lateral: ("npc.reddragon.male.foot_fl"),
),
foot_fr: (
offset: (-2.5, -4.0, -1.5),
offset: (-2.5, 0.0, -6.0),
lateral: ("npc.reddragon.male.foot_fr"),
),
foot_bl: (
offset: (-2.5, -4.0, -3.0),
offset: (-2.5, 0.0, -7.0),
lateral: ("npc.reddragon.male.foot_bl"),
),
foot_br: (
offset: (-2.5, -4.0, -3.0),
offset: (-2.5, 0.0, -7.0),
lateral: ("npc.reddragon.male.foot_br"),
)
),

View File

@ -1,7 +1,6 @@
use super::{super::Animation, DragonSkeleton, SkeletonAttr};
//use std::{f32::consts::PI, ops::Mul};
use vek::*;
pub struct IdleAnimation;
impl Animation for IdleAnimation {
@ -17,55 +16,96 @@ impl Animation for IdleAnimation {
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
next.head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.head.scale = Vec3::one() / 10.88;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const HEAD_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const HEAD_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const CHEST_F_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const CHEST_F_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const CHEST_R_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const CHEST_R_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const TAIL_F_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const TAIL_F_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const TAIL_R_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const TAIL_R_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const WING_IN_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const WING_IN_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const WING_OUT_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const WING_OUT_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const FEET_F_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const FEET_F_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const FEET_F_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const FEET_B_X: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const FEET_B_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)]
const FEET_B_Z: f32 = 0.0;
next.chest_front.offset = Vec3::new(0.0, 4.5, 2.0);
next.head.offset = Vec3::new(0.0, *HEAD_X, *HEAD_Z);
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.head.scale = Vec3::one() * 1.01;
next.chest_front.offset = Vec3::new(0.0, *CHEST_F_X, *CHEST_F_Z);
next.chest_front.ori = Quaternion::rotation_x(0.0);
next.chest_front.scale = Vec3::one() * 1.01;
next.chest_rear.offset = Vec3::new(0.0, 4.5, 2.0);
next.chest_rear.offset = Vec3::new(0.0, *CHEST_R_X, *CHEST_R_Z);
next.chest_rear.ori = Quaternion::rotation_x(0.0);
next.chest_rear.scale = Vec3::one() * 1.01;
next.tail_front.offset = Vec3::new(0.0, 4.5, 2.0);
next.tail_front.offset = Vec3::new(0.0, *TAIL_F_X, *TAIL_F_Z);
next.tail_front.ori = Quaternion::rotation_x(0.0);
next.tail_front.scale = Vec3::one() * 1.01;
next.tail_rear.offset = Vec3::new(0.0, 4.5, 2.0);
next.tail_rear.offset = Vec3::new(0.0, *TAIL_R_X, *TAIL_R_Z);
next.tail_rear.ori = Quaternion::rotation_x(0.0);
next.tail_rear.scale = Vec3::one() * 1.01;
next.wing_in_l.offset = Vec3::new(0.0, 4.5, 2.0);
next.wing_in_l.offset = Vec3::new(0.0, *WING_IN_X, *WING_IN_Z);
next.wing_in_l.ori = Quaternion::rotation_x(0.0);
next.wing_in_l.scale = Vec3::one() * 1.01;
next.wing_in_r.offset = Vec3::new(0.0, 4.5, 2.0);
next.wing_in_r.offset = Vec3::new(0.0, *WING_IN_X, *WING_IN_Z);
next.wing_in_r.ori = Quaternion::rotation_x(0.0);
next.wing_in_r.scale = Vec3::one() * 1.01;
next.wing_out_l.offset = Vec3::new(0.0, 4.5, 2.0);
next.wing_out_l.offset = Vec3::new(0.0, *WING_OUT_X, *WING_OUT_Z);
next.wing_out_l.ori = Quaternion::rotation_x(0.0);
next.wing_out_l.scale = Vec3::one() * 1.01;
next.wing_out_r.offset = Vec3::new(0.0, 4.5, 2.0);
next.wing_out_r.offset = Vec3::new(0.0, *WING_OUT_X, *WING_OUT_Z);
next.wing_out_r.ori = Quaternion::rotation_x(0.0);
next.wing_out_r.scale = Vec3::one() * 1.01;
next.foot_fl.offset = Vec3::new(0.0, 4.5, 2.0);
next.foot_fl.offset = Vec3::new(*FEET_F_X, *FEET_F_Y, *FEET_F_Z);
next.foot_fl.ori = Quaternion::rotation_x(0.0);
next.foot_fl.scale = Vec3::one() * 1.01;
next.foot_fr.offset = Vec3::new(0.0, 4.5, 2.0);
next.foot_fr.offset = Vec3::new(*FEET_F_X, *FEET_F_Y, *FEET_F_Z);
next.foot_fr.ori = Quaternion::rotation_x(0.0);
next.foot_fr.scale = Vec3::one() * 1.01;
next.foot_bl.offset = Vec3::new(0.0, 4.5, 2.0);
next.foot_bl.offset = Vec3::new(*FEET_F_X, *FEET_B_Y, *FEET_B_Z);
next.foot_bl.ori = Quaternion::rotation_x(0.0);
next.foot_bl.scale = Vec3::one() * 1.01;
next.foot_br.offset = Vec3::new(0.0, 4.5, 2.0);
next.foot_br.offset = Vec3::new(*FEET_F_X, *FEET_B_Y, *FEET_B_Z);
next.foot_br.ori = Quaternion::rotation_x(0.0);
next.foot_br.scale = Vec3::one() * 1.01;
next

View File

@ -19,7 +19,7 @@ impl Animation for JumpAnimation {
next.head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.head.scale = Vec3::one() / 10.88;
next.head.scale = Vec3::one() * 1.01;
next.chest_front.offset = Vec3::new(0.0, 4.5, 2.0);
next.chest_front.ori = Quaternion::rotation_x(0.0);

View File

@ -126,31 +126,31 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr {
use comp::dragon::Species::*;
Self {
head: match (body.species, body.body_type) {
(Reddragon, _) => (4.0, 3.0),
(Reddragon, _) => (0.0, 0.0),
},
chest_front: match (body.species, body.body_type) {
(Reddragon, _) => (0.0, 5.0),
(Reddragon, _) => (0.0, 0.0),
},
chest_rear: match (body.species, body.body_type) {
(Reddragon, _) => (0.0, 5.0),
(Reddragon, _) => (0.0, 0.0),
},
tail_front: match (body.species, body.body_type) {
(Reddragon, _) => (-3.0, 1.5),
(Reddragon, _) => (0.0, 0.0),
},
tail_rear: match (body.species, body.body_type) {
(Reddragon, _) => (-3.0, 1.5),
(Reddragon, _) => (0.0, 0.0),
},
wing_in: match (body.species, body.body_type) {
(Reddragon, _) => (2.75, 0.0),
(Reddragon, _) => (0.0, 0.0),
},
wing_out: match (body.species, body.body_type) {
(Reddragon, _) => (2.75, 0.0),
(Reddragon, _) => (0.0, 0.0),
},
feet_f: match (body.species, body.body_type) {
(Reddragon, _) => (2.0, -1.5, 4.0),
(Reddragon, _) => (0.0, 0.0, 0.0),
},
feet_b: match (body.species, body.body_type) {
(Reddragon, _) => (2.0, -1.5, 4.0),
(Reddragon, _) => (0.0, 0.0, 0.0),
},
}
}

View File

@ -19,7 +19,7 @@ impl Animation for RunAnimation {
next.head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.head.scale = Vec3::one() / 10.88;
next.head.scale = Vec3::one() * 1.01;
next.chest_front.offset = Vec3::new(0.0, 4.5, 2.0);
next.chest_front.ori = Quaternion::rotation_x(0.0);