1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Add a fractal clock example to showcase painting performance

This commit is contained in:
Emil Ernerfeldt
2020-05-11 20:21:24 +02:00
parent 5a9e3d62bf
commit 71154edf9b
21 changed files with 425 additions and 37 deletions

View File

@@ -65,6 +65,16 @@ impl Vec2 {
vec2(angle.cos(), angle.sin())
}
/// Use this vector as a rotor, rotating something else.
/// Example: Vec2::angled(angle).rotate_other(some_vec)
#[must_use]
pub fn rotate_other(self, v: Vec2) -> Self {
Self {
x: v.x * self.x + v.y * -self.y,
y: v.x * self.y + v.y * self.x,
}
}
#[must_use]
pub fn floor(self) -> Self {
vec2(self.x.floor(), self.y.floor())