Struct bevy_math::primitives::Segment3d
source · pub struct Segment3d {
pub direction: Direction3d,
pub half_length: f32,
}
Expand description
A segment of a line along a direction in 3D space.
Fields§
§direction: Direction3d
The direction of the line
half_length: f32
Half the length of the line segment. The segment extends by this amount in both the given direction and its opposite direction
Implementations§
source§impl Segment3d
impl Segment3d
sourcepub fn new(direction: Direction3d, length: f32) -> Self
pub fn new(direction: Direction3d, length: f32) -> Self
Create a new Segment3d
from a direction and full length of the segment
Trait Implementations§
source§impl Bounded3d for Segment3d
impl Bounded3d for Segment3d
source§fn aabb_3d(&self, translation: Vec3, rotation: Quat) -> Aabb3d
fn aabb_3d(&self, translation: Vec3, rotation: Quat) -> Aabb3d
Get an axis-aligned bounding box for the shape with the given translation and rotation
source§fn bounding_sphere(&self, translation: Vec3, _rotation: Quat) -> BoundingSphere
fn bounding_sphere(&self, translation: Vec3, _rotation: Quat) -> BoundingSphere
Get a bounding sphere for the shape with the given translation and rotation
source§impl<'de> Deserialize<'de> for Segment3d
impl<'de> Deserialize<'de> for Segment3d
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 PartialEq for Segment3d
impl PartialEq for Segment3d
impl Copy for Segment3d
impl Primitive3d for Segment3d
impl StructuralPartialEq for Segment3d
Auto Trait Implementations§
impl RefUnwindSafe for Segment3d
impl Send for Segment3d
impl Sync for Segment3d
impl Unpin for Segment3d
impl UnwindSafe for Segment3d
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