Game Development Community

Terrain Editor Code

by RedCore · in Torque Game Engine · 07/11/2004 (10:53 pm) · 1 replies

Can anyone explain what these 3 functions do?

TerrainEditor::gridToWorld(const Point2I & gPos, Point3F & wPos)

I'm thinking this one takes a 2d position and convertes it to 3d coords (assuming the position is withing the gui)

TerrainEditor::worldToGrid(const Point3F & wPos, Point2I & gPos)

I'm guessing this one does he opposite of the first one

TerrainEditor::gridToCenter(const Point2I & gPos, Point2I & cPos)

and i have no clue what this does..

can someone correct me or explain what these do?

I'm basically trying to find the center of the grid.. (if you open up the terrain editor and select an option you can 'highlight' the terrain with a grid.. i want to find the center position of that grid.. in 3d)

anyhelp would be appreciated

#1
07/11/2004 (11:00 pm)
Why not add half the square size to the results of worldToGrid/gridToWorld?