40 for (
int32 i = 1; i < count; ++i)
62 for (
int32 i = 1; i < count; ++i)
155 int32 i1 = childIndex;
156 int32 i2 = childIndex + 1;
165 return edgeShape.
RayCast(output, input, xf, 0);
172 int32 i1 = childIndex;
173 int32 i2 = childIndex + 1;
190 massData->
mass = 0.0f;
b2Vec2 b2Mul(const b2Mat22 &A, const b2Vec2 &v)
b2Vec2 * m_vertices
The vertices. Owned by this class.
bool RayCast(b2RayCastOutput *output, const b2RayCastInput &input, const b2Transform &transform, int32 childIndex) const
Implement b2Shape.
b2Vec2 lowerBound
the lower vertex
b2Shape * Clone(b2BlockAllocator *allocator) const
Implement b2Shape. Vertices are cloned using b2Alloc.
bool RayCast(b2RayCastOutput *output, const b2RayCastInput &input, const b2Transform &transform, int32 childIndex) const
Implement b2Shape.
float32 I
The rotational inertia of the shape about the local origin.
b2Vec2 m_vertex0
Optional adjacent vertices. These are used for smooth collision.
~b2ChainShape()
The destructor frees the vertices using b2Free.
void SetPrevVertex(const b2Vec2 &prevVertex)
b2Vec2 center
The position of the shape's centroid relative to the shape's origin.
void SetZero()
Set this vector to all zeros.
void SetNextVertex(const b2Vec2 &nextVertex)
float32 mass
The mass of the shape, usually in kilograms.
void * Allocate(int32 size)
Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize.
float32 b2DistanceSquared(const b2Vec2 &a, const b2Vec2 &b)
void ComputeMass(b2MassData *massData, float32 density) const
void Clear()
Clear all data.
void ComputeAABB(b2AABB *aabb, const b2Transform &transform, int32 childIndex) const
void CreateLoop(const b2Vec2 *vertices, int32 count)
void GetChildEdge(b2EdgeShape *edge, int32 index) const
Get a child edge.
An axis aligned bounding box.
b2Vec2 m_vertex1
These are the edge vertices.
void * b2Alloc(int32 size)
Implement this function to use your own memory allocator.
int32 m_count
The vertex count.
void CreateChain(const b2Vec2 *vertices, int32 count)
This holds the mass data computed for a shape.
void b2Free(void *mem)
If you implement b2Alloc, you should also implement this function.
int32 GetChildCount() const
b2Vec2 upperBound
the upper vertex
bool TestPoint(const b2Transform &transform, const b2Vec2 &p) const