Skip to content

Commit 1a4dce8

Browse files
committed
Cleaned up redundant values.
1 parent fa3d876 commit 1a4dce8

File tree

2 files changed

+10
-28
lines changed

2 files changed

+10
-28
lines changed

src/Interface/Modules/Render/ES/systems/RenderTransBasicSys.cc

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class RenderBasicSysTrans :
9696
{}
9797
};
9898

99-
//Core::Geometry::Vector prevDir = Core::Geometry::Vector(0.0);
10099
std::vector<SortedObject> sortedObjects;
101100

102101
class DepthIndex {
@@ -216,8 +215,8 @@ class RenderBasicSysTrans :
216215
GLuint iboID = ibo.front().glid;
217216

218217
Core::Geometry::Vector dir(camera.front().data.worldToView[0][2],
219-
camera.front().data.worldToView[1][2],
220-
camera.front().data.worldToView[2][2]);
218+
camera.front().data.worldToView[1][2],
219+
camera.front().data.worldToView[2][2]);
221220

222221
if (!drawLines)
223222
{
@@ -226,7 +225,6 @@ class RenderBasicSysTrans :
226225
case RenderState::TransparencySortType::CONTINUOUS_SORT:
227226
{
228227
iboID = sortObjects(dir, ibo, pass, iboMan);
229-
//std::cout << "continuous" << std::endl;
230228
break;
231229
}
232230
case RenderState::TransparencySortType::UPDATE_SORT:
@@ -248,7 +246,7 @@ class RenderBasicSysTrans :
248246
}
249247

250248
Core::Geometry::Vector diff = sortedObjects[index].prevDir - dir;
251-
float distance = sqrtf(Core::Geometry::Dot(diff, diff));
249+
double distance = sqrtf(Core::Geometry::Dot(diff, diff));
252250
if (distance >= 1.23 || sortedObjects[index].mSortedID == 0)
253251
{
254252
if (sortedObjects[index].mSortedID != 0)
@@ -259,7 +257,6 @@ class RenderBasicSysTrans :
259257
sortedObjects[index].mSortedID = sortObjects(dir, ibo, pass, iboMan);
260258
}
261259
iboID = sortedObjects[index].mSortedID;
262-
//::cout << "update" << std::endl;
263260
break;
264261
}
265262
case RenderState::TransparencySortType::LISTS_SORT:
@@ -288,11 +285,6 @@ class RenderBasicSysTrans :
288285
iboNegZID = it->glid;
289286
}
290287

291-
Core::Geometry::Vector currentDir(camera.front().data.worldToView[0][2],
292-
camera.front().data.worldToView[1][2],
293-
camera.front().data.worldToView[2][2]);
294-
295-
296288
Core::Geometry::Vector absDir(abs(camera.front().data.worldToView[0][2]),
297289
abs(camera.front().data.worldToView[1][2]),
298290
abs(camera.front().data.worldToView[2][2]));
@@ -302,17 +294,16 @@ class RenderBasicSysTrans :
302294

303295
if (orZ == absDir.x())
304296
{
305-
iboID = currentDir.x() < orZ ? iboNegXID : iboXID;
297+
iboID = dir.x() < orZ ? iboNegXID : iboXID;
306298
}
307299
if (orZ == absDir.y())
308300
{
309-
iboID = currentDir.y() < orZ ? iboNegYID : iboYID;
301+
iboID = dir.y() < orZ ? iboNegYID : iboYID;
310302
}
311303
if (orZ == absDir.z())
312304
{
313-
iboID = currentDir.z() < orZ ? iboNegZID : iboZID;
305+
iboID = dir.z() < orZ ? iboNegZID : iboZID;
314306
}
315-
//std::cout << "lists" << std::endl;
316307
break;
317308
}
318309
}

src/Interface/Modules/Render/ES/systems/RenderTransColorMapSys.cc

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ class RenderColorMapSysTrans :
9393
{}
9494
};
9595

96-
//Core::Geometry::Vector prevDir = Core::Geometry::Vector(0.0);
9796
std::vector<SortedObject> sortedObjects;
9897

9998
class DepthIndex {
@@ -224,7 +223,6 @@ class RenderColorMapSysTrans :
224223
case RenderState::TransparencySortType::CONTINUOUS_SORT:
225224
{
226225
iboID = sortObjects(dir, ibo, pass, iboMan);
227-
//std::cout << "continuous" << std::endl;
228226
break;
229227
}
230228
case RenderState::TransparencySortType::UPDATE_SORT:
@@ -246,7 +244,7 @@ class RenderColorMapSysTrans :
246244
}
247245

248246
Core::Geometry::Vector diff = sortedObjects[index].prevDir - dir;
249-
float distance = sqrtf(Core::Geometry::Dot(diff, diff));
247+
double distance = sqrtf(Core::Geometry::Dot(diff, diff));
250248
if (distance >= 1.23 || sortedObjects[index].mSortedID == 0)
251249
{
252250
if (sortedObjects[index].mSortedID != 0)
@@ -257,7 +255,6 @@ class RenderColorMapSysTrans :
257255
sortedObjects[index].mSortedID = sortObjects(dir, ibo, pass, iboMan);
258256
}
259257
iboID = sortedObjects[index].mSortedID;
260-
//::cout << "update" << std::endl;
261258
break;
262259
}
263260
case RenderState::TransparencySortType::LISTS_SORT:
@@ -286,11 +283,6 @@ class RenderColorMapSysTrans :
286283
iboNegZID = it->glid;
287284
}
288285

289-
Core::Geometry::Vector currentDir(camera.front().data.worldToView[0][2],
290-
camera.front().data.worldToView[1][2],
291-
camera.front().data.worldToView[2][2]);
292-
293-
294286
Core::Geometry::Vector absDir(abs(camera.front().data.worldToView[0][2]),
295287
abs(camera.front().data.worldToView[1][2]),
296288
abs(camera.front().data.worldToView[2][2]));
@@ -300,17 +292,16 @@ class RenderColorMapSysTrans :
300292

301293
if (orZ == absDir.x())
302294
{
303-
iboID = currentDir.x() < orZ ? iboNegXID : iboXID;
295+
iboID = dir.x() < orZ ? iboNegXID : iboXID;
304296
}
305297
if (orZ == absDir.y())
306298
{
307-
iboID = currentDir.y() < orZ ? iboNegYID : iboYID;
299+
iboID = dir.y() < orZ ? iboNegYID : iboYID;
308300
}
309301
if (orZ == absDir.z())
310302
{
311-
iboID = currentDir.z() < orZ ? iboNegZID : iboZID;
303+
iboID = dir.z() < orZ ? iboNegZID : iboZID;
312304
}
313-
//std::cout << "lists" << std::endl;
314305
break;
315306
}
316307
}

0 commit comments

Comments
 (0)