Search code examples
javaeclipseplayn

2d vector class for PlayN?


I see the jbox2d Vec2 class in the repository:

http://code.google.com/p/playn/source/browse/gwtbox2d/src/org/jbox2d/common/Vec2.java

How do I make the PlayN port of JBox2D package accessible to my code? I'm using Eclipse but my project does not appear to be aware of the package.


Update:

Following the example here, I've added playn-jbox2d as a dependency in my core/pom.xml file. However, when I load my project I get the following error:

ArtifactDescriptorException: Failed to read artifact descriptor for com.googlecode.playn:playn-jbox2d:jar:1.1.1: ArtifactResolutionException: Could not transfer artifact com.googlecode.playn:playn-jbox2d:pom:1.1.1 from/to central (http://repo1.maven.org/maven2): Failed to transfer http://repo1.maven.org/maven2/com/googlecode/playn/playn-jbox2d/1.1.1/playn-jbox2d-1.1.1.pom. Error code 416, Requested Range Not Satisfiable pom.xml /myproject-core line 1 Maven Dependency Problem


Solution

  • After a bit of a goose chase, I figured out how to enable this. Following the example here, I manually added playn-jbox2d as a dependency in my core/pom.xml file. Here is what that section of my pom.xml file now looks like:

      <dependencies>
        <dependency>
          <groupId>com.googlecode.playn</groupId>
          <artifactId>playn-core</artifactId>
          <version>${playn.version}</version>
        </dependency>
    
        <dependency>
          <groupId>com.googlecode.playn</groupId>
          <artifactId>playn-jbox2d</artifactId>
          <version>${playn.version}</version>
        </dependency>
      </dependencies> 
    

    Then in Eclipse:

    Right-click core directory in Package Explorer window > Maven > Update Dependencies

    Thanks to all who offered assistance.