@@ -926,8 +926,6 @@ private void UpdateCouplers(RenderFrame frame, ElapsedTime elapsedTime)
926
926
Z = ( Car . FrontCouplerAnimLengthM + ( Car . CarLengthM / 2.0f ) + Car . FrontCouplerSlackM - Car . WagonFrontCouplerCurveExtM )
927
927
} ;
928
928
929
- var tempZ = ( Car . FrontCouplerAnimLengthM + ( Car . CarLengthM / 2.0f ) + Car . FrontCouplerSlackM - Car . WagonFrontCouplerCurveExtM ) ;
930
-
931
929
if ( Car . CarAhead != null ) // Display animated coupler if there is a car infront of this car
932
930
{
933
931
var quaternion = PositionCoupler ( Car , FrontCouplerShape , displacement ) ;
@@ -949,6 +947,8 @@ private void UpdateCouplers(RenderFrame frame, ElapsedTime elapsedTime)
949
947
if ( ( absXc > 0.005 || absYc > 0.005 || absZc > 0.005 ) )
950
948
{
951
949
FrontCouplerShape . Location . Location = Car . CarAhead . RearCouplerLocation ; // Set coupler to same location as previous car coupler
950
+ FrontCouplerShape . Location . TileX = Car . CarAhead . RearCouplerLocationTileX ;
951
+ FrontCouplerShape . Location . TileZ = Car . CarAhead . RearCouplerLocationTileZ ;
952
952
}
953
953
954
954
// Display Animation Shape
@@ -1001,7 +1001,11 @@ private void UpdateCouplers(RenderFrame frame, ElapsedTime elapsedTime)
1001
1001
// Display Animation Shape
1002
1002
RearCouplerShape . PrepareFrame ( frame , elapsedTime ) ;
1003
1003
1004
+ // Save coupler location for use on following car front coupler
1004
1005
Car . RearCouplerLocation = RearCouplerShape . Location . Location ;
1006
+ Car . RearCouplerLocationTileX = RearCouplerShape . Location . TileX ;
1007
+ Car . RearCouplerLocationTileZ = RearCouplerShape . Location . TileZ ;
1008
+
1005
1009
}
1006
1010
else if ( RearCouplerOpenShape != null && Car . RearCouplerOpenFitted && Car . RearCouplerOpen ) // Display open coupler if no car is behind car, and an open coupler shape is present
1007
1011
{
0 commit comments