Projects > cpp > Issues > Bug #3517

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

CC_USE_PHYSICS is actually impossible to turn it off

Bug #3517 [Closed] 2013-12-26 15:51 . Updated about 10 years ago

in ccConfig.h,


in source code, e.g., Scene.cpp

// blabla

As the result, no matter I define CC_USE_PHYSICS or not, ccConfig.h will define it more me AUTOMATICALLY, then apply in all cpp code.

And the worse:

// in Scene.cpp
void Scene::update(float delta)
    if (nullptr != _physicsWorld)

So if I switch off CC_USE_PHYSICS, then Scene will no has update method.

How these code be reviewed and merged? 2013-12-26 15:53
  • Description updated (diff)
dumganhar 2013-12-27 01:58

Yep, I agree with 1),
But for 2) ,you said

So if I switch off CC_USE_PHYSICS, then Scene will no has update method.

Notice that Node::update is a virtual function. We override Scene::update only for physics. That doesn’t mean that Scene has no update method, its parent Node own it.

boyu0 2013-12-27 02:15

James is right.
I think if you want to disable CC_USE_PHYSICS, you can comment CC_USE_PHYSICS definition in ccConfig.h. and I tried to comment that and compiled the code, it’s ok.
Yes, use #if instead of #ifdef is better, thanks. 2013-12-28 22:11
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:a4558e33631773554cfa0530172d688647a8c86c.

Atom PDF

Start date:2013-12-26
Due date:
% Done:


Target version:3.0-beta