Trait avian3d::math::RecipOrZero

source ·
pub trait RecipOrZero {
    // Required method
    fn recip_or_zero(self) -> Self;
}
Expand description

An extension trait for computing reciprocals without division by zero.

Required Methods§

source

fn recip_or_zero(self) -> Self

Computes the reciprocal of self if self is not zero, and returns zero otherwise to avoid division by zero.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl RecipOrZero for f32

source§

fn recip_or_zero(self) -> Self

source§

impl RecipOrZero for f64

source§

fn recip_or_zero(self) -> Self

source§

impl RecipOrZero for Vec2

source§

fn recip_or_zero(self) -> Self

source§

impl RecipOrZero for Vec3

source§

fn recip_or_zero(self) -> Self

source§

impl RecipOrZero for DVec2

source§

fn recip_or_zero(self) -> Self

source§

impl RecipOrZero for DVec3

source§

fn recip_or_zero(self) -> Self

Implementors§