提交 d3be96fb 编写于 作者: O Olov

Make Textures nullable in Material type definitions. See #17587

上级 ab18028c
...@@ -8,12 +8,12 @@ import { Combine } from '../constants'; ...@@ -8,12 +8,12 @@ import { Combine } from '../constants';
export interface MeshBasicMaterialParameters extends MaterialParameters { export interface MeshBasicMaterialParameters extends MaterialParameters {
color?: Color | string | number; color?: Color | string | number;
opacity?: number; opacity?: number;
map?: Texture; map?: Texture | null;
aoMap?: Texture; aoMap?: Texture | null;
aoMapIntensity?: number; aoMapIntensity?: number;
specularMap?: Texture; specularMap?: Texture | null;
alphaMap?: Texture; alphaMap?: Texture | null;
envMap?: Texture; envMap?: Texture | null;
combine?: Combine; combine?: Combine;
reflectivity?: number; reflectivity?: number;
refractionRatio?: number; refractionRatio?: number;
...@@ -27,7 +27,7 @@ export interface MeshBasicMaterialParameters extends MaterialParameters { ...@@ -27,7 +27,7 @@ export interface MeshBasicMaterialParameters extends MaterialParameters {
export class MeshBasicMaterial extends Material { export class MeshBasicMaterial extends Material {
constructor( parameters?: MeshBasicMaterialParameters ); constructor(parameters?: MeshBasicMaterialParameters);
color: Color; color: Color;
map: Texture | null; map: Texture | null;
...@@ -46,6 +46,6 @@ export class MeshBasicMaterial extends Material { ...@@ -46,6 +46,6 @@ export class MeshBasicMaterial extends Material {
skinning: boolean; skinning: boolean;
morphTargets: boolean; morphTargets: boolean;
setValues( parameters: MeshBasicMaterialParameters ): void; setValues(parameters: MeshBasicMaterialParameters): void;
} }
...@@ -4,7 +4,7 @@ import { Texture } from './../textures/Texture'; ...@@ -4,7 +4,7 @@ import { Texture } from './../textures/Texture';
export interface MeshDepthMaterialParameters extends MaterialParameters { export interface MeshDepthMaterialParameters extends MaterialParameters {
depthPacking?: DepthPackingStrategies; depthPacking?: DepthPackingStrategies;
displacementMap?: Texture; displacementMap?: Texture | null;
displacementScale?: number; displacementScale?: number;
displacementBias?: number; displacementBias?: number;
wireframe?: boolean; wireframe?: boolean;
......
...@@ -6,7 +6,7 @@ export interface MeshDistanceMaterialParameters extends MaterialParameters { ...@@ -6,7 +6,7 @@ export interface MeshDistanceMaterialParameters extends MaterialParameters {
referencePosition?: Vector3; referencePosition?: Vector3;
nearDistance?: number; nearDistance?: number;
farDistance?: number; farDistance?: number;
displacementMap?: Texture; displacementMap?: Texture | null;
displacementScale?: number; displacementScale?: number;
displacementBias?: number; displacementBias?: number;
} }
......
...@@ -7,15 +7,15 @@ export interface MeshLambertMaterialParameters extends MaterialParameters { ...@@ -7,15 +7,15 @@ export interface MeshLambertMaterialParameters extends MaterialParameters {
color?: Color | string | number; color?: Color | string | number;
emissive?: Color | string | number; emissive?: Color | string | number;
emissiveIntensity?: number; emissiveIntensity?: number;
emissiveMap?: Texture; emissiveMap?: Texture | null;
map?: Texture; map?: Texture | null;
lightMap?: Texture; lightMap?: Texture | null;
lightMapIntensity?: number; lightMapIntensity?: number;
aoMap?: Texture; aoMap?: Texture | null;
aoMapIntensity?: number; aoMapIntensity?: number;
specularMap?: Texture; specularMap?: Texture | null;
alphaMap?: Texture; alphaMap?: Texture | null;
envMap?: Texture; envMap?: Texture | null;
combine?: Combine; combine?: Combine;
reflectivity?: number; reflectivity?: number;
refractionRatio?: number; refractionRatio?: number;
......
...@@ -7,17 +7,17 @@ import { NormalMapTypes } from '../constants'; ...@@ -7,17 +7,17 @@ import { NormalMapTypes } from '../constants';
export interface MeshMatcapMaterialParameters extends MaterialParameters { export interface MeshMatcapMaterialParameters extends MaterialParameters {
color?: Color | string | number; color?: Color | string | number;
matcap?: Texture; matcap?: Texture | null;
map?: Texture; map?: Texture | null;
bumpMap?: Texture; bumpMap?: Texture | null;
bumpScale?: number; bumpScale?: number;
normalMap?: Texture; normalMap?: Texture | null;
normalMapType?: NormalMapTypes; normalMapType?: NormalMapTypes;
normalScale?: Vector2; normalScale?: Vector2;
displacementMap?: Texture; displacementMap?: Texture | null;
displacementScale?: number; displacementScale?: number;
displacementBias?: number; displacementBias?: number;
alphaMap?: Texture; alphaMap?: Texture | null;
skinning?: boolean; skinning?: boolean;
morphTargets?: boolean; morphTargets?: boolean;
morphNormals?: boolean; morphNormals?: boolean;
......
...@@ -5,12 +5,12 @@ import { NormalMapTypes } from '../constants'; ...@@ -5,12 +5,12 @@ import { NormalMapTypes } from '../constants';
export interface MeshNormalMaterialParameters extends MaterialParameters { export interface MeshNormalMaterialParameters extends MaterialParameters {
bumpMap?: Texture; bumpMap?: Texture | null;
bumpScale?: number; bumpScale?: number;
normalMap?: Texture; normalMap?: Texture | null;
normalMapType?: NormalMapTypes; normalMapType?: NormalMapTypes;
normalScale?: Vector2; normalScale?: Vector2;
displacementMap?: Texture; displacementMap?: Texture | null;
displacementScale?: number; displacementScale?: number;
displacementBias?: number; displacementBias?: number;
wireframe?: boolean; wireframe?: boolean;
......
...@@ -10,25 +10,25 @@ export interface MeshPhongMaterialParameters extends MaterialParameters { ...@@ -10,25 +10,25 @@ export interface MeshPhongMaterialParameters extends MaterialParameters {
specular?: Color | string | number; specular?: Color | string | number;
shininess?: number; shininess?: number;
opacity?: number; opacity?: number;
map?: Texture; map?: Texture | null;
lightMap?: Texture; lightMap?: Texture | null;
lightMapIntensity?: number; lightMapIntensity?: number;
aoMap?: Texture; aoMap?: Texture | null;
aoMapIntensity?: number; aoMapIntensity?: number;
emissive?: Color | string | number; emissive?: Color | string | number;
emissiveIntensity?: number; emissiveIntensity?: number;
emissiveMap?: Texture; emissiveMap?: Texture | null;
bumpMap?: Texture; bumpMap?: Texture | null;
bumpScale?: number; bumpScale?: number;
normalMap?: Texture; normalMap?: Texture | null;
normalMapType?: NormalMapTypes; normalMapType?: NormalMapTypes;
normalScale?: Vector2; normalScale?: Vector2;
displacementMap?: Texture; displacementMap?: Texture | null;
displacementScale?: number; displacementScale?: number;
displacementBias?: number; displacementBias?: number;
specularMap?: Texture; specularMap?: Texture | null;
alphaMap?: Texture; alphaMap?: Texture | null;
envMap?: Texture; envMap?: Texture | null;
combine?: Combine; combine?: Combine;
reflectivity?: number; reflectivity?: number;
refractionRatio?: number; refractionRatio?: number;
......
...@@ -15,7 +15,7 @@ export interface MeshPhysicalMaterialParameters ...@@ -15,7 +15,7 @@ export interface MeshPhysicalMaterialParameters
sheen?: Color; sheen?: Color;
clearcoatNormalScale?: Vector2; clearcoatNormalScale?: Vector2;
clearcoatNormalMap?: Texture; clearcoatNormalMap?: Texture | null;
} }
export class MeshPhysicalMaterial extends MeshStandardMaterial { export class MeshPhysicalMaterial extends MeshStandardMaterial {
......
...@@ -8,26 +8,26 @@ export interface MeshStandardMaterialParameters extends MaterialParameters { ...@@ -8,26 +8,26 @@ export interface MeshStandardMaterialParameters extends MaterialParameters {
color?: Color | string | number; color?: Color | string | number;
roughness?: number; roughness?: number;
metalness?: number; metalness?: number;
map?: Texture; map?: Texture | null;
lightMap?: Texture; lightMap?: Texture | null;
lightMapIntensity?: number; lightMapIntensity?: number;
aoMap?: Texture; aoMap?: Texture | null;
aoMapIntensity?: number; aoMapIntensity?: number;
emissive?: Color | string | number; emissive?: Color | string | number;
emissiveIntensity?: number; emissiveIntensity?: number;
emissiveMap?: Texture; emissiveMap?: Texture | null;
bumpMap?: Texture; bumpMap?: Texture | null;
bumpScale?: number; bumpScale?: number;
normalMap?: Texture; normalMap?: Texture | null;
normalMapType?: NormalMapTypes; normalMapType?: NormalMapTypes;
normalScale?: Vector2; normalScale?: Vector2;
displacementMap?: Texture; displacementMap?: Texture | null;
displacementScale?: number; displacementScale?: number;
displacementBias?: number; displacementBias?: number;
roughnessMap?: Texture; roughnessMap?: Texture | null;
metalnessMap?: Texture; metalnessMap?: Texture | null;
alphaMap?: Texture; alphaMap?: Texture | null;
envMap?: Texture; envMap?: Texture | null;
envMapIntensity?: number; envMapIntensity?: number;
refractionRatio?: number; refractionRatio?: number;
wireframe?: boolean; wireframe?: boolean;
......
...@@ -2,7 +2,7 @@ import { Texture } from './../textures/Texture'; ...@@ -2,7 +2,7 @@ import { Texture } from './../textures/Texture';
import { MeshPhongMaterialParameters, MeshPhongMaterial } from './MeshPhongMaterial'; import { MeshPhongMaterialParameters, MeshPhongMaterial } from './MeshPhongMaterial';
export interface MeshToonMaterialParameters extends MeshPhongMaterialParameters { export interface MeshToonMaterialParameters extends MeshPhongMaterialParameters {
gradientMap?: Texture; gradientMap?: Texture | null;
} }
export class MeshToonMaterial extends MeshPhongMaterial { export class MeshToonMaterial extends MeshPhongMaterial {
......
...@@ -4,7 +4,7 @@ import { MaterialParameters, Material } from './Material'; ...@@ -4,7 +4,7 @@ import { MaterialParameters, Material } from './Material';
export interface SpriteMaterialParameters extends MaterialParameters { export interface SpriteMaterialParameters extends MaterialParameters {
color?: Color | string | number; color?: Color | string | number;
map?: Texture; map?: Texture | null;
rotation?: number; rotation?: number;
sizeAttenuation?: boolean; sizeAttenuation?: boolean;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册