瀏覽代碼

Fix nme code generation

David Catuhe 5 年之前
父節點
當前提交
303597cf79

+ 6 - 0
src/Materials/Node/Blocks/Input/inputBlock.ts

@@ -75,6 +75,9 @@ export class InputBlock extends NodeMaterialBlock {
                     case "Color4":
                         this._type = NodeMaterialBlockConnectionPointTypes.Color4;
                         return this._type;
+                    case "Matrix":
+                        this._type = NodeMaterialBlockConnectionPointTypes.Matrix;
+                        return this._type;
                 }
             }
 
@@ -590,6 +593,9 @@ export class InputBlock extends NodeMaterialBlock {
                 case NodeMaterialBlockConnectionPointTypes.Color4:
                     valueString = `new BABYLON.Color4(${this.value.r}, ${this.value.g}, ${this.value.b}, ${this.value.a})`;
                     break;
+                case NodeMaterialBlockConnectionPointTypes.Matrix:
+                    valueString = `BABYLON.Matrix.FromArray([${(this.value as Matrix).m.toString()}])`;
+                    break;
             }
             let finalOutput = `${variableName}.value = ${valueString};\r\n`;
             finalOutput += `${variableName}.isConstant = ${this.isConstant ? "true" : "false"};\r\n`;

二進制
tests/validation/ReferenceImages/node-material0.png


+ 1 - 1
tests/validation/config.json

@@ -8,7 +8,7 @@
         },             
         {
             "title": "Node material #0",
-            "playgroundId": "#M5VQE9#14",
+            "playgroundId": "#M5VQE9#16",
             "referenceImage": "node-material0.png",
             "renderCount": 5
         },