@@ -2336,8 +2336,8 @@ public virtual int GetDrawIndex()
2336
2336
float NormalizedMouseMovement ( )
2337
2337
{
2338
2338
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 )
2341
2341
* ( ControlDiscrete . Direction > 0 ? - 1 : 1 ) ;
2342
2342
}
2343
2343
@@ -3367,10 +3367,15 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
3367
3367
break ;
3368
3368
}
3369
3369
3370
+ // This is the case for .s files, for glTF-s it will not be true
3371
+ var targetNode = iMatrix ;
3372
+
3370
3373
if ( style != null && style is CabViewDigitalRenderer ) //digits?
3371
3374
{
3372
3375
//DigitParts.Add(key, new DigitalDisplay(viewer, TrainCarShape, iMatrix, parameter, locoViewer.ThreeDimentionCabRenderer.ControlMap[key]));
3373
3376
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 ) ;
3374
3379
}
3375
3380
else if ( style != null && style is CabViewGaugeRenderer )
3376
3381
{
@@ -3379,6 +3384,8 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
3379
3384
if ( CVFR . GetGauge ( ) . ControlStyle != CABViewControlStyles . POINTER ) //pointer will be animated, others will be drawn dynamicaly
3380
3385
{
3381
3386
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 ) ;
3382
3389
}
3383
3390
else
3384
3391
{ //for pointer animation
@@ -3390,11 +3397,15 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
3390
3397
}
3391
3398
else tmpPart = AnimateParts [ key ] ;
3392
3399
tmpPart . AddMatrix ( iMatrix ) ; //tmpPart.SetPosition(false);
3400
+ if ( ! TrainCarShape . SharedShape . StoredResultMatrixes . ContainsKey ( targetNode ) )
3401
+ TrainCarShape . SharedShape . StoredResultMatrixes . Add ( targetNode , Matrix . Identity ) ;
3393
3402
}
3394
3403
}
3395
3404
else if ( style != null && style is DistributedPowerInterfaceRenderer )
3396
3405
{
3397
3406
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 ) ;
3398
3409
}
3399
3410
else
3400
3411
{
@@ -3406,6 +3417,8 @@ public ThreeDimentionCabViewer(Viewer viewer, MSTSLocomotive car, MSTSLocomotive
3406
3417
}
3407
3418
else tmpPart = AnimateParts [ key ] ;
3408
3419
tmpPart . AddMatrix ( iMatrix ) ; //tmpPart.SetPosition(false);
3420
+ if ( ! TrainCarShape . SharedShape . StoredResultMatrixes . ContainsKey ( targetNode ) )
3421
+ TrainCarShape . SharedShape . StoredResultMatrixes . Add ( targetNode , Matrix . Identity ) ;
3409
3422
}
3410
3423
}
3411
3424
}
0 commit comments