@@ -101,6 +101,12 @@ public GltfShape(Viewer viewer, string filePath)
101101 CustomAnimationFPS = 1 ;
102102 EnableAnimations = viewer . Game . Settings . GltfAnimations ;
103103 ShapeWarnings = ! viewer . Game . Settings . SuppressShapeWarnings ;
104+
105+ if ( ConsistGenerator . GltfVisualTestRun )
106+ {
107+ if ( ! SampleModelsAdjustments . TryGetValue ( Path . GetFileNameWithoutExtension ( FilePath ) , out SampleModelsAdjustment ) )
108+ SampleModelsAdjustment = Matrix . Identity ;
109+ }
104110 }
105111
106112 protected override void LoadContent ( )
@@ -185,8 +191,8 @@ public override Matrix SetRenderMatrices(ShapePrimitive baseShapePrimitive, Matr
185191 Matrix . Multiply ( ref bone , ref PlusZToForward , out bone ) ;
186192
187193 // The ConsistGenerator is used to show all the Khronos sample models for testing purposes. However they need adjustments to show them all at once.
188- if ( ConsistGenerator . GltfVisualTestRun && SampleModelsAdjustments . TryGetValue ( Path . GetFileNameWithoutExtension ( FilePath ) , out var adjustment ) )
189- Matrix . Multiply ( ref bone , ref adjustment , out bone ) ;
194+ if ( ConsistGenerator . GltfVisualTestRun )
195+ bone *= SampleModelsAdjustment ;
190196
191197 Matrix . Multiply ( ref bone , ref tileTranslation , out bone ) ;
192198
@@ -1793,6 +1799,7 @@ public void Animate(int animationNumber, float time, Matrix[] animatedMatrices)
17931799 { "VertexColorTest" . ToLower ( ) , Matrix . CreateScale ( 2 ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
17941800 { "WaterBottle" . ToLower ( ) , Matrix . CreateScale ( 7 ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
17951801 } ;
1802+ readonly Matrix SampleModelsAdjustment ;
17961803 }
17971804
17981805 class GltfAnimation
0 commit comments