コード例 #1
0
ファイル: CCPhysicsContact.cpp プロジェクト: Gamex/GameX
PhysicsContact* PhysicsContact::create(PhysicsShape* a, PhysicsShape* b)
{
    PhysicsContact * contact = new PhysicsContact();
    if(contact && contact->init(a, b))
    {
        return contact;
    }
    
    CC_SAFE_DELETE(contact);
    return nullptr;
}
コード例 #2
0
PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b)
{
    PhysicsContact * contact = new (std::nothrow) PhysicsContact();
    if(contact && contact->init(a, b))
    {
        return contact;
    }
    
    CC_SAFE_DELETE(contact);
    return nullptr;
}