Struct liquidfun::box2d::collision::shapes::polygon_shape::PolygonShape
[−]
[src]
pub struct PolygonShape { // some fields omitted }
A convex polygon. It is assumed that the interior of the polygon is to the left of each edge. Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. In most cases you should not need many vertices for a convex polygon.
Methods
impl PolygonShape
fn new() -> PolygonShape
Create a new PolygonShape.
fn get_vertex(&self, index: i32) -> &Vec2
Get a vertex by index.
fn get_vertex_count(&self) -> i32
Get the vertex count.
fn set_as_box(&mut self, hx: f32, hy: f32)
Build vertices to represent an axis-aligned box centered on the local origin. @param hx the half-width. @param hy the half-height.
fn set_as_box_oriented(&mut self, hx: f32, hy: f32, center: &Vec2, angle: f32)
Build vertices to represent an oriented box. @param hx the half-width. @param hy the half-height. @param center the center of the box in local coordinates. @param angle the rotation of the box in local coordinates.
impl PolygonShape
fn get_vertex_iterator(&mut self) -> VertexIterator
Get a vertex iterator.