@@ -2336,8 +2336,8 @@ public virtual int GetDrawIndex()
23362336 float NormalizedMouseMovement ( )
23372337 {
23382338 return ( ControlDiscrete . Orientation > 0
2339- ? ( float ) UserInput . MouseMoveY / ( float ) Control . Height
2340- : ( float ) UserInput . MouseMoveX / ( float ) Control . Width )
2339+ ? ( float ) ( UserInput . MouseMoveY + UserInput . MouseWheelChange ) / ( float ) Control . Height
2340+ : ( float ) ( UserInput . MouseMoveX + UserInput . MouseWheelChange ) / ( float ) Control . Width )
23412341 * ( ControlDiscrete . Direction > 0 ? - 1 : 1 ) ;
23422342 }
23432343
@@ -3367,10 +3367,15 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
33673367 break ;
33683368 }
33693369
3370+ // This is the case for .s files, for glTF-s it will not be true
3371+ var targetNode = iMatrix ;
3372+
33703373 if ( style != null && style is CabViewDigitalRenderer ) //digits?
33713374 {
33723375 //DigitParts.Add(key, new DigitalDisplay(viewer, TrainCarShape, iMatrix, parameter, locoViewer.ThreeDimentionCabRenderer.ControlMap[key]));
33733376 DigitParts3D . Add ( key , new ThreeDimCabDigit ( viewer , iMatrix , parameter1 , parameter2 , this . TrainCarShape , locoViewer . ThreeDimentionCabRenderer . ControlMap [ key ] , Locomotive ) ) ;
3377+ if ( ! TrainCarShape . SharedShape . StoredResultMatrixes . ContainsKey ( targetNode ) )
3378+ TrainCarShape . SharedShape . StoredResultMatrixes . Add ( targetNode , Matrix . Identity ) ;
33743379 }
33753380 else if ( style != null && style is CabViewGaugeRenderer )
33763381 {
@@ -3379,6 +3384,8 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
33793384 if ( CVFR . GetGauge ( ) . ControlStyle != CABViewControlStyles . POINTER ) //pointer will be animated, others will be drawn dynamicaly
33803385 {
33813386 Gauges . Add ( key , new ThreeDimCabGaugeNative ( viewer , iMatrix , parameter1 , parameter2 , this . TrainCarShape , locoViewer . ThreeDimentionCabRenderer . ControlMap [ key ] ) ) ;
3387+ if ( ! TrainCarShape . SharedShape . StoredResultMatrixes . ContainsKey ( targetNode ) )
3388+ TrainCarShape . SharedShape . StoredResultMatrixes . Add ( targetNode , Matrix . Identity ) ;
33823389 }
33833390 else
33843391 { //for pointer animation
@@ -3390,11 +3397,15 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
33903397 }
33913398 else tmpPart = AnimateParts [ key ] ;
33923399 tmpPart . AddMatrix ( iMatrix ) ; //tmpPart.SetPosition(false);
3400+ if ( ! TrainCarShape . SharedShape . StoredResultMatrixes . ContainsKey ( targetNode ) )
3401+ TrainCarShape . SharedShape . StoredResultMatrixes . Add ( targetNode , Matrix . Identity ) ;
33933402 }
33943403 }
33953404 else if ( style != null && style is DistributedPowerInterfaceRenderer )
33963405 {
33973406 DPIDisplays3D . Add ( key , new ThreeDimCabDPI ( viewer , iMatrix , parameter1 , parameter2 , this . TrainCarShape , locoViewer . ThreeDimentionCabRenderer . ControlMap [ key ] ) ) ;
3407+ if ( ! TrainCarShape . SharedShape . StoredResultMatrixes . ContainsKey ( targetNode ) )
3408+ TrainCarShape . SharedShape . StoredResultMatrixes . Add ( targetNode , Matrix . Identity ) ;
33983409 }
33993410 else
34003411 {
@@ -3406,6 +3417,8 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
34063417 }
34073418 else tmpPart = AnimateParts [ key ] ;
34083419 tmpPart . AddMatrix ( iMatrix ) ; //tmpPart.SetPosition(false);
3420+ if ( ! TrainCarShape . SharedShape . StoredResultMatrixes . ContainsKey ( targetNode ) )
3421+ TrainCarShape . SharedShape . StoredResultMatrixes . Add ( targetNode , Matrix . Identity ) ;
34093422 }
34103423 }
34113424 }
0 commit comments