Jump to content

Performant ground height solution


Recommended Posts

Hey Everyone, 

So I have a mesh which I use as ground, but since I need it exported from blender ( altogether with a navigation mesh ) I cant use the GroundMesh methods such as "getHeightAtCoordinates(x, z)". Right now I have implemented RayCasting for the task and is working quite good, however I need a more efficient way of doing it and since I am looking for one thought to ask here as well. If someone can point me to a direction how to approach this it would be amazing.


Link to comment
Share on other sites

getHeightAtCoordinates works only under the assumption that certain variables exist and are the ones who built the mesh. It is a form of cache that is stored in the class itself to fetch the height with minimum realtime computations (check the _computeHeightQuads function of GroundMesh to understand what is being done).

You could create the same form of cache, and fetch it without rays. There will be a bit of computation needed at the beginning, but it will be rewarding afterwards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...