aboutsummaryrefslogtreecommitdiff
path: root/evc/src/vec2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'evc/src/vec2.rs')
-rw-r--r--evc/src/vec2.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/evc/src/vec2.rs b/evc/src/vec2.rs
index ffee124..b1dd1b4 100644
--- a/evc/src/vec2.rs
+++ b/evc/src/vec2.rs
@@ -7,6 +7,12 @@ pub struct Vec2 {
}
impl Vec2 {
pub const ZERO: Vec2 = Vec2 { x: 0, y: 0 };
+ pub fn downscale(&self, f: isize) -> Self {
+ Self {
+ x: self.x / f,
+ y: self.y / f,
+ }
+ }
}
impl Ser for Vec2 {