|
@@ -197,8 +197,8 @@ public:
|
|
|
vert->m_x = (float)x;
|
|
vert->m_x = (float)x;
|
|
|
vert->m_y = m_terrain.m_heightMap[(y * s_terrainSize) + x];
|
|
vert->m_y = m_terrain.m_heightMap[(y * s_terrainSize) + x];
|
|
|
vert->m_z = (float)y;
|
|
vert->m_z = (float)y;
|
|
|
- vert->m_u = (float)x / (float)s_terrainSize;
|
|
|
|
|
- vert->m_v = (float)y / (float)s_terrainSize;
|
|
|
|
|
|
|
+ vert->m_u = (x + 0.5f) / s_terrainSize;
|
|
|
|
|
+ vert->m_v = (y + 0.5f) / s_terrainSize;
|
|
|
|
|
|
|
|
m_terrain.m_vertexCount++;
|
|
m_terrain.m_vertexCount++;
|
|
|
}
|
|
}
|
|
@@ -298,14 +298,14 @@ public:
|
|
|
{
|
|
{
|
|
|
int32_t brush_x = _x + area_x;
|
|
int32_t brush_x = _x + area_x;
|
|
|
if (brush_x < 0
|
|
if (brush_x < 0
|
|
|
- || brush_x > (int32_t)s_terrainSize)
|
|
|
|
|
|
|
+ || brush_x >= (int32_t)s_terrainSize)
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int32_t brush_y = _y + area_y;
|
|
int32_t brush_y = _y + area_y;
|
|
|
if (brush_y < 0
|
|
if (brush_y < 0
|
|
|
- || brush_y > (int32_t)s_terrainSize)
|
|
|
|
|
|
|
+ || brush_y >= (int32_t)s_terrainSize)
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
@@ -365,9 +365,9 @@ public:
|
|
|
bx::vec3Add(pos, pos, ray_dir);
|
|
bx::vec3Add(pos, pos, ray_dir);
|
|
|
|
|
|
|
|
if (pos[0] < 0
|
|
if (pos[0] < 0
|
|
|
- || pos[0] > s_terrainSize
|
|
|
|
|
|
|
+ || pos[0] >= s_terrainSize
|
|
|
|| pos[2] < 0
|
|
|| pos[2] < 0
|
|
|
- || pos[2] > s_terrainSize)
|
|
|
|
|
|
|
+ || pos[2] >= s_terrainSize)
|
|
|
{
|
|
{
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|