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

Method createCircle

core/physics/PhysicsBody.cpp:185–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& material, const Vec2& offset)
186{
187 PhysicsBody* body = new PhysicsBody();
188 if (body->init())
189 {
190 body->addShape(PhysicsShapeCircle::create(radius, material, offset));
191 body->autorelease();
192 return body;
193 }
194
195 AX_SAFE_DELETE(body);
196 return nullptr;
197}
198
199PhysicsBody* PhysicsBody::createBox(const Vec2& size, const PhysicsMaterial& material, const Vec2& offset)
200{

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