Closed dimkir closed 8 years ago
this is a very good point, will definitely try to add something in for the next edition. thank you,
Agree, this is the problem I was running into. Only after some attempts did I make things right. Thanks for the post.
Thanks again for this great feedback. I added this to the very first example code and there is a code comment that explains (which will be highlighted next to this code area.)
//{!4} Note how in addition to the default important statement for
// Box2D-for-Processing, I'm also importing packages from JBox2D itself.
// This will be necessary for referencing certain objects that come from
// JBox2D rather than Box2D-for-Processing.
import shiffman.box2d.*;
import org.jbox2d.collision.shapes.*;
import org.jbox2d.common.*;
import org.jbox2d.dynamics.*;
When reading Chapter 5 (Physics libraries) and trying to follow the book and type in the code examples eg. how to define body:
the code wouldn't compile, throwing the following error:
the reason behind it is missing import of JBox2D library, namely:
If someone decides to follow their intuition and "import library" and will go to
PDE \\ Sketch \\ ImportLibrary \\ PBox2D
it will only add import forbut not the jbox2d imports, which have to be added manually. This may create confusion and reader may get stuck with question
I believe that some clear instructions on manual import of those jbox2d packages should be mentioned in the chapter. Maybe in the beginning of the chapter, in a way similar to: