[−][src]Trait gdnative::Point2Godot
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>
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.
Implementations on Foreign Types
impl Point2Godot for Point2D<f32, UnknownUnit>
[src]
fn angle_to_point(self, other: Point2D<f32, UnknownUnit>) -> Angle<f32>
[src]
fn direction_to(
self,
other: Point2D<f32, UnknownUnit>
) -> Vector2D<f32, UnknownUnit>
[src]
self,
other: Point2D<f32, UnknownUnit>
) -> Vector2D<f32, UnknownUnit>