Trait gdnative_core::core_types::point2::Point2Godot[][src]

pub trait Point2Godot {
    fn angle_to_point(self, other: Point2) -> Angle;
fn direction_to(self, other: Point2) -> Vector2;
fn distance_to(self, other: Point2) -> f32;
fn distance_squared_to(self, other: Point2) -> 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: Point2) -> Angle[src]

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

fn direction_to(self, other: Point2) -> Vector2[src]

Returns the normalized vector pointing from this point to other.

fn distance_to(self, other: Point2) -> f32[src]

Returns the distance to other.

fn distance_squared_to(self, other: Point2) -> f32[src]

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...

Implementors

impl Point2Godot for Point2[src]

Loading content...