pub struct Disk<P, E> {
pub center: Vec2<P>,
pub radius: E,
}
Expand description
Disk (2D), represented by center and radius.
Fields§
§center: Vec2<P>
§radius: E
Implementations§
source§impl<P, E> Disk<P, E>
impl<P, E> Disk<P, E>
sourcepub fn circumference(self) -> Ewhere
E: Copy + FloatConst + Mul<Output = E> + Add<Output = E>,
pub fn circumference(self) -> Ewhere
E: Copy + FloatConst + Mul<Output = E> + Add<Output = E>,
Gets this disk’s circumference.
sourcepub fn area(self) -> Ewhere
E: Copy + FloatConst + Mul<Output = E>,
pub fn area(self) -> Ewhere
E: Copy + FloatConst + Mul<Output = E>,
Gets this disk’s area.
source§impl<P, E> Disk<P, E>
impl<P, E> Disk<P, E>
source§impl<T: Real + Add<T, Output = T>> Disk<T, T>
impl<T: Real + Add<T, Output = T>> Disk<T, T>
sourcepub fn contains_point(self, p: Vec2<T>) -> boolwhere
T: PartialOrd,
pub fn contains_point(self, p: Vec2<T>) -> boolwhere
T: PartialOrd,
Does this shape contain the given point ?
sourcepub fn collides_with_disk(self, other: Self) -> boolwhere
T: PartialOrd,
pub fn collides_with_disk(self, other: Self) -> boolwhere
T: PartialOrd,
Does this shape collide with another ?
sourcepub fn collision_vector_with_disk(self, other: Self) -> Vec2<T>
pub fn collision_vector_with_disk(self, other: Self) -> Vec2<T>
Gets a vector that tells how much this shape penetrates another.
Trait Implementations§
source§impl<'de, P, E> Deserialize<'de> for Disk<P, E>where
P: Deserialize<'de>,
E: Deserialize<'de>,
impl<'de, P, E> Deserialize<'de> for Disk<P, E>where
P: Deserialize<'de>,
E: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more