From 5e829362cb2d7cb12b14c3316f854da5920aa6ea Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 31 Mar 2012 16:22:55 +0400 Subject: [PATCH] Feature #37 (In Progress) Render Path Grid more similar to vanilla path grid rendering --- apps/openmw/mwrender/debugging.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/debugging.cpp b/apps/openmw/mwrender/debugging.cpp index 179c6e0a4..f768de661 100644 --- a/apps/openmw/mwrender/debugging.cpp +++ b/apps/openmw/mwrender/debugging.cpp @@ -201,8 +201,13 @@ void Debugging::enableCellPathgrid(MWWorld::Ptr::CellStore *store) { ESM::Pathgrid::Edge edge = *it; ESM::Pathgrid::Point p1 = points[edge.v0], p2 = points[edge.v1]; - cellPathGrid->attachObject(createPathgridLine(Vector3(p1.x, p1.y, p1.z), - Vector3(p2.x, p2.y, p2.z))); + + Vector3 direction = (Vector3(p2.x, p2.y, p2.z) - Vector3(p1.x, p1.y, p1.z)); + Vector3 lineDisplacement = direction.crossProduct(Vector3::UNIT_Z).normalisedCopy(); + lineDisplacement = lineDisplacement * POINT_MESH_BASE/2 + + Vector3(0, 0, 10); // move lines up a little, so they will be less covered by meshes/landscape + cellPathGrid->attachObject(createPathgridLine(Vector3(p1.x, p1.y, p1.z) + lineDisplacement, + Vector3(p2.x, p2.y, p2.z) + lineDisplacement)); } if (store->cell->isExterior())