Cannot find symbol TerrainQuad

I get this error when copy/pasting the code from the hello_terrain beginner tutorial.


cannot find symbol
symbol : constructor TerrainQuad(java.lang.String,int,int,com.jme3.math.Vector3f,float[])
location: class com.jme3.terrain.geomipmap.TerrainQuad
terrain = new TerrainQuad("my terrain", 65, 513, new Vector3f(1, 1, 1), heightmap.getHeightMap());
1 error


I've tried the usual method of ctrl-shift-I to include any imports that may have been missed but it doesn't help. :cry: Can anybody tell me where I can find TerrainQuad?


Also I was wondering if there were "solutions" anywhere for the tutorial exercises. I've done most of them, but I've been having difficulty with a few. More specifically, from HelloNode tutorial one exercise wants you to create a cube that pulsates in size over time (I tried implementing a sine function to do this, but I didn't know how to get the time). The second exercise I had problems with was the HelloPicking tutorial. For the shoot at a model part, the model wouldn't show up initially, but when I shot where it should have been it would show up but then the output wouldn't include it as part of the hit targets... Then for the Pick Up Into Inventory part, I was able to detach objects from the scene and store them into an inventory node, but the objects wouldn't always get put back into the scene on my second click. Here is the code I used for that:
[java] if(inventory.getQuantity()==0){
inventory.attachChild(closest.getGeometry());
shootables.detachChild(closest.getGeometry());

} else {
inventory.setLocalTranslation(closest.getContactPoint());
shootables.attachChild(inventory);
inventory.detachAllChildren();
}[/java]

Any tips would be appreciated.

http://hub.jmonkeyengine.org/groups/terramonkey/forum/topic/missing/

I’ve updated to the latest nightly and installed all the plugins. I’ve manually found the location of the TerrainQuad in the libraries and the code



[java]import com.jme3.terrain.geomipmap.TerrainQuad;[/java]



is included in my java class file, but the error persists. Any ideas?

Same problem… it needs a LodCalculatorFactory thingy… I have no idea how I would do that though…



Again, any ideas?



Thanks.



-nomnom

I figured out how to get it to work after looking at the actual TerrainQuad java class file a little more.



Inside the file there is this at some point:

[java] public TerrainQuad(String name, int blockSize, int size, float[] heightMap) {

this(name, blockSize, size, Vector3f.UNIT_XYZ, heightMap, size, new Vector2f(), 0, null);

}



public TerrainQuad(String name, int blockSize, int size, Vector3f scale, float[] heightMap, LodCalculatorFactory lodCalculatorFactory) {

this(name, blockSize, size, scale, heightMap, size, new Vector2f(), 0, lodCalculatorFactory);

}



protected TerrainQuad(String name, int blockSize, int size,

Vector3f stepScale, float[] heightMap, int totalSize,

Vector2f offset, float offsetAmount,

LodCalculatorFactory lodCalculatorFactory)[/java]



The tutorial includes everything except the LodCalculatorFactory argument in the code it provides, but if you take out the Vector argument, it will work too. Note, I have no idea how this affects the actual terrain, so I don’t know if the effects that result from this will be desirable, but hey, you’ll get terrain.

The section on the Lod Control is step 5 in the tutorial here: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_terrain

The LodCalculator isn’t needed to create the terrain. If one isn’t supplied then it will create its own. Unless that code is now broken… but I don’t think it is.

yeah… does it work for you? If it does, are you using jMP? ‘Cause mine refuses to work/run… it keeps say, “cannot find symbol

symbol: constructor TerrainQuad(java.lang.String,int,int,com.jme3.math.Vector3f,float[])

location: class com.jme3.terrain.geomipmap.TerrainQuad”



A.K.A. same problem. All I want is to be able to load some terrain to see what I can accomplish with it. I applaud your guys’ work on this, so amateurs like me can attempt at game creation =]. So yeah, I tried it without the Vector3f, and it just closed when I told the opening jMonkey JFrame to go to the “game”. Thanks.



-nomnom

Do you have the jme3 source checked out or the latest nightly build? You might have to run the ant target update-gde to push the most recent jme3 changes to jmp. I think that constructor changed a few weeks back and hasn’t made it into an official release yet (the next alpha release I believe is nov 5).

It does work for me, I’m using the dev environment though and constantly building jme3 and jmp with the latest updates.



I’m going to try and commit my changes to the editor tonight so you can at least generate the terrain in jmp and add it to your scene. No promises it will make it in, but I will try :slight_smile:

Awesome man, thanks. Yeah, I made sure I had EVERY jMP download and updates (I even refreshed a couple times). So yeah, all I really want to do is make some terrain and be able to use it. Thanks again!



-nomnom

Did you enter it in this form?



[java]TerrainQuad(String name, int blockSize, int size, float[] heightMap)[/java]



Also hit Ctrl-Shift-I if there is no import statement at the beginning of your class.



I’ve gotten it working using that format w/ jMP running the latest nightly of jME 3.

Yeah… I think I said that in one of my earlier posts… all it did was open up the regular jMonkey thing (with all of the choices like frame size and if you want LWGL or JOGL), then when I pressed go it just shut itself down… I’ll have to try searching for updates again I guess…

can’t test it until I can use my different compy…someone’s borrowing that at the moment so I’m stuck using this 2003 Compaq laptop

Yeah, it didn’t work…

Hi,

I have a similar Problem: Java cannot find the class ‘ProceduralTextureGenerator’. (See here)

I’ve installed the jME3 and updatet correctly to the newest Version…



Is there a new Class for this or has it been renamed?

Install the NeoTexture plugin through the update center (Tools->Plugins) and then add the NeoTexture library to your project (right-click Project → Preferences → Libraries → Add Library).

Hm… I installed the plugin, restarted the platform and added the libraries to my project.

But in the packages of the libraries isn’t any class named ‘ProceduralTextureGenerator’. There’s a class ‘TextureGenerator’, but this seems to be something different, because there’s an empty constructor and it doesn’t have the function ‘addTexture’, ‘createTexture’, etc. …

Oh, sorry, thought you wanted to create procedural textures. The wiki page you linked was for jME2, this class is not available in jME3.

Is there another to create a terrain with different textures for each height? (in JME3 ;))



If not, I have a different question:

I actually use the code sample of the TerrainTest with this material: ‘Common/MatDefs/Terrain/Terrain.j3md’ (It requires 3 Textures, in the Example: ‘road’, ‘grass’, ‘dirt’)

Can you tell me, how it creates the “paths” like the road or the “area” with dirt or grass? Does ist look at the terrain and creates a path or are these areas just randomly gerenated?

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_terrain

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:terrain

Oh… I must have overread the chapter “What is Texture Splatting?”…

Sorry for that and thanks for the quick help! :slight_smile: