Skip to content

Commit f4e20fe

Browse files
committed
Remove TMoveAlongWaypointPathInfo::groundHeight
1 parent f82fb5e commit f4e20fe

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ typedef struct
5757
Real waySegLength[MAX_WAYPOINTS+2]; // Length of each segment;
5858
Real cameraAngle[MAX_WAYPOINTS+2]; // Camera Angle;
5959
Int timeMultiplier[MAX_WAYPOINTS+2]; // Time speedup factor.
60-
Real groundHeight[MAX_WAYPOINTS+1]; // Ground height.
6160
Real totalTimeMilliseconds; // Num of ms to do this movement.
6261
Real elapsedTimeMilliseconds; // Time since start.
6362
Real totalDistance; // Total length of paths.

Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,7 +3057,7 @@ void W3DView::setupWaypointPath(Bool orient)
30573057
Real factor2 = curDistance / m_mcwpInfo.totalDistance;
30583058
Real factor1 = 1.0-factor2;
30593059
m_mcwpInfo.timeMultiplier[i] = m_timeMultiplier;
3060-
m_mcwpInfo.groundHeight[i] = m_pos.z*factor1 + newGround*factor2;
3060+
m_mcwpInfo.waypoints[i].z = m_pos.z*factor1 + newGround*factor2;
30613061
curDistance += m_mcwpInfo.waySegLength[i];
30623062
//DEBUG_LOG(("New Index %d, angle %.2f", i, m_mcwpInfo.cameraAngle[i]*180/PI));
30633063
}
@@ -3068,9 +3068,8 @@ void W3DView::setupWaypointPath(Bool orient)
30683068
Coord3D prev = m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints-1];
30693069
m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints+1].x += cur.x-prev.x;
30703070
m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints+1].y += cur.y-prev.y;
3071+
m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints+1].z = newGround;
30713072
m_mcwpInfo.cameraAngle[m_mcwpInfo.numWaypoints+1] = m_mcwpInfo.cameraAngle[m_mcwpInfo.numWaypoints];
3072-
m_mcwpInfo.groundHeight[m_mcwpInfo.numWaypoints+1] = newGround;
3073-
30743073

30753074
cur = m_mcwpInfo.waypoints[2];
30763075
prev = m_mcwpInfo.waypoints[1];
@@ -3293,7 +3292,6 @@ void W3DView::moveAlongWaypointPath(Real milliseconds)
32933292
View::setAngle(m_mcwpInfo.cameraAngle[m_mcwpInfo.numWaypoints]);
32943293

32953294
Coord3D pos = m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints];
3296-
pos.z = m_mcwpInfo.groundHeight[m_mcwpInfo.numWaypoints];
32973295
setPosition(pos);
32983296
// Note - assuming that the scripter knows what he is doing, we adjust the constraints so that
32993297
// the scripted action can occur.
@@ -3396,8 +3394,8 @@ void W3DView::moveAlongWaypointPath(Real milliseconds)
33963394
result.y += factor*(end.y-start.y);
33973395
result.x += (1-factor)*factor*(mid.x-end.x + mid.x-start.x);
33983396
result.y += (1-factor)*factor*(mid.y-end.y + mid.y-start.y);
3399-
result.z = m_mcwpInfo.groundHeight[m_mcwpInfo.curSegment]*factor1 +
3400-
m_mcwpInfo.groundHeight[m_mcwpInfo.curSegment+1]*factor2;
3397+
result.z = m_mcwpInfo.waypoints[m_mcwpInfo.curSegment].z*factor1 +
3398+
m_mcwpInfo.waypoints[m_mcwpInfo.curSegment+1].z*factor2;
34013399
/*
34023400
DEBUG_LOG(("Dx %.2f, dy %.2f, DeltaANgle = %.2f, %.2f DeltaGround %.2f", m_pos.x-result.x, m_pos.y-result.y, deltaAngle, result.z, result.z-m_pos.z));
34033401
*/

0 commit comments

Comments
 (0)