Game Development Community

Fix for missing terrain brush when "tiled" is turned off

by Matt Fairfax · in Torque Game Engine · 06/09/2007 (5:36 pm) · 2 replies

Whenever you disable/uncheck "tiled" on a TerrainBlock you can no longer use the TerrainEditor to make changes to it.

It turns out that this is because of a *long* standing bug in TerrainEditor::collide() where it was using the wrong transform.

To fix this go into editor\terrainEditor.cc and find bool TerrainEditor::collide() and change this code:

mTerrainBlock->getTransform().mulP(startPnt, &tStartPnt);
   mTerrainBlock->getTransform().mulP(endPnt, &tEndPnt);

to

mTerrainBlock->getWorldTransform().mulP(startPnt, &tStartPnt);
   mTerrainBlock->getWorldTransform().mulP(endPnt, &tEndPnt);

This should fix you right up and allow you to edit the terrain when the tiling is off.

About the author

By day, I am a senior programmer at The Playforge, makers of the popular iPhone game Zombie Farm. By night, I work on my own games as Night Heron Games. I am an ex-GarageGames employee who helped ship TGE, TGEA, Torque 3D, and Constructor.


#1
06/09/2007 (6:02 pm)
This will also fix any issues you might have with the RTS starter kit and turning tiling off.