#[repr(C)]pub struct Segment {
pub point1: Vec2,
pub point2: Vec2,
}Expand description
Line segment geometry in local shape space.
Fields§
§point1: Vec2§point2: Vec2Implementations§
Source§impl Segment
impl Segment
pub fn new<P1: Into<Vec2>, P2: Into<Vec2>>(point1: P1, point2: P2) -> Self
Sourcepub fn is_valid(self) -> bool
pub fn is_valid(self) -> bool
Validate this segment for safe Box2D shape and standalone collision use.
Sourcepub fn validate(self) -> ApiResult<()>
pub fn validate(self) -> ApiResult<()>
Validate this segment for safe Box2D shape and standalone collision use.
pub fn aabb(self, transform: Transform) -> Aabb
pub fn try_aabb(self, transform: Transform) -> ApiResult<Aabb>
pub fn ray_cast<VO: Into<Vec2>, VT: Into<Vec2>>( self, origin: VO, translation: VT, one_sided: bool, ) -> CastOutput
pub fn try_ray_cast<VO: Into<Vec2>, VT: Into<Vec2>>( self, origin: VO, translation: VT, one_sided: bool, ) -> ApiResult<CastOutput>
Trait Implementations§
impl Copy for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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