From 870acaf5e4da9e04c5e79ca5bdd780ef450b5c05 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Thu, 15 Mar 2018 20:44:13 -0500 Subject: [PATCH] gfxDrawutil, gizmo shadowvar cleanups --- Engine/source/gfx/gfxDrawUtil.cpp | 14 +++++++------- Engine/source/gui/worldEditor/gizmo.cpp | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Engine/source/gfx/gfxDrawUtil.cpp b/Engine/source/gfx/gfxDrawUtil.cpp index 0e7a4b3e9..131d7ccaa 100644 --- a/Engine/source/gfx/gfxDrawUtil.cpp +++ b/Engine/source/gfx/gfxDrawUtil.cpp @@ -1041,9 +1041,9 @@ void GFXDrawUtil::_drawSolidPolyhedron( const GFXStateBlockDesc &desc, const Any continue; } - U32 numPoints = poly.extractFace( i, &indices[ idx ], numIndices - idx ); - numIndicesForPoly[ numPolys ] = numPoints; - idx += numPoints; + U32 polyIDx = poly.extractFace( i, &indices[ idx ], numIndices - idx ); + numIndicesForPoly[ numPolys ] = polyIDx; + idx += polyIDx; numPolys ++; } @@ -1083,11 +1083,11 @@ void GFXDrawUtil::drawObjectBox( const GFXStateBlockDesc &desc, const Point3F &s PrimBuild::color( color ); PrimBuild::begin( GFXLineList, 48 ); - static const Point3F cubePoints[8] = + Point3F cubePts[8]; + for (U32 i = 0; i < 8; i++) { - Point3F(-0.5, -0.5, -0.5), Point3F(-0.5, -0.5, 0.5), Point3F(-0.5, 0.5, -0.5), Point3F(-0.5, 0.5, 0.5), - Point3F( 0.5, -0.5, -0.5), Point3F( 0.5, -0.5, 0.5), Point3F( 0.5, 0.5, -0.5), Point3F( 0.5, 0.5, 0.5) - }; + cubePts[i] = cubePoints[i]/2; + } // 8 corner points of the box for ( U32 i = 0; i < 8; i++ ) diff --git a/Engine/source/gui/worldEditor/gizmo.cpp b/Engine/source/gui/worldEditor/gizmo.cpp index 029cae110..a74202f81 100644 --- a/Engine/source/gui/worldEditor/gizmo.cpp +++ b/Engine/source/gui/worldEditor/gizmo.cpp @@ -612,12 +612,12 @@ bool Gizmo::collideAxisGizmo( const Gui3DMouseEvent & event ) Point3F(mOrigin + (p1 + p2) * scale) }; - Point3F end = camPos + event.vec * smProjectDistance; - F32 t = plane.intersect(camPos, end); + Point3F endProj = camPos + event.vec * smProjectDistance; + F32 t = plane.intersect(camPos, endProj); if ( t >= 0 && t <= 1 ) { Point3F pos; - pos.interpolate(camPos, end, t); + pos.interpolate(camPos, endProj, t); // check if inside our 'poly' of this axisIdx vector... bool inside = true;