#include <chain_shape.h>
Public Member Functions | |
Construction | |
ChainShape () | |
Constructs a null instance. More... | |
ChainShape (const PhysicsWorld &pw) | |
Constructs a Chain Shape. More... | |
ChainShape (const PhysicsContext &pc) | |
Constructs a Chain Shape. More... | |
~ChainShape () | |
Attributes | |
bool | is_null () const |
Returns true if this object is invalid. More... | |
void | throw_if_null () const |
Throw an exception if this object is invalid. More... | |
Operations | |
ChainShape & | operator= (const ChainShape ©) |
Copy assignment operator. More... | |
void | create_loop (const Vec2f *vertices, const int count) |
Create a loop. This automatically adjusts connectivity. More... | |
void | create_loop (const CollisionOutline &outline) |
void | create_chain (const Vec2f *vertices, const int count) |
Create a chain with isolated end vertices. More... | |
void | set_prev_vertex (const Vec2f &prev_vertex) |
Establish connectivity to a vertex that precedes the first vertex. Don't call this for loops. More... | |
void | set_next_vertex (const Vec2f &next_vertex) |
Establish connectivity to a vertex that follows the last vertex. Don't call this for loops. More... | |
Attributes | |
ShapeType | get_shape_type () const |
Protected Attributes | |
Implementation | |
std::shared_ptr< Shape_Impl > | shape_impl |
Friends | |
class | FixtureDescription |
Chain Shape class.
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.