Jump to content

Getting the characteristic of terrain at a location


photo

Recommended Posts

Hello,

Whan landing an helicopter, I need to find out the type of terrain below the landing gears in order to simulate a slippery or a muddy contact. 

Is there any way to have access to the terrain layers information for a location?

Is it possible to know if a location is within the modified array of a decal?

Thank you.

Link to comment

Hi Amerio,

There is no such functionality out of the box. If you already have information about the terrain type at the certain coordinates you can write some additional logic that would take coordinates of the wheels and perform some kind of search in your data (since it's not related to render, you can do it in a separate thread).

Another solution might be to use Triggers to specify which area is there (but it may be too costly if you have thousands of triggers in the same scene).

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hi,

are these landing locations predefined? If so you can:

  • create mesh with viewport mask (we don't need to render this one, right?)
  • disable collision for this mesh
  • assign material (dirt, grass, etc)
  • find an intersection with this mesh when landing via getIntersection 
  • enable different logic depending on the material you've found

Alternatively, you can find the required info from detail layer, but since you can blend a lot of details in one area this could be hard to implement.

Thank you!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hi silent and morbid.

The locations are not always predefined, so it's hard to manually add meshes on the terrain.

With detail layer, I don't understand how to get access to a specific location. Is it possible to get the "color" for a location ? Would you have an example code?

Link to comment

Hi,

sorry, I had wrong assumption about detail layers. 

If you want to detect terrain type in any area it's better to stick to silent's proposition. You can store the data on terrain types separately and check where exactly you're landing right now. It could be a texture paired to the virtual world coordinates.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Thanks silent, I'll look into it. An sample with this would come in handy :)

I would suggest for a future version to integrate the ability to query at run time the layers defined with the Landscape editor.

Thanks.

Link to comment
×
×
  • Create New...