Struct bevy_spatial::point::Point2
source · pub struct Point2 {
pub vec: Vec2,
pub entity: Option<Entity>,
}Expand description
Newtype over bevy/glam vectors, needed to allow implementing foreign spatial datastructure traits.
Fields§
§vec: Vec2The vector of this Point
entity: Option<Entity>The Entity associated with this Point
Trait Implementations§
source§impl PartialEq<Point2> for Point2
impl PartialEq<Point2> for Point2
source§impl SpatialPoint for Point2
impl SpatialPoint for Point2
§type Dimension = UInt<UInt<UTerm, B1>, B0>
type Dimension = UInt<UInt<UTerm, B1>, B0>
The dimension of this vector, like
typenum::U2 typenum::U3source§fn at(&self, nth: usize) -> Self::Scalar
fn at(&self, nth: usize) -> Self::Scalar
Get the value at this index.
Used for datastructure specific implementations. Read more
source§fn distance_squared(&self, other: &Self) -> Self::Scalar
fn distance_squared(&self, other: &Self) -> Self::Scalar
Get the squared distance of this point to another point of the same type.
source§fn min_point(&self, other: &Self) -> Self::Vec
fn min_point(&self, other: &Self) -> Self::Vec
Get the elementwise minimum between this and another point
impl Copy for Point2
impl StructuralPartialEq for Point2
Auto Trait Implementations§
impl RefUnwindSafe for Point2
impl Send for Point2
impl Sync for Point2
impl Unpin for Point2
impl UnwindSafe for Point2
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self using data from the given [World]