Sfoglia il codice sorgente

Merge pull request #16163 from Mugen87/dev21

TypeScript: Added remaining material definitions.
Mr.doob 6 anni fa
parent
commit
07037f9841

+ 3 - 3
src/materials/Materials.d.ts

@@ -6,13 +6,13 @@ export * from './PointsMaterial';
 export * from './MeshPhysicalMaterial';
 export * from './MeshStandardMaterial';
 export * from './MeshPhongMaterial';
-//export * from './MeshToonMaterial';
+export * from './MeshToonMaterial';
 export * from './MeshNormalMaterial';
 export * from './MeshLambertMaterial';
 export * from './MeshDepthMaterial';
-//export * from './MeshDistanceMaterial';
+export * from './MeshDistanceMaterial';
 export * from './MeshBasicMaterial';
-//export * from './MeshMatcapMaterial';
+export * from './MeshMatcapMaterial';
 export * from './LineDashedMaterial';
 export * from './LineBasicMaterial';
 export * from './Material';

+ 15 - 7
src/materials/MeshDepthMaterial.d.ts

@@ -1,17 +1,25 @@
 import { DepthPackingStrategies } from '../constants';
 import { MaterialParameters, Material } from './Material';
+import { Texture } from './../textures/Texture';
 
 export interface MeshDepthMaterialParameters extends MaterialParameters {
-  wireframe?: boolean;
-  wireframeLinewidth?: number;
+	depthPacking?: DepthPackingStrategies;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+	wireframe?: boolean;
+	wireframeLinewidth?: number;
 }
 
 export class MeshDepthMaterial extends Material {
-  constructor(parameters?: MeshDepthMaterialParameters);
+	constructor(parameters?: MeshDepthMaterialParameters);
 
-  wireframe: boolean;
-  wireframeLinewidth: number;
-  depthPacking: DepthPackingStrategies;
+	depthPacking: DepthPackingStrategies;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+	wireframe: boolean;
+	wireframeLinewidth: number;
 
-  setValues(parameters: MeshDepthMaterialParameters): void;
+	setValues(parameters: MeshDepthMaterialParameters): void;
 }

+ 25 - 0
src/materials/MeshDistanceMaterial.d.ts

@@ -0,0 +1,25 @@
+import { MaterialParameters, Material } from './Material';
+import { Vector3 } from './../math/Vector3';
+import { Texture } from './../textures/Texture';
+
+export interface MeshDistanceMaterialParameters extends MaterialParameters {
+	referencePosition?: Vector3;
+	nearDistance?: number;
+	farDistance?: number;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+}
+
+export class MeshDistanceMaterial extends Material {
+	constructor(parameters?: MeshDistanceMaterialParameters);
+
+	referencePosition: Vector3;
+	nearDistance: number;
+	farDistance: number;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+
+	setValues(parameters: MeshDistanceMaterialParameters): void;
+}

+ 43 - 0
src/materials/MeshMatcapMaterial.d.ts

@@ -0,0 +1,43 @@
+import { Color } from './../math/Color';
+import { Texture } from './../textures/Texture';
+import { Vector2 } from './../math/Vector2';
+import { MaterialParameters, Material } from './Material';
+
+export interface MeshMatcapMaterialParameters extends MaterialParameters {
+
+	color?: Color | string | number;
+	matMap?: Texture;
+	map?: Texture;
+	bumpMap?: Texture;
+	bumpScale?: number;
+	normalMap?: Texture;
+	normalScale?: Vector2;
+	displacementMap?: Texture;
+	displacementScale?: number;
+	displacementBias?: number;
+	alphaMap?: Texture;
+	skinning?: boolean;
+	morphTargets?: boolean;
+	morphNormals?: boolean;
+}
+
+export class MeshMatcapMaterial extends Material {
+	constructor(parameters?: MeshMatcapMaterialParameters);
+
+	color: Color;
+	matMap: Texture | null;
+	map: Texture | null;
+	bumpMap: Texture | null;
+	bumpScale: number;
+	normalMap: Texture | null;
+	normalScale: Vector2;
+	displacementMap: Texture | null;
+	displacementScale: number;
+	displacementBias: number;
+	alphaMap: Texture | null;
+	skinning: boolean;
+	morphTargets: boolean;
+	morphNormals: boolean;
+
+	setValues(parameters: MeshMatcapMaterialParameters): void;
+}

+ 14 - 0
src/materials/MeshToonMaterial.d.ts

@@ -0,0 +1,14 @@
+import { Texture } from './../textures/Texture';
+import { MeshPhongMaterialParameters, MeshPhongMaterial } from './MeshPhongMaterial';
+
+export interface MeshToonMaterialParameters extends MeshPhongMaterialParameters {
+	gradientMap?: Texture;
+}
+
+export class MeshToonMaterial extends MeshPhongMaterial {
+	constructor(parameters?: MeshToonMaterialParameters);
+
+	gradientMap: Texture | null;
+
+	setValues(parameters: MeshToonMaterialParameters): void;
+}