@@ -177,7 +177,7 @@ public override Matrix SetRenderMatrices(ShapePrimitive baseShapePrimitive, Matr
177
177
Matrix . Multiply ( ref bones [ j ] , ref PlusZToForward , out bones [ j ] ) ;
178
178
179
179
// The ConsistGenerator is used to show all the Khronos sample models for testing purposes. However they need adjustments to show them all at once.
180
- if ( ConsistGenerator . GeneratedRun && SampleModelsAdjustments . TryGetValue ( Path . GetFileNameWithoutExtension ( FilePath ) , out var adjustment ) )
180
+ if ( ConsistGenerator . GltfVisualTestRun && SampleModelsAdjustments . TryGetValue ( Path . GetFileNameWithoutExtension ( FilePath ) , out var adjustment ) )
181
181
Matrix . Multiply ( ref bones [ j ] , ref adjustment , out bones [ j ] ) ;
182
182
183
183
Matrix . Multiply ( ref bones [ j ] , ref tileTranslation , out bones [ j ] ) ;
@@ -338,6 +338,7 @@ public class GltfDistanceLevel : DistanceLevel
338
338
internal readonly GltfShape Shape ;
339
339
340
340
static readonly Stack < int > TempStack = new Stack < int > ( ) ; // (nodeNumber, parentIndex)
341
+ static readonly string [ ] TestControls = new [ ] { "WIPER" , "ORTSBELL" , "ORTSITEM1CONTINUOUS" , "ORTSITEM1CONTINUOUS" } ;
341
342
342
343
public GltfDistanceLevel ( GltfShape shape , int lodId , Gltf gltfFile , string gltfFileName )
343
344
{
@@ -487,7 +488,7 @@ public GltfDistanceLevel(GltfShape shape, int lodId, Gltf gltfFile, string gltfF
487
488
// Use MatrixNames for storing animation and articulation names.
488
489
// Here the MatrixNames are not bound to nodes (and matrices), but rather to the animation number.
489
490
shape . MatrixNames [ j ] = gltfAnimation . Name ?? "" ;
490
- var animation = new GltfAnimation ( gltfAnimation . Name ) ;
491
+ var animation = new GltfAnimation ( shape . MatrixNames [ j ] ) ;
491
492
492
493
for ( var k = 0 ; k < gltfAnimation . Channels . Length ; k ++ )
493
494
{
@@ -558,7 +559,14 @@ public GltfDistanceLevel(GltfShape shape, int lodId, Gltf gltfFile, string gltfF
558
559
}
559
560
}
560
561
561
- //if (shape.GltfAnimations.Count > 0) { shape.GltfAnimations.Add(shape.GltfAnimations[0]); shape.MatrixNames[shape.GltfAnimations.Count - 1] = "ORTSITEM1CONTINUOUS"; }
562
+ if ( ConsistGenerator . GltfVisualTestRun )
563
+ {
564
+ // Assign the first four animations to Wipers [V], Bell [Shift+B], Item1Continuous [Shift+,], Item2Continuous [Shift+.] respectively,
565
+ // because these are the ones capable of playing a loop.
566
+ for ( var i = 0 ; i < shape . GltfAnimations . Count ; i ++ )
567
+ if ( i < TestControls . Length )
568
+ shape . MatrixNames [ i ] = TestControls [ i ] ;
569
+ }
562
570
}
563
571
}
564
572
@@ -1784,6 +1792,7 @@ public void Animate(int animationNumber, float time, Matrix[] animatedMatrices)
1784
1792
{ "AnimatedCube" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1785
1793
{ "AnimatedMorphCube" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1786
1794
{ "AnimatedMorphSphere" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1795
+ { "AnimatedTriangle" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 1 , 0 ) } ,
1787
1796
{ "AntiqueCamera" . ToLower ( ) , Matrix . CreateScale ( 0.5f ) } ,
1788
1797
{ "AttenuationTest" . ToLower ( ) , Matrix . CreateScale ( 0.3f ) * Matrix . CreateTranslation ( 0 , 4 , 0 ) } ,
1789
1798
{ "Avocado" . ToLower ( ) , Matrix . CreateScale ( 50 ) } ,
@@ -1826,16 +1835,27 @@ public void Animate(int animationNumber, float time, Matrix[] animatedMatrices)
1826
1835
{ "OrientationTest" . ToLower ( ) , Matrix . CreateScale ( 0.2f ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1827
1836
{ "ReciprocatingSaw" . ToLower ( ) , Matrix . CreateScale ( 0.02f ) * Matrix . CreateTranslation ( 0 , 3 , 0 ) } ,
1828
1837
{ "RecursiveSkeletons" . ToLower ( ) , Matrix . CreateScale ( 0.05f ) } ,
1829
- { "RiggedSimple" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 8 , 0 ) } ,
1838
+ { "RiggedSimple" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 5 , 0 ) } ,
1830
1839
{ "SciFiHelmet" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1831
1840
{ "SheenChair" . ToLower ( ) , Matrix . CreateScale ( 2 ) } ,
1832
- { "SheenCloth" . ToLower ( ) , Matrix . CreateScale ( 20 ) } ,
1833
- { "SpecGlossVsMetalRough" . ToLower ( ) , Matrix . CreateScale ( 5 ) } ,
1834
- { "SpecularTest" . ToLower ( ) , Matrix . CreateScale ( 3 ) } ,
1841
+ { "SheenCloth" . ToLower ( ) , Matrix . CreateScale ( 50 ) } ,
1842
+ { "SpecGlossVsMetalRough" . ToLower ( ) , Matrix . CreateScale ( 7 ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1843
+ { "SpecularTest" . ToLower ( ) , Matrix . CreateScale ( 3 ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1835
1844
{ "StainedGlassLamp" . ToLower ( ) , Matrix . CreateScale ( 3 ) } ,
1836
1845
{ "Suzanne" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1837
1846
{ "TextureCoordinateTest" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1838
- { "TextureEncodingTest" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 6 , 0 ) } ,
1847
+ { "TextureEncodingTest" . ToLower ( ) , Matrix . CreateScale ( 0.5f ) * Matrix . CreateTranslation ( 0 , 3 , 0 ) } ,
1848
+ { "TextureLinearInterpolationTest" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1849
+ { "TextureSettingsTest" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 6 , 0 ) } ,
1850
+ { "TextureTransformMultiTest" . ToLower ( ) , Matrix . CreateScale ( 2 ) * Matrix . CreateTranslation ( 0 , 4 , 0 ) } ,
1851
+ { "TextureTransformTest" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1852
+ { "ToyCar" . ToLower ( ) , Matrix . CreateScale ( 80 ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1853
+ { "TransmissionRoughnessTest" . ToLower ( ) , Matrix . CreateScale ( 5 ) * Matrix . CreateTranslation ( 0 , 3 , 0 ) } ,
1854
+ { "TransmissionTest" . ToLower ( ) , Matrix . CreateScale ( 3 ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1855
+ { "TwoSidedPlane" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 1 , 0 ) } ,
1856
+ { "UnlitTest" . ToLower ( ) , Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1857
+ { "VertexColorTest" . ToLower ( ) , Matrix . CreateScale ( 2 ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1858
+ { "WaterBottle" . ToLower ( ) , Matrix . CreateScale ( 7 ) * Matrix . CreateTranslation ( 0 , 2 , 0 ) } ,
1839
1859
} ;
1840
1860
}
1841
1861
0 commit comments