Game Development Community

Get height of atlas

by Justin Mosiman · in Torque Game Engine Advanced · 11/16/2006 (8:20 pm) · 3 replies

Hi,

If I'm trying to determine the height of the atlas terrain at a particular point, what is the best way to do that? I looked through atlasHeightfield.h and I saw
HeightType &sample(const Point2I pos) const
But I haven't worked with atlas too much so I don't know if this would work. I also saw this which says that castRay would probably be the best, but since that was from over a year ago I don't know if that is still the best option.

I want to know the height of the terrain so that I will be able to tell if the camera is above the terrain.

Thanks,
Justin

#1
11/20/2006 (5:42 pm)
Any input?

Thanks
#2
11/20/2006 (5:58 pm)
I use a castRay. Definatly not the best way, but I had to move on and it works.
#3
11/21/2006 (1:37 pm)
Justin, take a look in the foliage replicator code. As it places each item, it does a raycast straight down at the potential coordinate for the tree.