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

Method createEdgeSegment

core/physics/PhysicsBody.cpp:230–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230PhysicsBody* PhysicsBody::createEdgeSegment(const Vec2& a,
231 const Vec2& b,
232 const PhysicsMaterial& material,
233 float border /* = 1*/)
234{
235 PhysicsBody* body = new PhysicsBody();
236 if (body->init())
237 {
238 body->addShape(PhysicsShapeEdgeSegment::create(a, b, material, border));
239 body->setDynamic(false);
240 body->autorelease();
241 return body;
242 }
243
244 AX_SAFE_DELETE(body);
245 return nullptr;
246}
247
248PhysicsBody* PhysicsBody::createEdgeBox(const Vec2& size,
249 const PhysicsMaterial& material,

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