[][src]Trait gdnative_bindings::Point2Godot

pub trait Point2Godot {
    fn angle_to_point(self, other: Point2D<f32, UnknownUnit>) -> Angle<f32>;
fn direction_to(
        self,
        other: Point2D<f32, UnknownUnit>
    ) -> Vector2D<f32, UnknownUnit>;
fn distance_to(self, other: Point2D<f32, UnknownUnit>) -> f32;
fn distance_squared_to(self, other: Point2D<f32, UnknownUnit>) -> f32; }

Helper methods for Point2.

Trait used to provide additional methods that are equivalent to Godot's methods. See the official Godot documentation.

Required methods

fn angle_to_point(self, other: Point2D<f32, UnknownUnit>) -> Angle<f32>

Returns the angle in radians between the line connecting the two points and the x coordinate.

fn direction_to(
    self,
    other: Point2D<f32, UnknownUnit>
) -> Vector2D<f32, UnknownUnit>

Returns the normalized vector pointing from this point to other.

fn distance_to(self, other: Point2D<f32, UnknownUnit>) -> f32

Returns the distance to other.

fn distance_squared_to(self, other: Point2D<f32, UnknownUnit>) -> f32

Returns the squared distance to other. Prefer this function over distance_to if you need to sort points or need the squared distance for some formula.

Loading content...

Implementations on Foreign Types

impl Point2Godot for Point2D<f32, UnknownUnit>[src]

Loading content...

Implementors

Loading content...