Skip to main content

Line

Struct Line 

Source
pub struct Line {
    pub origin: Vec3,
    pub dir: Vec3,
    /* private fields */
}
Expand description

An infinite line: origin + t * dir for all t ∈ (-∞, ∞).

Fields§

§origin: Vec3§dir: Vec3

Implementations§

Source§

impl Line

Source

pub fn new(origin: Vec3, dir: Vec3) -> Self

Source

pub fn from_points(a: Vec3, b: Vec3) -> Self

Source§

impl Line

Source

pub fn scale(&mut self, factor: f32)

Source§

impl Line

Source

pub fn translate(&mut self, offset: Vec3A)

Source

pub fn rotate_mat(&mut self, mat: Mat3A)

Source

pub fn rotate_quat(&mut self, quat: Quat)

Source

pub fn transform(&mut self, mat: Affine3A)

Trait Implementations§

Source§

impl Clone for Line

Source§

fn clone(&self) -> Line

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<PCL: PointCloudMarker> ColliderComponent<PCL> for Line

Source§

fn add_to_shapes(self, c: &mut Collider<PCL>)

Source§

impl ColliderQuery<NoPcl> for Line

Source§

impl ColliderQuery<Pointcloud> for Line

Source§

impl<const P: usize, const V: usize> Collides<ArrayConvexPolytope<P, V>> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Capsule> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<ConvexPolygon> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<ConvexPolytope> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Cuboid> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Cylinder> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl<const P: usize, const V: usize> Collides<Line> for ArrayConvexPolytope<P, V>

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Capsule

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for ConvexPolygon

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for ConvexPolytope

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Cuboid

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Cylinder

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for LineSegment

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for NoPcl

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Plane

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Point

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Pointcloud

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Ray

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Line> for Sphere

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<LineSegment> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<NoPcl> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Plane> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Point> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Pointcloud> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Ray> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Collides<Sphere> for Line

Source§

fn collides(&self, other: &T) -> bool

Collision test (broadphase + narrowphase).
Source§

impl Debug for Line

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Line

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Line

Source§

fn eq(&self, other: &Line) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Scalable for Line

Source§

fn scale(&mut self, factor: f32)

Scales the shape by the given factor, in-place. Read more
Source§

fn scaled(self, factor: f32) -> Self

Returns a scaled copy of the shape. Read more
Source§

fn scale_d(&mut self, factor: f64)

Source§

fn scaled_d(self, factor: f64) -> Self

Source§

impl Stretchable for Line

Source§

type Output = LineStretch

Source§

fn stretch(&self, translation: Vec3) -> Self::Output

Source§

fn stretch_d(&self, translation: DVec3) -> Self::Output

Source§

impl Transformable for Line

Source§

fn translate(&mut self, offset: Vec3A)

Source§

fn rotate_mat(&mut self, mat: Mat3A)

Source§

fn rotate_quat(&mut self, quat: Quat)

Source§

fn transform(&mut self, mat: Affine3A)

Source§

fn translated(self, offset: Vec3A) -> Self

Source§

fn translate_d(&mut self, offset: DVec3)

Source§

fn translated_d(self, offset: DVec3) -> Self

Source§

fn rotated_mat(self, mat: Mat3A) -> Self

Source§

fn rotate_mat_d(&mut self, mat: DMat3)

Source§

fn rotated_mat_d(self, mat: DMat3) -> Self

Source§

fn rotated_quat(self, quat: Quat) -> Self

Source§

fn rotate_quat_d(&mut self, quat: DQuat)

Source§

fn rotated_quat_d(self, quat: DQuat) -> Self

Source§

fn transformed(self, mat: Affine3A) -> Self

Source§

fn transform_d(&mut self, mat: DAffine3)

Source§

fn transformed_d(self, mat: DAffine3) -> Self

Source§

impl Copy for Line

Source§

impl StructuralPartialEq 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 UnsafeUnpin for Line

§

impl UnwindSafe for Line

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.