Struct collider::geom::DirVec2 [] [src]

pub struct DirVec2 { /* fields omitted */ }

A 2-D vector that separates direction from length.

This may be used rather than Vec2 if the length may be at or near 0.0 but the direction is still important, or to distinguish between a vector with a negative length and a vector in the opposite direction of positive length. Such distinctions are necessary when describing the normal distance between PlacedShapes.

Methods

impl DirVec2
[src]

[src]

Constructs a vector with the given direction dir and length len.

dir is normalized before being set.

[src]

Returns the direction as a unit vector.

[src]

Returns the length of the vector. May be positive or negative.

[src]

Returns a new vector with the same len but reversed dir.

Trait Implementations

impl PartialEq for DirVec2
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Copy for DirVec2
[src]

impl Clone for DirVec2
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for DirVec2
[src]

[src]

Formats the value using the given formatter. Read more

impl From<DirVec2> for Vec2
[src]

[src]

Performs the conversion.

Auto Trait Implementations

impl Send for DirVec2

impl Sync for DirVec2