pub struct BallCollisionPlane {
pub normal: Vec3,
pub distance_from_origin: f32,
pub bounds: Option<BallCollisionPlaneBounds>,
}Fields§
§normal: Vec3Unit normal pointing into the playable half-space.
distance_from_origin: f32Plane constant in normal.dot(position) == distance_from_origin form.
bounds: Option<BallCollisionPlaneBounds>Optional axis-aligned bounds for finite wall sections. Bounds apply to the ball center at the impact point, not to the mesh contact point.
Implementations§
Source§impl BallCollisionPlane
impl BallCollisionPlane
pub fn new(normal: Vec3, distance_from_origin: f32) -> Option<Self>
pub const fn from_unit_normal(normal: Vec3, distance_from_origin: f32) -> Self
pub const fn with_bounds(self, bounds: BallCollisionPlaneBounds) -> Self
pub fn contains_impact_point(self, position: Vec3) -> bool
pub const fn standard_ground() -> Self
pub const fn standard_positive_x_wall() -> Self
pub const fn standard_negative_x_wall() -> Self
pub const fn standard_positive_y_wall() -> Self
pub const fn standard_negative_y_wall() -> Self
pub const fn standard_ceiling() -> Self
pub const fn standard_ground_bounded() -> Self
pub const fn standard_positive_x_wall_bounded() -> Self
pub const fn standard_negative_x_wall_bounded() -> Self
pub const fn standard_ceiling_bounded() -> Self
pub const fn standard_positive_y_wall_left_bounded() -> Self
pub const fn standard_positive_y_wall_right_bounded() -> Self
pub const fn standard_positive_y_wall_above_goal_bounded() -> Self
pub const fn standard_negative_y_wall_left_bounded() -> Self
pub const fn standard_negative_y_wall_right_bounded() -> Self
pub const fn standard_negative_y_wall_above_goal_bounded() -> Self
pub fn center_distance(self, position: Vec3) -> f32
pub fn penetration_depth(self, position: Vec3, radius: f32) -> f32
Trait Implementations§
Source§impl Clone for BallCollisionPlane
impl Clone for BallCollisionPlane
Source§fn clone(&self) -> BallCollisionPlane
fn clone(&self) -> BallCollisionPlane
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BallCollisionPlane
Source§impl Debug for BallCollisionPlane
impl Debug for BallCollisionPlane
Source§impl From<BallCollisionPlane> for BallCollisionSurface
impl From<BallCollisionPlane> for BallCollisionSurface
Source§fn from(plane: BallCollisionPlane) -> Self
fn from(plane: BallCollisionPlane) -> Self
Converts to this type from the input type.
Source§impl PartialEq for BallCollisionPlane
impl PartialEq for BallCollisionPlane
Source§fn eq(&self, other: &BallCollisionPlane) -> bool
fn eq(&self, other: &BallCollisionPlane) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BallCollisionPlane
Auto Trait Implementations§
impl Freeze for BallCollisionPlane
impl RefUnwindSafe for BallCollisionPlane
impl Send for BallCollisionPlane
impl Sync for BallCollisionPlane
impl Unpin for BallCollisionPlane
impl UnsafeUnpin for BallCollisionPlane
impl UnwindSafe for BallCollisionPlane
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