Pārlūkot izejas kodu

Merge pull request #17155 from hujiulong/dev

Add missing declaration files
Mr.doob 6 gadi atpakaļ
vecāks
revīzija
8e981a56bb

+ 7 - 2
src/renderers/shaders/UniformsUtils.d.ts

@@ -1,4 +1,9 @@
+export function cloneUniforms( uniforms_src: any ): any;
+export function mergeUniforms( uniforms: any[] ): any;
+
 export namespace UniformsUtils {
-	export function merge( uniforms: any[] ): any;
-	export function clone( uniforms_src: any ): any;
+	export {
+		mergeUniforms as merge,
+		cloneUniforms as clone,
+	};
 }

+ 12 - 0
src/renderers/webgl/WebGLMorphtargets.d.ts

@@ -0,0 +1,12 @@
+import { Object3D } from '../../core/Object3D';
+import { BufferGeometry } from '../../core/BufferGeometry';
+import { Material } from '../../materials/Material';
+import { WebGLProgram } from './WebGLProgram';
+
+export class WebGLMorphtargets {
+
+	constructor( gl: WebGLRenderingContext );
+
+	update( object: Object3D, geometry: BufferGeometry, material: Material, program: WebGLProgram ): void;
+
+}

+ 25 - 0
src/renderers/webgl/WebGLRenderStates.d.ts

@@ -0,0 +1,25 @@
+import { Scene } from '../../scenes/Scene';
+import { Camera } from '../../cameras/Camera';
+import { Light } from '../../lights/Light';
+import { WebGLLights } from './WebGLLights';
+
+interface WebGLRenderState {
+
+	init(): void;
+	state: {
+		lightsArray: Light[];
+		shadowsArray: Light[];
+		lights: WebGLLights;
+	};
+	setupLights( camera: Camera ): void;
+	pushLight( light: Light ): void;
+	pushShadow( shadowLight: Light ): void;
+
+}
+
+export class WebGLRenderStates {
+
+	get( scene: Scene, camera: Camera ): WebGLRenderState;
+	dispose(): void;
+
+}

+ 12 - 2
src/renderers/webvr/WebVRManager.d.ts

@@ -1,15 +1,25 @@
 import { Object3D } from '../../core/Object3D';
+import { Group } from '../../objects/Group';
 import { PerspectiveCamera } from '../../cameras/PerspectiveCamera';
 import { ArrayCamera } from '../../cameras/ArrayCamera';
 import { Matrix4 } from '../../math/Matrix4';
 
-export interface WebVRManager {
+export class WebVRManager {
+
+	constructor( renderer: any );
+
 	enabled: boolean;
+	getController( id: number ): Group;
 	getDevice(): VRDisplay | null;
 	setDevice( device: VRDisplay | null ): void;
+	setFramebufferScaleFactor( value: number ): void;
+	setReferenceSpaceType( value: string ): void;
 	setPoseTarget( object: Object3D | null ): void;
 	getCamera( camera: PerspectiveCamera ): PerspectiveCamera | ArrayCamera;
+	getStandingMatrix(): Matrix4;
+	isPresenting: () => boolean;
+	setAnimationLoop( callback: Function ): void;
 	submitFrame(): void;
 	dispose(): void;
-	getStandingMatrix(): Matrix4;
+
 }

+ 3 - 0
src/renderers/webvr/WebVRUtils.d.ts

@@ -0,0 +1,3 @@
+import { Camera } from '../../cameras/Camera';
+
+export function setProjectionFromUnion( camera: Camera, cameraL: Camera, cameraR: Camera ): void;

+ 19 - 0
src/renderers/webvr/WebXRManager.d.ts

@@ -0,0 +1,19 @@
+import { Group } from '../../objects/Group';
+import { Camera } from '../../cameras/Camera';
+
+export class WebXRManager {
+
+	constructor( renderer: any, gl: WebGLRenderingContext );
+
+	enabled: boolean;
+	getController( id: number ): Group;
+	setFramebufferScaleFactor( value: number ): void;
+	setReferenceSpaceType( value: string ): void;
+	getSession(): any;
+	setSession( value: any ): void;
+	getCamera( camera: Camera ): Camera;
+	isPresenting: () => boolean;
+	setAnimationLoop( callback: Function ): void;
+	dispose(): void;
+
+}