MCPcopy Create free account
hub / github.com/axmolengine/axmol / createPolygon

Method createPolygon

core/physics/PhysicsBody.cpp:213–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213PhysicsBody* PhysicsBody::createPolygon(const Vec2* points,
214 int count,
215 const PhysicsMaterial& material,
216 const Vec2& offset)
217{
218 PhysicsBody* body = new PhysicsBody();
219 if (body->init())
220 {
221 body->addShape(PhysicsShapePolygon::create(points, count, material, offset));
222 body->autorelease();
223 return body;
224 }
225
226 AX_SAFE_DELETE(body);
227 return nullptr;
228}
229
230PhysicsBody* PhysicsBody::createEdgeSegment(const Vec2& a,
231 const Vec2& b,

Callers

nothing calls this directly

Calls 4

createFunction · 0.85
autoreleaseMethod · 0.80
initMethod · 0.45
addShapeMethod · 0.45

Tested by

no test coverage detected