[−][src]Trait gdnative::Vector2Godot
Helper methods for Vector2
.
Trait used to provide additional methods that are equivalent to Godot's methods.
See the official Godot documentation
.
Required methods
fn aspect(self) -> f32
Returns the ratio of x to y.
fn cubic_interpolate(self, b: Self, pre_a: Self, post_b: Self, t: f32) -> Self
Cubicly interpolates between this vector and b
using pre_a
and post_b
as handles,
and returns the result at position t
. t
is in the range of 0.0 - 1.0, representing
the amount of interpolation.
fn rotated(self, angle: Angle<f32>) -> Self
Returns the vector rotated by angle
radians.
fn slide(self, normal: Self) -> Self
Returns the component of the vector along a plane defined by the given normal.
fn snapped(self, by: Self) -> Self
Returns the vector snapped to a grid with the given size.
fn tangent(self) -> Self
Returns a perpendicular vector.
Implementations on Foreign Types
impl Vector2Godot for Vector2D<f32, UnknownUnit>
[src]
fn aspect(self) -> f32
[src]
fn cubic_interpolate(
self,
b: Vector2D<f32, UnknownUnit>,
pre_a: Vector2D<f32, UnknownUnit>,
post_b: Vector2D<f32, UnknownUnit>,
t: f32
) -> Vector2D<f32, UnknownUnit>
[src]
self,
b: Vector2D<f32, UnknownUnit>,
pre_a: Vector2D<f32, UnknownUnit>,
post_b: Vector2D<f32, UnknownUnit>,
t: f32
) -> Vector2D<f32, UnknownUnit>