pub struct Plane3D {
pub vector: Vector3D,
pub d: f32,
}Expand description
3D plane.
Fields§
§vector: Vector3DVector for the plane.
d: f32Distance/offset value.
Implementations§
Source§impl Plane3D
impl Plane3D
Sourcepub fn intersect(&self, point_a: Point3D, point_b: Point3D) -> Option<Point3D>
pub fn intersect(&self, point_a: Point3D, point_b: Point3D) -> Option<Point3D>
Check if a line made up of point_a and point_b intersect the plane. If so, return the intersection.
Sourcepub fn from_vector_distance(vector: Vector3D, distance: f32) -> Self
pub fn from_vector_distance(vector: Vector3D, distance: f32) -> Self
Create a Plane from a vector and distance.
Trait Implementations§
Source§impl TagSerialize for Plane3D
impl TagSerialize for Plane3D
Source§fn into_tag(
&self,
data: &mut Vec<u8>,
at: usize,
struct_end: usize,
) -> ErrorMessageResult<()>
fn into_tag( &self, data: &mut Vec<u8>, at: usize, struct_end: usize, ) -> ErrorMessageResult<()>
Serialize the data into tag format, returning an error on failure (except for out-of-bounds and allocation errors which will panic).
Source§fn from_tag(
data: &[u8],
at: usize,
struct_end: usize,
_: &mut usize,
) -> ErrorMessageResult<Self>
fn from_tag( data: &[u8], at: usize, struct_end: usize, _: &mut usize, ) -> ErrorMessageResult<Self>
Deserialize the data from tag format, returning an error on failure (except for allocation errors which will panic).
Source§fn into_tag_cached(
&self,
data: &mut [u8],
at: usize,
struct_end: usize,
) -> ErrorMessageResult<()>where
Self: Sized,
fn into_tag_cached(
&self,
data: &mut [u8],
at: usize,
struct_end: usize,
) -> ErrorMessageResult<()>where
Self: Sized,
Serialize the data into tag format in little endian, returning an error on failure (except for out-of-bounds and allocation errors which will panic).
Source§fn from_tag_cached(
data: &[u8],
at: usize,
struct_end: usize,
) -> ErrorMessageResult<Self>where
Self: Sized,
fn from_tag_cached(
data: &[u8],
at: usize,
struct_end: usize,
) -> ErrorMessageResult<Self>where
Self: Sized,
Deserialize the data from tag format from little endian, returning an error on failure (except for allocation errors which will panic).
impl Copy for Plane3D
impl StructuralPartialEq for Plane3D
Auto Trait Implementations§
impl Freeze for Plane3D
impl RefUnwindSafe for Plane3D
impl Send for Plane3D
impl Sync for Plane3D
impl Unpin for Plane3D
impl UnwindSafe for Plane3D
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