Struct rhusics_core::collide2d::ConvexPolygon [−][src]
Convex polygon primitive.
Can contain any number of vertices, but a high number of vertices will affect performance of course. Vertices need to be in CCW order.
Fields
vertices: Vec<Point2<S>>
Vertices of the convex polygon.
Methods
impl<S> ConvexPolygon<S>
[src]
impl<S> ConvexPolygon<S>
pub fn new(vertices: Vec<Point2<S>>) -> ConvexPolygon<S>
[src]
pub fn new(vertices: Vec<Point2<S>>) -> ConvexPolygon<S>
Create a new convex polygon from the given vertices. Vertices need to be in CCW order.
Trait Implementations
impl<S> ComputeBound<Aabb2<S>> for ConvexPolygon<S> where
S: BaseFloat,
[src]
impl<S> ComputeBound<Aabb2<S>> for ConvexPolygon<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 ConvexPolygon<S> where
S: Clone,
[src]
impl<S> Clone for ConvexPolygon<S> where
S: Clone,
fn clone(&self) -> ConvexPolygon<S>
[src]
fn clone(&self) -> ConvexPolygon<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 ConvexPolygon<S> where
S: Debug,
[src]
impl<S> Debug for ConvexPolygon<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 ConvexPolygon<S> where
S: BaseFloat,
[src]
impl<S> Primitive for ConvexPolygon<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<ConvexPolygon<S>> for Primitive2<S>
[src]
impl<S> From<ConvexPolygon<S>> for Primitive2<S>
fn from(polygon: ConvexPolygon<S>) -> Primitive2<S>
[src]
fn from(polygon: ConvexPolygon<S>) -> Primitive2<S>
Performs the conversion.
impl<S> Serialize for ConvexPolygon<S> where
S: Serialize,
[src]
impl<S> Serialize for ConvexPolygon<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 ConvexPolygon<S> where
S: Deserialize<'de>,
[src]
impl<'de, S> Deserialize<'de> for ConvexPolygon<S> where
S: Deserialize<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ConvexPolygon<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<ConvexPolygon<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 ConvexPolygon<S> where
S: BaseFloat,
[src]
impl<S> Discrete<Ray<S, Point2<S>, Vector2<S>>> for ConvexPolygon<S> where
S: BaseFloat,
impl<S> Continuous<Ray<S, Point2<S>, Vector2<S>>> for ConvexPolygon<S> where
S: BaseFloat,
[src]
impl<S> Continuous<Ray<S, Point2<S>, Vector2<S>>> for ConvexPolygon<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
impl<S> PartialEq<ConvexPolygon<S>> for ConvexPolygon<S> where
S: PartialEq<S>,
[src]
impl<S> PartialEq<ConvexPolygon<S>> for ConvexPolygon<S> where
S: PartialEq<S>,
fn eq(&self, other: &ConvexPolygon<S>) -> bool
[src]
fn eq(&self, other: &ConvexPolygon<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ConvexPolygon<S>) -> bool
[src]
fn ne(&self, other: &ConvexPolygon<S>) -> bool
This method tests for !=
.
impl<S> Volume<S, S> for ConvexPolygon<S> where
S: BaseFloat + Inertia,
[src]
impl<S> Volume<S, S> for ConvexPolygon<S> where
S: BaseFloat + Inertia,
Auto Trait Implementations
impl<S> Send for ConvexPolygon<S> where
S: Send,
impl<S> Send for ConvexPolygon<S> where
S: Send,
impl<S> Sync for ConvexPolygon<S> where
S: Sync,
impl<S> Sync for ConvexPolygon<S> where
S: Sync,