| 939 | } |
| 940 | |
| 941 | bool TerrainEditor::worldToGrid(const Point3F & wPos, GridPoint & gPoint) |
| 942 | { |
| 943 | PROFILE_SCOPE( TerrainEditor_WorldToGrid ); |
| 944 | |
| 945 | // If the grid point TerrainBlock is NULL then find the closest Terrain underneath that |
| 946 | // point - pad a little upward in case our incoming point already lies exactly on the terrain |
| 947 | if (!gPoint.terrainBlock) |
| 948 | gPoint.terrainBlock = getTerrainUnderWorldPoint(wPos + Point3F(0.0f, 0.0f, 0.05f)); |
| 949 | |
| 950 | if (gPoint.terrainBlock == NULL) |
| 951 | return false; |
| 952 | |
| 953 | gPoint.gridPos = gPoint.terrainBlock->getGridPos(wPos); |
| 954 | return isMainTile(gPoint); |
| 955 | } |
| 956 | |
| 957 | bool TerrainEditor::worldToGrid(const Point3F & wPos, Point2I & gPos, TerrainBlock* terrain) |
| 958 | { |
no test coverage detected