pub struct StaticTriangle {
pub points: [Vec3; 3],
pub ca: Vec3,
pub ba: Vec3,
pub ca_dot_ca: f32,
pub ca_dot_ba: f32,
pub ba_dot_ba: f32,
pub inv_denom: f32,
pub plane: Plane,
}Fields§
§points: [Vec3; 3]§ca: Vec3§ba: Vec3§ca_dot_ca: f32§ca_dot_ba: f32§ba_dot_ba: f32§inv_denom: f32§plane: PlaneImplementations§
Source§impl StaticTriangle
impl StaticTriangle
Sourcepub fn from_points(a: &Vec3, b: &Vec3, c: &Vec3) -> Option<StaticTriangle>
pub fn from_points(a: &Vec3, b: &Vec3, c: &Vec3) -> Option<StaticTriangle>
Creates static triangle from tree points and precomputes some data to speedup collision detection in runtime. This function may fail if degenerated triangle was passed into.
Sourcepub fn contains_point(&self, p: Vec3) -> bool
pub fn contains_point(&self, p: Vec3) -> bool
Checks if point lies inside or at edge of triangle. Uses a lot of precomputed data.
Trait Implementations§
Source§impl Clone for StaticTriangle
impl Clone for StaticTriangle
Source§fn clone(&self) -> StaticTriangle
fn clone(&self) -> StaticTriangle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StaticTriangle
impl Debug for StaticTriangle
Source§impl Default for StaticTriangle
impl Default for StaticTriangle
Source§impl Visit for StaticTriangle
impl Visit for StaticTriangle
Auto Trait Implementations§
impl Freeze for StaticTriangle
impl RefUnwindSafe for StaticTriangle
impl Send for StaticTriangle
impl Sync for StaticTriangle
impl Unpin for StaticTriangle
impl UnwindSafe for StaticTriangle
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