Trait word_cloud::collision::CollisionStrategy

source ·
pub trait CollisionStrategy {
    // Required methods
    fn collides(&self, pos: Vector, r: &Rectangle) -> bool;
    fn add(&mut self, pos: Vector, r: Rectangle);
}
Expand description

Struct implementing this trait can detect rectangles collisions.

Required Methods§

source

fn collides(&self, pos: Vector, r: &Rectangle) -> bool

Does the given rectangle at the given position collide with an already added rectangle?

source

fn add(&mut self, pos: Vector, r: Rectangle)

Add the given rectangle at the given position to the list of rectangles to detect collisions with.

Implementors§