@@ -2986,7 +2986,7 @@ public ThreeDimCabDigit(Viewer viewer, int iMatrix, string size, string aceFile,
2986
2986
2987
2987
//create the shape primitive
2988
2988
shapePrimitive = new MutableShapePrimitive ( Material , NumVertices , NumIndices , new [ ] { - 1 } , 0 ) ;
2989
- UpdateShapePrimitive ( ) ;
2989
+ UpdateShapePrimitive ( Material ) ;
2990
2990
2991
2991
}
2992
2992
@@ -3085,11 +3085,11 @@ public void UpdateDigit()
3085
3085
}
3086
3086
3087
3087
//update the shape primitive
3088
- UpdateShapePrimitive ( ) ;
3088
+ UpdateShapePrimitive ( UsedMaterial ) ;
3089
3089
3090
3090
}
3091
3091
3092
- private void UpdateShapePrimitive ( )
3092
+ private void UpdateShapePrimitive ( Material material )
3093
3093
{
3094
3094
var indexData = new short [ NumIndices ] ;
3095
3095
Array . Copy ( TriangleListIndices , indexData , NumIndices ) ;
@@ -3098,6 +3098,8 @@ private void UpdateShapePrimitive()
3098
3098
var vertexData = new VertexPositionNormalTexture [ NumVertices ] ;
3099
3099
Array . Copy ( VertexList , vertexData , NumVertices ) ;
3100
3100
shapePrimitive . SetVertexData ( vertexData , 0 , NumVertices , NumIndices / 3 ) ;
3101
+
3102
+ shapePrimitive . SetMaterial ( material ) ;
3101
3103
}
3102
3104
3103
3105
//ACE MAP:
@@ -3216,8 +3218,9 @@ public ThreeDimCabGaugeNative(Viewer viewer, int iMatrix, string size, string le
3216
3218
3217
3219
3218
3220
//create the shape primitive
3219
- shapePrimitive = new MutableShapePrimitive ( FindMaterial ( ) , NumVertices , NumIndices , new [ ] { - 1 } , 0 ) ;
3220
- UpdateShapePrimitive ( ) ;
3221
+ var material = FindMaterial ( ) ;
3222
+ shapePrimitive = new MutableShapePrimitive ( material , NumVertices , NumIndices , new [ ] { - 1 } , 0 ) ;
3223
+ UpdateShapePrimitive ( material ) ;
3221
3224
3222
3225
}
3223
3226
@@ -3229,13 +3232,14 @@ Material FindMaterial()
3229
3232
{
3230
3233
if ( PositiveMaterial == null )
3231
3234
{
3232
- PositiveMaterial = new SolidColorMaterial ( this . Viewer , 0f , c . R , c . G , c . B ) ;
3235
+ PositiveMaterial = new SolidColorMaterial ( this . Viewer , c . A , c . R , c . G , c . B ) ;
3233
3236
}
3234
3237
return PositiveMaterial ;
3235
3238
}
3236
3239
else
3237
3240
{
3238
- if ( NegativeMaterial == null ) NegativeMaterial = new SolidColorMaterial ( this . Viewer , c . A , c . R , c . G , c . B ) ;
3241
+ if ( NegativeMaterial == null )
3242
+ NegativeMaterial = new SolidColorMaterial ( this . Viewer , c . A , c . R , c . G , c . B ) ;
3239
3243
return NegativeMaterial ;
3240
3244
}
3241
3245
}
@@ -3298,7 +3302,7 @@ public void UpdateDigit()
3298
3302
NumVertices += 4 ;
3299
3303
3300
3304
//update the shape primitive
3301
- UpdateShapePrimitive ( ) ;
3305
+ UpdateShapePrimitive ( UsedMaterial ) ;
3302
3306
3303
3307
}
3304
3308
@@ -3330,7 +3334,7 @@ static float GetTextureCoordY(char c)
3330
3334
return 1.0f ;
3331
3335
}
3332
3336
3333
- private void UpdateShapePrimitive ( )
3337
+ private void UpdateShapePrimitive ( Material material )
3334
3338
{
3335
3339
var indexData = new short [ NumIndices ] ;
3336
3340
Array . Copy ( TriangleListIndices , indexData , NumIndices ) ;
@@ -3339,6 +3343,8 @@ private void UpdateShapePrimitive()
3339
3343
var vertexData = new VertexPositionNormalTexture [ NumVertices ] ;
3340
3344
Array . Copy ( VertexList , vertexData , NumVertices ) ;
3341
3345
shapePrimitive . SetVertexData ( vertexData , 0 , NumVertices , NumIndices / 3 ) ;
3346
+
3347
+ shapePrimitive . SetMaterial ( material ) ;
3342
3348
}
3343
3349
3344
3350
public void PrepareFrame ( RenderFrame frame , ElapsedTime elapsedTime )
0 commit comments