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

Method createEdgeBox

core/physics/PhysicsBody.cpp:248–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248PhysicsBody* PhysicsBody::createEdgeBox(const Vec2& size,
249 const PhysicsMaterial& material,
250 float border /* = 1*/,
251 const Vec2& offset)
252{
253 PhysicsBody* body = new PhysicsBody();
254 if (body->init())
255 {
256 body->addShape(PhysicsShapeEdgeBox::create(size, material, border, offset));
257 body->setDynamic(false);
258 body->autorelease();
259 return body;
260 }
261
262 AX_SAFE_DELETE(body);
263
264 return nullptr;
265}
266
267PhysicsBody* PhysicsBody::createEdgePolygon(const Vec2* points,
268 int count,

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