Skip to content

Commit 1415271

Browse files
committed
Remove TMoveAlongWaypointPathInfo::groundHeight
1 parent 22c02df commit 1415271

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
@@ -3068,7 +3068,7 @@ void W3DView::setupWaypointPath(Bool orient)
30683068
Real factor2 = curDistance / m_mcwpInfo.totalDistance;
30693069
Real factor1 = 1.0-factor2;
30703070
m_mcwpInfo.timeMultiplier[i] = m_timeMultiplier;
3071-
m_mcwpInfo.groundHeight[i] = m_pos.z*factor1 + newGround*factor2;
3071+
m_mcwpInfo.waypoints[i].z = m_pos.z*factor1 + newGround*factor2;
30723072
curDistance += m_mcwpInfo.waySegLength[i];
30733073
//DEBUG_LOG(("New Index %d, angle %.2f", i, m_mcwpInfo.cameraAngle[i]*180/PI));
30743074
}
@@ -3079,9 +3079,8 @@ void W3DView::setupWaypointPath(Bool orient)
30793079
Coord3D prev = m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints-1];
30803080
m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints+1].x += cur.x-prev.x;
30813081
m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints+1].y += cur.y-prev.y;
3082+
m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints+1].z = newGround;
30823083
m_mcwpInfo.cameraAngle[m_mcwpInfo.numWaypoints+1] = m_mcwpInfo.cameraAngle[m_mcwpInfo.numWaypoints];
3083-
m_mcwpInfo.groundHeight[m_mcwpInfo.numWaypoints+1] = newGround;
3084-
30853084

30863085
cur = m_mcwpInfo.waypoints[2];
30873086
prev = m_mcwpInfo.waypoints[1];
@@ -3304,7 +3303,6 @@ void W3DView::moveAlongWaypointPath(Real milliseconds)
33043303
View::setAngle(m_mcwpInfo.cameraAngle[m_mcwpInfo.numWaypoints]);
33053304

33063305
Coord3D pos = m_mcwpInfo.waypoints[m_mcwpInfo.numWaypoints];
3307-
pos.z = m_mcwpInfo.groundHeight[m_mcwpInfo.numWaypoints];
33083306
setPosition(pos);
33093307
// Note - assuming that the scripter knows what he is doing, we adjust the constraints so that
33103308
// the scripted action can occur.
@@ -3407,8 +3405,8 @@ void W3DView::moveAlongWaypointPath(Real milliseconds)
34073405
result.y += factor*(end.y-start.y);
34083406
result.x += (1-factor)*factor*(mid.x-end.x + mid.x-start.x);
34093407
result.y += (1-factor)*factor*(mid.y-end.y + mid.y-start.y);
3410-
result.z = m_mcwpInfo.groundHeight[m_mcwpInfo.curSegment]*factor1 +
3411-
m_mcwpInfo.groundHeight[m_mcwpInfo.curSegment+1]*factor2;
3408+
result.z = m_mcwpInfo.waypoints[m_mcwpInfo.curSegment].z*factor1 +
3409+
m_mcwpInfo.waypoints[m_mcwpInfo.curSegment+1].z*factor2;
34123410
/*
34133411
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));
34143412
*/

0 commit comments

Comments
 (0)