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

Method createBox

core/physics/PhysicsBody.cpp:199–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199PhysicsBody* PhysicsBody::createBox(const Vec2& size, const PhysicsMaterial& material, const Vec2& offset)
200{
201 PhysicsBody* body = new PhysicsBody();
202 if (body->init())
203 {
204 body->addShape(PhysicsShapeBox::create(size, material, offset));
205 body->autorelease();
206 return body;
207 }
208
209 AX_SAFE_DELETE(body);
210 return nullptr;
211}
212
213PhysicsBody* PhysicsBody::createPolygon(const Vec2* points,
214 int count,

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