Horde3D

Next-Generation Graphics Engine
It is currently 06.05.2024, 01:15

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 21.06.2012, 09:04 
Offline

Joined: 21.06.2012, 08:54
Posts: 2
Hey all,
I'm using the Terrain Extension and I'm trying to set my character on the ground, but I didn't find how to get the terrain height at a specific position.
I know the castRay function, but I hope there is a better way to do that.
Thanks !


Top
 Profile  
Reply with quote  
PostPosted: 28.06.2012, 16:03 
Offline

Joined: 21.06.2012, 08:54
Posts: 2
Please, I really need help, I didn't found anything about it.
I saw some demos on youtube which managed to set models on the terrain, but the sources are not available.


Top
 Profile  
Reply with quote  
PostPosted: 29.06.2012, 06:52 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
There's no direct access to the _heightData array in the terrain extension. If you want to use the terrain in e.g. a physics engine for intersection tests, you should use the h3dextCreateTerrainGeoRes method to create a geometry resource for a specific level of detail. The terrain detail is normally adjusted based on the distance to the viewer, but I guess that's something that would not be usable for your use case (even I don't know exactly what you're using the height for).
So you can create a static geometry mesh resource with the complete terrain and use the vertex data for your physics calculation.
You can find an example in the GameEngine. The vertex data of the terrain is fetched in SceneGraphComponent.cpp Line 322 et seq. and is transfered to the bullet phyiscs engine in PhysicsComponent.cpp Line 233 et seq.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group