So... how to move around a node? :)

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 :wink:



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:

  1. 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?


  2. 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?


  3. Have no heightmap, but only models - then use physics. Well, with randomly generated maps this would be a drag → not an option for me :frowning:


  4. 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?! :smiley:





    Any help would be greatly appreciated! :slight_smile:

There is a heightmap collision shape for physics collision with terrain (see TestTeerainCollision. The other way will be the “normal” picking system, using the picking to determine where the floor is but that does not work yet, non-physics collision with terrain hasnt been put in yet.

Cheers,

Normen

Great, thanks! :slight_smile: