Hi,
We often use code like this:
to create a shape, and assign it to the "shape" domain of a fixtureDef in function such as init(). As a local variable, I think 'groundEdge' will vanish when the program runs out of method init(), and 'boxShapeDef.shape' will be an invalid pointer...so I think there should be some errors happen or it just crashes.
But seems the program still runs well, could someone tell me why?
We often use code like this:
Code:
b2EdgeShape groundEdge;
b2FixtureDef boxShapeDef;
boxShapeDef.shape=&groundEdge;
b2FixtureDef boxShapeDef;
boxShapeDef.shape=&groundEdge;
to create a shape, and assign it to the "shape" domain of a fixtureDef in function such as init(). As a local variable, I think 'groundEdge' will vanish when the program runs out of method init(), and 'boxShapeDef.shape' will be an invalid pointer...so I think there should be some errors happen or it just crashes.
But seems the program still runs well, could someone tell me why?