Struct liquidfun::box2d::collision::shapes::chain_shape::ChainShape [] [src]

pub struct ChainShape {
    // some fields omitted
}

A chain shape is a free form sequence of line segments. The chain has two-sided collision, so you can use inside and outside collision. Therefore, you may use any winding order. Since there may be many vertices, they are allocated using b2Alloc. Connectivity information is used to create smooth collisions. WARNING: The chain will not collide properly if there are self-intersections.

Methods

impl ChainShape

fn new() -> ChainShape

Create a new ChainShape.

fn create_chain(&mut self, vertices: &[Vec2], count: i32)

Create a chain with isolated end vertices. @param vertices an array of vertices, these are copied @param count the vertex count

fn get_child_count(&self) -> i32

@see b2Shape::GetChildCount

fn get_vertex_count(&self) -> i32

The vertex count.

fn get_vertices(&self) -> &[Vec2]

The vertices. Owned by this class.

Trait Implementations

impl Shape for ChainShape

fn handle(&self) -> *mut B2Shape

impl Drop for ChainShape

The destructor frees the vertices using b2Free.

fn drop(&mut self)