Three.js: MeshStandardMaterial normalScale wrong typing

Created on 23 May 2019  路  3Comments  路  Source: mrdoob/three.js

Description of the problem

I am working with the 104.0 version of three js and I found an interesting bug to be absolutely solved.
The typing for the normalScale of the MeshStandardMaterial is totally wrong. Here is written that is "number" but that's totally wrong it should be Vector2 like all the types of normalScale.

ES. The types of the phong material for normalScale is a Vector2.


export class MeshPhongMaterial extends Material {
constructor(parameters?: MeshPhongMaterialParameters);

color: Color;
specular: Color;
shininess: number;
....
normalScale: Vector2;


On the other hand, the type for the MeshStandardMaterial:


export class MeshStandardMaterial extends Material {
constructor(parameters?: MeshStandardMaterialParameters);

defines: any;
color: Color;
roughness: number;
metalness: number;
...
normalScale: number;


In fact if I correct the type the file gives me no errors.
Please can you correct this error?

Three.js version
  • [ ] Dev
  • [x ] r104
  • [ ] ...
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Bug

All 3 comments

Should be okay now 馃憤

Yes now everything is ok. Do you know why if I "npm install three" the file is not yet fixed ?

The change is not in production yet. You have to wait for the next release (R105) at the end of the month.

Was this page helpful?
0 / 5 - 0 ratings