Cannot add PBox2D library to sketch

edited March 2016 in Using Processing

I'm following the instructions in The Nature of Code and cannot get the Box2D example to work. I get the error:

The package pbox2d does not exist. You might be missing a library

The example code is this:

```PBox2D box2d;

void setup() { Initialize and create the Box2D world. box2d = new PBox2D(this); box2d.createWorld(); }```

I have installed the library through add tools, and I can see the library in my 'libraries' folder as shown.

Answers

  • edited March 2016

    Most assured way to import an installed library is clicking at "Sketch".
    Look for its "Contributed" section. You should find "Box2D for Processing" for clicking at.

  • Answer ✓

    Just gave that a go, I now get import shiffman.box2d.*;. My other problem is that the class has been renamed to Box2DProcessing from PBox2D, but I was following the instructions in the book which call the library by its former name.

  • thanks TOM i was confused myself, but helped out with the download of Box2DProcessing

Sign In or Register to comment.