File tree Expand file tree Collapse file tree
Core/GameEngineDevice/Source/W3DDevice/GameClient Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2818,14 +2818,14 @@ void W3DView::setupWaypointPath(Bool orient)
28182818 Real angle = getAngle ();
28192819 for (i=1 ; i<m_mcwpInfo.numWaypoints ; i++) {
28202820 Vector2 dir (m_mcwpInfo.waypoints [i+1 ].x -m_mcwpInfo.waypoints [i].x , m_mcwpInfo.waypoints [i+1 ].y -m_mcwpInfo.waypoints [i].y );
2821- m_mcwpInfo.waySegLength [i] = dir.Length ();
2821+ const Real dirLength = dir.Length ();
2822+ m_mcwpInfo.waySegLength [i] = dirLength;
28222823 m_mcwpInfo.totalDistance += m_mcwpInfo.waySegLength [i];
2823- if (orient) {
2824- angle = WWMath::Acos (dir.X /m_mcwpInfo. waySegLength [i] );
2824+ if (orient && dirLength >= 0 . 1f ) {
2825+ angle = WWMath::Acos (dir.X /dirLength );
28252826 if (dir.Y <0 .0f ) {
28262827 angle = -angle;
28272828 }
2828-
28292829 // Default camera is rotated 90 degrees, so match.
28302830 angle -= PI /2 ;
28312831 normAngle (angle);
You can’t perform that action at this time.
0 commit comments