mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
make vec2 make more sense
This commit is contained in:
parent
57bf7cfdac
commit
5361b290df
@ -1390,7 +1390,7 @@ impl Structure for Tavern {
|
||||
},
|
||||
(true, true) => {
|
||||
painter.sprite(
|
||||
dir.vec2(edge, rot_edge).with_z(room.bounds.min.z),
|
||||
dir.abs().vec2(edge, rot_edge).with_z(room.bounds.min.z),
|
||||
SpriteKind::CookingPot,
|
||||
);
|
||||
},
|
||||
|
@ -110,12 +110,14 @@ impl Dir {
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a vec2 where x is in the direction of `self`, and y is anti
|
||||
/// clockwise of `self`.
|
||||
pub fn vec2(self, x: i32, y: i32) -> Vec2<i32> {
|
||||
match self {
|
||||
Dir::X => Vec2::new(x, y),
|
||||
Dir::NegX => Vec2::new(x, y),
|
||||
Dir::NegX => Vec2::new(-x, -y),
|
||||
Dir::Y => Vec2::new(y, x),
|
||||
Dir::NegY => Vec2::new(y, x),
|
||||
Dir::NegY => Vec2::new(-y, -x),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user