[][src]Trait tokyo::geom::PointExt

pub trait PointExt {
    fn point(&self) -> &Point;

    fn distance(&self, other: &dyn PointExt) -> f32 { ... }
fn angle_to(&self, other: &dyn PointExt) -> Radian { ... }
fn velocity_to(&self, other: &dyn PointExt, dt: Duration) -> Vector { ... }
fn project(&self, velocity: &Vector, dt: Duration) -> Point { ... } }

Extension methods for the Point type alias.

Required methods

fn point(&self) -> &Point

Loading content...

Provided methods

fn distance(&self, other: &dyn PointExt) -> f32

Returns the distance between this and the given points.

fn angle_to(&self, other: &dyn PointExt) -> Radian

Returns the angle of the line connecting this point to the given point.

fn velocity_to(&self, other: &dyn PointExt, dt: Duration) -> Vector

Returns the velocity at which one travels from this point to the given point for the amount of time dt.

fn project(&self, velocity: &Vector, dt: Duration) -> Point

Returns the projection of this position along the given velocity (pixels-per-second) for the amount of time dt.

Loading content...

Implementors

impl PointExt for Bullet[src]

Bullet struct provides some basic geometry operations through PointExt trait. See the geom mod.

fn distance(&self, other: &dyn PointExt) -> f32[src]

fn angle_to(&self, other: &dyn PointExt) -> Radian[src]

fn velocity_to(&self, other: &dyn PointExt, dt: Duration) -> Vector[src]

fn project(&self, velocity: &Vector, dt: Duration) -> Point[src]

impl PointExt for Player[src]

Player struct provides some basic geometry operations through PointExt trait. See the geom mod.

fn distance(&self, other: &dyn PointExt) -> f32[src]

fn angle_to(&self, other: &dyn PointExt) -> Radian[src]

fn velocity_to(&self, other: &dyn PointExt, dt: Duration) -> Vector[src]

fn project(&self, velocity: &Vector, dt: Duration) -> Point[src]

impl PointExt for Point[src]

fn distance(&self, other: &dyn PointExt) -> f32[src]

fn angle_to(&self, other: &dyn PointExt) -> Radian[src]

fn velocity_to(&self, other: &dyn PointExt, dt: Duration) -> Vector[src]

fn project(&self, velocity: &Vector, dt: Duration) -> Point[src]

Loading content...