Right now, you’re probably thinking: “WTF?! Did he read neither the tutorial, nor see the ‘move’ method?!”
Well, let me assure you - I did go through the tutorials
What I was rather thinking of is: “How to move over terrain without using up lots of resources?”
I’m totally fine with only having one y-value per x/z-set (Using Heightmaps)
The four ways that popped to my mind when thinking bout it were those:
- Use physics like in “JME3 (13) - Hello Physics”.
Not only does the CollisionShape creation crash for Terrain objects so far, but even if it worked: Wouldn’t that be pretty inefficient?
- Split your terrain and create smaller physics-objects.
Yes, assuming the CollisionShape creation works (didn’t try it that much, but saw a prio high bug on the tracker bout it which makes me assume I’m not the only one with problems) this would be one possibility. But wouldn’t it be an unnecessarily complicated one?
- Have no heightmap, but only models - then use physics. Well, with randomly generated maps this would be a drag → not an option for me
- Set your models’ heights to the height of the Terrain beneath them when they move.
This one I stole from the flagrush-tutorial from jME2. It might not be the ultimate one, and using physics would be kinda nicer, but it seemed the easiest one to implement for first tests. As getHeight() of Terrain elements always return 0 though, this one won’t work either.
So… how does it work?!
I’ve seen lots of screens so far using jME3, and the Terrain definitely wasn’t flat all of the time. How do you do it? How to use Heightmaps and move a model on them so far?!
Any help would be greatly appreciated!