本文整理汇总了C++中PhysicsBody::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicsBody::autorelease方法的具体用法?C++ PhysicsBody::autorelease怎么用?C++ PhysicsBody::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysicsBody
的用法示例。
在下文中一共展示了PhysicsBody::autorelease方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
PhysicsBody* PhysicsBody::create()
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例2: createBox
PhysicsBody* PhysicsBody::createBox(const Size& size, const PhysicsMaterial& material, const Vec2& offset)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeBox::create(size, material, offset));
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例3: createPolygon
PhysicsBody* PhysicsBody::createPolygon(const Vec2* points, int count, const PhysicsMaterial& material, const Vec2& offset)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapePolygon::create(points, count, material, offset));
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例4: createPolygon
PhysicsBody* PhysicsBody::createPolygon(Point* points, int count, PhysicsMaterial material)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapePolygon::create(points, count, material));
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例5: createCircle
PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& material, const Vec2& offset)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeCircle::create(radius, material, offset));
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例6: createBox
PhysicsBody* PhysicsBody::createBox(Size size, PhysicsMaterial material)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeBox::create(size, material));
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例7: createEdgeSegment
PhysicsBody* PhysicsBody::createEdgeSegment(const Vec2& a, const Vec2& b, const PhysicsMaterial& material, float border/* = 1*/)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeEdgeSegment::create(a, b, material, border));
body->_dynamic = false;
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例8: createEdgeChain
PhysicsBody* PhysicsBody::createEdgeChain(const Vec2* points, int count, const PhysicsMaterial& material, float border/* = 1*/)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeEdgeChain::create(points, count, material, border));
body->_dynamic = false;
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例9: createEdgeBox
PhysicsBody* PhysicsBody::createEdgeBox(const Size& size, const PhysicsMaterial& material, float border/* = 1*/, const Vec2& offset)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeEdgeBox::create(size, material, border, offset));
body->_dynamic = false;
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例10: createEdgeBox
PhysicsBody* PhysicsBody::createEdgeBox(Size size, PhysicsMaterial material, float border/* = 1*/)
{
PhysicsBody* body = new PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeEdgeBox::create(size, material, border));
body->_dynamic = false;
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例11: createEdgePolygon
PhysicsBody* PhysicsBody::createEdgePolygon(const Vec2* points, int count, const PhysicsMaterial& material, float border/* = 1*/)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeEdgePolygon::create(points, count, material, border));
body->setDynamic(false);
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
示例12: create
PhysicsBody* PhysicsBody::create(float mass, float moment)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body)
{
body->_mass = mass;
body->_massDefault = false;
body->_moment = moment;
body->_momentDefault = false;
if (body->init())
{
body->autorelease();
return body;
}
}
CC_SAFE_DELETE(body);
return nullptr;
}