Turning off the "Integrated Physics Engine" (CC_USE_PHYSICS=0) results in the failure of getTexture() funtion of spriteBachNode.


#1

**Turning off the “Integrated Physics Engine” (CC_USE_PHYSICS=0) results in the failure of getTexture() funtion of spriteBachNode.
**
This unreasonalbe BUG costs me three days to taget. And it still exsits in the rc0 version of cocos2dx 3.0. You can try to turn off the “Integrated Physics Engine” and use a spriteBachNode to load a image file. After, try to get the texture2D instance pointer by calling the getTexture() function. Eventually, a run-time error would be thrown out.

In addition, “Integrated Physics Engine” is believed to be helpful, but I really prefer to handle the physics engine by myself. The complicity is nothing a problem for me. In addition, I dont think integrating a Physics Engine into cocos2dx is a good idea, because the physics data shuld be indipendent form the data of its ‘actors’. The ‘Truncation error’ is fatal to some physic-sensitive games, so passing data(e.g. pos,rotatins) from ‘actor’ to physics body should be very carefull. Nomorlly, data passing should be uniderection, namely, for physics to its ‘actors’.

Well, if you dont understand what I’m talking in the above para., never mind. Please just fix the BUG I mentioned at the very begining, and let me turn off the “Integrated Physics Engine”.

Thanks for making such a wonderful Geme Engine.
Looking forward to see the next version of cocos2dx3.0.

Yang


#2

what do you think is the effect of having:

#define CC_USE_PHYSICS 1

As long as you don’t use PhysicsSprite, and create your scene with initWithPhysics(), is there any side effect?


#3

@Romain
Well, if I turn it off by:
#define CC_USE_PHYSICS 0

I can not use function ‘getTexture()’ of SpriteBachNode.
strange, right? If I turn it on, getTexture() works as normal.


#4

I’ve tried CC_USE_PHYSICS 0 and getTexture() of SpriteBachNode: no crash for me (iOS)
In any case, why don’t you leave CC_USE_PHYSICS 1, it wouldn’t affect anything?


#5

@Romain
Thanks for trying. Formerly, I set ‘CC_USE_PHYSICS=0’ in the definition of preprocessor (vs2013 express). It crashs every time.
Now I try to modify it in the ‘ccConfig.h’ file. Everything goes well.

Still dont know why. However, thanks a lot.