Using Recast4J and jme3-recast: Cannot import packages. "Package does not exist"

Dear everybody,
I am trying to get Recast4J and jme3-recast4j (https://github.com/MeFisto94/jme3-recast4j) to run, but to no avail.

Consider this minimal example:

package mygame;

import org.recast4j.*;

/**
 *
 * @author j
 */
public class NewClass {
    
    
    
}

The org of the import is marked and it states: “package org.recast4j does not exist”

I did click on the project and -> Properties -> Libraries -> and added racast4j as Library

This is driving me mad. I’ve been stuck for two days.
Can anyone ease my suffering, please? ( :wink: )

Best,
j

Click the jitpack link to see how to include jme3-recast4j into your project. Then look at the test class below to see how to actually use it.

https://jitpack.io/#MeFisto94/jme3-recast4j

1 Like

i dont know why it dont work for you in ANT.

but i use GRADLE and i got:

dependencies {
compile group: “org.recast4j”, name: “recast”, version: “1.2.3”
compile group: “org.recast4j”, name: “detour”, version: “1.2.3”
compile group: “org.recast4j”, name: “detour-crowd”, version: “1.2.3”
compile group: “org.recast4j”, name: “detour-tile-cache”, version: “1.2.3”
compile group: “org.recast4j”, name: “detour-extras”, version: “1.2.3”
compile group: “org.recast4j”, name: “parent”, version: “1.2.3”

and it work fine.

please note recase4j have multiple libs. like detour libs, recast lib etc. so maybe you just import not all. it should not affect. anyway you should know to add libs like above.

if not directly via github then via

https://bintray.com/bintray/jcenter/org.recast4j%3Arecast/1.2.3#files

anyway what you said should work, i think you just loaded this library wrong way somehow.

edit: also please note if recast4j is too hard to implement, you can always use JME navmesh lib. i like recast because it provide tile re-generate that i need.

1 Like

You may want to save yourself some trouble and not use this wrapper yet as it is not finished.

Its like 90% ready and the things that aren’t fixed render it unusable.

When it is, I am sure it will be announced.

This wrapper makes it sick easy to use Recast4j but don’t say you weren’t warned.

Every feature of Recast4j can be implemented without it though. Including offmesh connections, tile cache and filtering for path finding.

1 Like

First of all,
thank you guys very much for your answers!
I really appreciate it.

The reason I wanted to use jme3-recast4j is that I tried using recast4j directly and failed miserably.

I was able to use, however, the integrated critterai Navmesh generator (after which jme3-recast4j seems to be modeled).

I have to use recast4j, because I want to weight the navmesh that is being generated. I already know how to do that and where to put that into recast4j, this is why I would prefer using recast4j.

I tried many times to use recast4j directly, but I could not get it to work.

My problem is that I seem to not fully understand the example in here ( https://github.com/MeFisto94/jme3-recast4j/blob/master/src/main/java/com/jme3/recast4j/Recast/RecastTest.java )

I tried constructing the navmesh like it’s done in that test, but when I enter my scenegraph into the file and then build the RecastConfigbuilder and all that stuff (like it is done in the Test file linked above), then the type system gives me the finger, because for example the GeometryProviderBuilder needs a Geometry, not a Spatial.
(I am not sure I can post code since this is my thesis project. Otherwise I would. But it looks almost completely like the RecastTest,java (which I obviously cite), so I think that can be taken as a refefrence)

At the moment, I do not quite understand how to give the objects of the correct datatype to the classes and methods used in the RecastTest example.

Thats why I wanted to use jme3-recast4j, because I figured it would be easier. If anyone can tell me what mistake I am making in using recast4j, it would be distinctly appreciated AND would allow me to go on without the jme3-recast4j thingy.

Best,
j

Recast4j has its own binary exporter where you can write mesh data or polymesh to disk quickly and efficiently. That test does just that.

I won’t go into how to use the library since it’s not been released by mefisto.

I could show you how to use recast4j or even release a tutorial for it (already wrote one for jme-recast4j) but Id rather give mefisto time to finish his project at his own pace and release it when or if he wants to.

You can implement recast4j by using the test cases that are found inside each topic on the recast4j site. I just don’t have the time or desire to go thorough it because its a very complicated library.

1 Like