20 #ifndef B2_POLYGON_SHAPE_H
21 #define B2_POLYGON_SHAPE_H
23 #include <Box2D/Collision/Shapes/b2Shape.h>
45 void Set(
const b2Vec2* points, int32 count);
50 void SetAsBox(float32 hx, float32 hy);
57 void SetAsBox(float32 hx, float32 hy,
const b2Vec2& center, float32 angle);
67 const b2Transform& transform, int32 childIndex)
const;
85 #if LIQUIDFUN_EXTERNAL_LANGUAGE_API
88 void SetCentroid(float32 x, float32 y);
97 #endif // LIQUIDFUN_EXTERNAL_LANGUAGE_API
105 inline b2PolygonShape::b2PolygonShape()
115 b2Assert(0 <= index && index < m_count);
116 return m_vertices[index];
119 #if LIQUIDFUN_EXTERNAL_LANGUAGE_API
120 inline void b2PolygonShape::SetCentroid(float32 x, float32 y)
122 m_centroid.
Set(x, y);
132 #endif // LIQUIDFUN_EXTERNAL_LANGUAGE_API
bool Validate() const
Definition: b2PolygonShape.cpp:478
void ComputeAABB(b2AABB *aabb, const b2Transform &transform, int32 childIndex) const
Definition: b2PolygonShape.cpp:376
bool TestPoint(const b2Transform &transform, const b2Vec2 &p) const
Definition: b2PolygonShape.cpp:244
int32 GetChildCount() const
Definition: b2PolygonShape.cpp:70
Definition: b2BlockAllocator.h:36
This holds the mass data computed for a shape.
Definition: b2Shape.h:28
void ComputeMass(b2MassData *massData, float32 density) const
Definition: b2PolygonShape.cpp:395
void SetAsBox(float32 hx, float32 hy)
Definition: b2PolygonShape.cpp:31
Definition: b2PolygonShape.h:29
void Set(float32 x_, float32 y_)
Set this vector to some specified coordinates.
Definition: b2Math.h:68
Definition: b2Collision.h:155
void SetZero()
Set this vector to all zeros.
Definition: b2Math.h:65
void ComputeDistance(const b2Transform &xf, const b2Vec2 &p, float32 *distance, b2Vec2 *normal, int32 childIndex) const
Definition: b2PolygonShape.cpp:260
bool RayCast(b2RayCastOutput *output, const b2RayCastInput &input, const b2Transform &transform, int32 childIndex) const
Implement b2Shape.
Definition: b2PolygonShape.cpp:304
#define b2_polygonRadius
Definition: b2Settings.h:120
An axis aligned bounding box.
Definition: b2Collision.h:162
b2Shape * Clone(b2BlockAllocator *allocator) const
Implement b2Shape.
Definition: b2PolygonShape.cpp:23
void Set(const b2Vec2 *points, int32 count)
Definition: b2PolygonShape.cpp:121
int32 GetVertexCount() const
Get the vertex count.
Definition: b2PolygonShape.h:76
A 2D column vector.
Definition: b2Math.h:56
const b2Vec2 & GetVertex(int32 index) const
Get a vertex by index.
Definition: b2PolygonShape.h:113
#define b2_maxPolygonVertices
Definition: b2Settings.h:97