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

Method createEdgeChain

core/physics/PhysicsBody.cpp:286–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286PhysicsBody* PhysicsBody::createEdgeChain(const Vec2* points,
287 int count,
288 const PhysicsMaterial& material,
289 float border /* = 1*/)
290{
291 PhysicsBody* body = new PhysicsBody();
292 if (body->init())
293 {
294 body->addShape(PhysicsShapeEdgeChain::create(points, count, material, border));
295 body->setDynamic(false);
296 body->autorelease();
297 return body;
298 }
299
300 AX_SAFE_DELETE(body);
301
302 return nullptr;
303}
304
305bool PhysicsBody::init()
306{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected