Browse Source

Fix type pb

Popov72 5 years ago
parent
commit
aca0e3133b
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/Materials/shaderMaterial.ts

+ 4 - 4
src/Materials/shaderMaterial.ts

@@ -393,9 +393,9 @@ export class ShaderMaterial extends Material {
      * @param value Define the value to give to the uniform
      * @return the material itself allowing "fluent" like uniform updates
      */
-    public setMatrix3x3(name: string, value: Float32Array): ShaderMaterial {
+    public setMatrix3x3(name: string, value: Float32Array | Array<number>): ShaderMaterial {
         this._checkUniform(name);
-        this._matrices3x3[name] = value;
+        this._matrices3x3[name] = Array.isArray(value) ? new Float32Array(value) : value;
 
         return this;
     }
@@ -406,9 +406,9 @@ export class ShaderMaterial extends Material {
      * @param value Define the value to give to the uniform
      * @return the material itself allowing "fluent" like uniform updates
      */
-    public setMatrix2x2(name: string, value: Float32Array): ShaderMaterial {
+    public setMatrix2x2(name: string, value: Float32Array | Array<number>): ShaderMaterial {
         this._checkUniform(name);
-        this._matrices2x2[name] = value;
+        this._matrices2x2[name] = Array.isArray(value) ? new Float32Array(value) : value;
 
         return this;
     }