Struct rhusics_core::collide2d::Rectangle [−][src]
pub struct Rectangle<S> { /* fields omitted */ }
Rectangle primitive.
Have a cached set of corner points to speed up computation.
Methods
impl<S> Rectangle<S> where
S: BaseFloat,
[src]
impl<S> Rectangle<S> where
S: BaseFloat,
pub fn new(dim_x: S, dim_y: S) -> Rectangle<S>
[src]
pub fn new(dim_x: S, dim_y: S) -> Rectangle<S>
Create a new rectangle primitive from component dimensions
pub fn new_impl(dim: Vector2<S>) -> Rectangle<S>
[src]
pub fn new_impl(dim: Vector2<S>) -> Rectangle<S>
Create a new rectangle primitive from a vector of component dimensions
pub fn dim(&self) -> &Vector2<S>
[src]
pub fn dim(&self) -> &Vector2<S>
Get the dimensions of the Rectangle
pub fn half_dim(&self) -> &Vector2<S>
[src]
pub fn half_dim(&self) -> &Vector2<S>
Get the half dimensions of the Rectangle
Trait Implementations
impl<S> ComputeBound<Aabb2<S>> for Rectangle<S> where
S: BaseFloat,
[src]
impl<S> ComputeBound<Aabb2<S>> for Rectangle<S> where
S: BaseFloat,
fn compute_bound(&self) -> Aabb2<S>
[src]
fn compute_bound(&self) -> Aabb2<S>
Compute the bounding volume
impl<S> Clone for Rectangle<S> where
S: Clone,
[src]
impl<S> Clone for Rectangle<S> where
S: Clone,
fn clone(&self) -> Rectangle<S>
[src]
fn clone(&self) -> Rectangle<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S> Debug for Rectangle<S> where
S: Debug,
[src]
impl<S> Debug for Rectangle<S> where
S: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<S> Primitive for Rectangle<S> where
S: BaseFloat,
[src]
impl<S> Primitive for Rectangle<S> where
S: BaseFloat,
type Point = Point2<S>
Point type
fn support_point<T>(&self, direction: &Vector2<S>, transform: &T) -> Point2<S> where
T: Transform<Point2<S>>,
[src]
fn support_point<T>(&self, direction: &Vector2<S>, transform: &T) -> Point2<S> where
T: Transform<Point2<S>>,
Get the support point on the shape in a given direction. Read more
impl<S> From<Rectangle<S>> for Primitive2<S>
[src]
impl<S> From<Rectangle<S>> for Primitive2<S>
fn from(rectangle: Rectangle<S>) -> Primitive2<S>
[src]
fn from(rectangle: Rectangle<S>) -> Primitive2<S>
Performs the conversion.
impl<S> Serialize for Rectangle<S> where
S: Serialize,
[src]
impl<S> Serialize for Rectangle<S> where
S: Serialize,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de, S> Deserialize<'de> for Rectangle<S> where
S: Deserialize<'de>,
[src]
impl<'de, S> Deserialize<'de> for Rectangle<S> where
S: Deserialize<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Rectangle<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Rectangle<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Rectangle<S> where
S: BaseFloat,
[src]
impl<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for Rectangle<S> where
S: BaseFloat,
fn intersects(&self, ray: &Ray<S, Point2<S>, Vector2<S>>) -> bool
[src]
fn intersects(&self, ray: &Ray<S, Point2<S>, Vector2<S>>) -> bool
Ray must be in object space of the rectangle
impl<S> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Rectangle<S> where
S: BaseFloat,
[src]
impl<S> Continuous<Ray<S, Point2<S>, Vector2<S>>> for Rectangle<S> where
S: BaseFloat,
type Result = Point2<S>
Result returned by the intersection test
fn intersection(&self, ray: &Ray<S, Point2<S>, Vector2<S>>) -> Option<Point2<S>>
[src]
fn intersection(&self, ray: &Ray<S, Point2<S>, Vector2<S>>) -> Option<Point2<S>>
Ray must be in object space of the rectangle
impl<S> PartialEq<Rectangle<S>> for Rectangle<S> where
S: PartialEq<S>,
[src]
impl<S> PartialEq<Rectangle<S>> for Rectangle<S> where
S: PartialEq<S>,
fn eq(&self, other: &Rectangle<S>) -> bool
[src]
fn eq(&self, other: &Rectangle<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rectangle<S>) -> bool
[src]
fn ne(&self, other: &Rectangle<S>) -> bool
This method tests for !=
.
impl<S> Volume<S, S> for Rectangle<S> where
S: BaseFloat + Inertia,
[src]
impl<S> Volume<S, S> for Rectangle<S> where
S: BaseFloat + Inertia,