19 #ifndef B2_POLYGON_SHAPE_H
20 #define B2_POLYGON_SHAPE_H
22 #include <Box2D/Collision/Shapes/b2Shape.h>
44 void Set(
const b2Vec2* points, int32 count);
49 void SetAsBox(float32 hx, float32 hy);
56 void SetAsBox(float32 hx, float32 hy,
const b2Vec2& center, float32 angle);
63 const b2Transform& transform, int32 childIndex)
const;
87 inline b2PolygonShape::b2PolygonShape()
97 b2Assert(0 <= index && index < m_count);
98 return m_vertices[index];
bool Validate() const
Definition: b2PolygonShape.cpp:433
void ComputeAABB(b2AABB *aabb, const b2Transform &transform, int32 childIndex) const
Definition: b2PolygonShape.cpp:331
bool TestPoint(const b2Transform &transform, const b2Vec2 &p) const
Definition: b2PolygonShape.cpp:243
int32 GetChildCount() const
Definition: b2PolygonShape.cpp:69
Definition: b2BlockAllocator.h:35
This holds the mass data computed for a shape.
Definition: b2Shape.h:27
void ComputeMass(b2MassData *massData, float32 density) const
Definition: b2PolygonShape.cpp:350
void SetAsBox(float32 hx, float32 hy)
Definition: b2PolygonShape.cpp:30
Definition: b2PolygonShape.h:28
Definition: b2Collision.h:155
void SetZero()
Set this vector to all zeros.
Definition: b2Math.h:62
bool RayCast(b2RayCastOutput *output, const b2RayCastInput &input, const b2Transform &transform, int32 childIndex) const
Implement b2Shape.
Definition: b2PolygonShape.cpp:259
#define b2_polygonRadius
Definition: b2Settings.h:77
An axis aligned bounding box.
Definition: b2Collision.h:162
b2Shape * Clone(b2BlockAllocator *allocator) const
Implement b2Shape.
Definition: b2PolygonShape.cpp:22
void Set(const b2Vec2 *points, int32 count)
Definition: b2PolygonShape.cpp:120
int32 GetVertexCount() const
Get the vertex count.
Definition: b2PolygonShape.h:72
A 2D column vector.
Definition: b2Math.h:53
const b2Vec2 & GetVertex(int32 index) const
Get a vertex by index.
Definition: b2PolygonShape.h:95
#define b2_maxPolygonVertices
Definition: b2Settings.h:54