mirror of https://github.com/axmolengine/axmol.git
issue #2771: rename PhysicsWorld::create() to PhysicsWorld::construct(), fix some bugs
This commit is contained in:
parent
a56dedb41a
commit
4efacdbcf3
|
@ -102,7 +102,7 @@ bool Scene::initWithPhysics()
|
|||
Director * pDirector;
|
||||
CC_BREAK_IF( ! (pDirector = Director::getInstance()) );
|
||||
this->setContentSize(pDirector->getWinSize());
|
||||
CC_BREAK_IF(! (_physicsWorld = PhysicsWorld::create(*this)));
|
||||
CC_BREAK_IF(! (_physicsWorld = PhysicsWorld::construct(*this)));
|
||||
|
||||
this->scheduleUpdate();
|
||||
// success
|
||||
|
|
|
@ -987,7 +987,7 @@ void PhysicsDebugDraw::drawContact()
|
|||
|
||||
#endif
|
||||
|
||||
PhysicsWorld* PhysicsWorld::create(Scene& scene)
|
||||
PhysicsWorld* PhysicsWorld::construct(Scene& scene)
|
||||
{
|
||||
PhysicsWorld * world = new PhysicsWorld();
|
||||
if(world && world->init(scene))
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
inline int getDebugDrawMask() { return _debugDrawMask; }
|
||||
|
||||
protected:
|
||||
static PhysicsWorld* create(Scene& scene);
|
||||
static PhysicsWorld* construct(Scene& scene);
|
||||
bool init(Scene& scene);
|
||||
|
||||
virtual void addBody(PhysicsBody* body);
|
||||
|
@ -182,10 +182,9 @@ protected:
|
|||
|
||||
class PhysicsDebugDraw
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
virtual bool begin();
|
||||
virtual void end();
|
||||
void close();
|
||||
virtual void drawShape(PhysicsShape& shape);
|
||||
virtual void drawJoint(PhysicsJoint& joint);
|
||||
virtual void drawContact();
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
static float cpfloat2float(cpFloat f) { return f; }
|
||||
static cpFloat float2cpfloat(float f) { return f; }
|
||||
static cpBB rect2cpbb(const Rect& rect) { return cpBBNew(rect.origin.x, rect.origin.y, rect.origin.x + rect.size.width, rect.origin.y + rect.size.height); }
|
||||
static Rect cpbb2rect(const cpBB& bb) { return Rect(bb.l, bb.b, bb.r, bb.t); }
|
||||
static Rect cpbb2rect(const cpBB& bb) { return Rect(bb.l, bb.b, bb.r - bb.l, bb.t - bb.b); }
|
||||
|
||||
static Point* cpvs2points(const cpVect* cpvs, Point* out, int count)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue