pub struct Line {
pub id: i64,
pub ends: (LinePoint, LinePoint),
pub line_type: LineType,
pub flipped: bool,
/* private fields */
}
Fields§
§id: i64
§ends: (LinePoint, LinePoint)
§line_type: LineType
§flipped: bool
Implementations§
Source§impl Line
impl Line
pub fn builder() -> LineBuilder
pub fn as_vector2d(&self) -> Vector2D
pub fn length_squared(&self) -> f64
Sourcepub fn perpendicular(&self) -> Vector2D
pub fn perpendicular(&self) -> Vector2D
Returns the perpendicular unit vector for this line, facing “upwards” (the direction in which it applies force).
pub fn hitbox_extensions(&self) -> (f64, f64)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Line
impl<'de> Deserialize<'de> for Line
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Line
impl Ord for Line
Source§impl PartialOrd for Line
impl PartialOrd for Line
impl Copy for Line
impl Eq for Line
Auto Trait Implementations§
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnwindSafe for Line
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more