Struct batbox_lapp::Ellipse

source ·
pub struct Ellipse<T> {
    pub transform: mat3<T>,
}
Expand description

Fields§

§transform: mat3<T>

Transformation from a unit

Implementations§

source§

impl<T: Float> Ellipse<T>

source

pub fn new(center: vec2<T>, half_size: vec2<T>) -> Self

Create a new ellipse with given center and given half size

source

pub fn circle(center: vec2<T>, radius: T) -> Self

Create a circle with given center and radius

source

pub fn unit() -> Self

Create a unit ellipse - a circle with center at (0, 0) and radius of 1

Trait Implementations§

source§

impl<T: Float> FitTarget2d<T> for Ellipse<T>

source§

fn make_fit(&self, object: &mut impl Transform2d<T>)

Make given object’s bounding Quad fit into self
source§

impl<T: Float> Transform2d<T> for Ellipse<T>

source§

fn bounding_quad(&self) -> Quad<T>

Object’s bounding Quad
source§

fn apply_transform(&mut self, transform: mat3<T>)

Apply transformation matrix to this object

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Ellipse<T>
where T: RefUnwindSafe,

§

impl<T> Send for Ellipse<T>
where T: Send,

§

impl<T> Sync for Ellipse<T>
where T: Sync,

§

impl<T> Unpin for Ellipse<T>
where T: Unpin,

§

impl<T> UnwindSafe for Ellipse<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<F, T> Transform2dExt<F> for T
where F: Float, T: Transform2d<F> + ?Sized,

source§

fn transform(self, transform: mat3<F>) -> Self
where Self: Sized,

Apply transformation to the object, returning a modified value to allow chaining methods
source§

fn align_bounding_box(self, alignment: vec2<F>) -> Self
where Self: Sized,

Align bounding box of this object, making its origin located at (0, 0) Read more
source§

fn rotate(self, angle: Angle<F>) -> Self
where Self: Sized,

Rotate object around (0, 0) by given angle
source§

fn translate(self, delta: vec2<F>) -> Self
where Self: Sized,

Translate object by given vector
source§

fn scale(self, factor: vec2<F>) -> Self
where Self: Sized,

Scale object around (0, 0) by given factor
source§

fn scale_uniform(self, factor: F) -> Self
where Self: Sized,

Scale object around (0, 0) by given factor uniformly along both axis
source§

fn transformed(&self) -> Transformed2d<'_, F, Self>

Create a reference to this object with additional transformation applied
source§

fn bounding_box(&self) -> Aabb2<F>

Calculate bounding box of this object, getting Aabb2 instead of a Quad
source§

fn fit_into(self, target: impl FitTarget2d<F>) -> Self
where Self: Sized,

Make this object’s bounding Quad fit into given target
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V