three-base 2.0.72 → 2.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApngTexture.d.ts +13 -13
- package/ApngTexture.js +61 -61
- package/ApngTextureManage.d.ts +18 -18
- package/ApngTextureManage.js +87 -87
- package/EventMesh.d.ts +18 -18
- package/EventMesh.js +59 -59
- package/ExtrudeMesh.d.ts +111 -111
- package/ExtrudeMesh.js +363 -363
- package/FPScontrol.d.ts +45 -45
- package/FPScontrol.js +171 -171
- package/Fire/Fire.d.ts +28 -28
- package/Fire/Fire.js +79 -79
- package/Fire/FireGromtry.d.ts +9 -9
- package/Fire/FireGromtry.js +40 -40
- package/Fire/FireMaterial.d.ts +28 -28
- package/Fire/FireMaterial.js +32 -32
- package/InstancedMeshBase.d.ts +32 -32
- package/InstancedMeshBase.js +236 -219
- package/InstancedMeshBase.ts +36 -20
- package/KeyFrameAnimation.d.ts +25 -25
- package/KeyFrameAnimation.js +78 -78
- package/MeshBase.d.ts +34 -33
- package/MeshBase.js +185 -174
- package/MeshBase.ts +16 -5
- package/Mirror.d.ts +25 -25
- package/Mirror.js +139 -139
- package/PlaneModal1/PlaneModal1.d.ts +31 -31
- package/PlaneModal1/PlaneModal1.js +105 -105
- package/PlaneModal1/index.d.ts +1 -1
- package/PlaneModal1/index.js +1 -1
- package/PlaneText.d.ts +44 -44
- package/PlaneText.js +30 -30
- package/PlaneWithHtml.d.ts +11 -11
- package/PlaneWithHtml.js +68 -68
- package/PointLight/PointLight.d.ts +13 -13
- package/PointLight/PointLight.js +64 -64
- package/PointLight/index.d.ts +1 -1
- package/PointLight/index.js +1 -1
- package/Sky/Sky.d.ts +13 -13
- package/Sky/Sky.js +28 -28
- package/Sky/index.d.ts +1 -1
- package/Sky/index.js +1 -1
- package/SpriteModal1/SpriteModal1.d.ts +30 -30
- package/SpriteModal1/SpriteModal1.js +110 -110
- package/SpriteModal1/index.d.ts +1 -1
- package/SpriteModal1/index.js +1 -1
- package/SpriteText.d.ts +45 -45
- package/SpriteText.js +163 -163
- package/SpriteText2.d.ts +47 -47
- package/SpriteText2.js +198 -198
- package/SpriteWithHtml.d.ts +7 -7
- package/SpriteWithHtml.js +49 -49
- package/Text3D/Text3D.d.ts +20 -20
- package/Text3D/Text3D.js +62 -62
- package/Text3D/fontController.d.ts +59 -59
- package/Text3D/fontController.js +200 -200
- package/Text3D/index.d.ts +1 -1
- package/Text3D/index.js +1 -1
- package/ThreeBase.d.ts +92 -91
- package/ThreeBase.js +619 -611
- package/ThreeBase.ts +15 -6
- package/ThreeMouse.d.ts +39 -39
- package/ThreeMouse.js +359 -359
- package/Transition.d.ts +40 -40
- package/Transition.js +207 -207
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/keyContorls.d.ts +25 -25
- package/keyContorls.js +98 -98
- package/package.json +1 -1
- package/pass/FullScreenQuad.d.ts +7 -7
- package/pass/FullScreenQuad.js +25 -25
- package/pass/glow_pass.d.ts +2 -2
- package/pass/glow_pass.js +236 -236
- package/pass/stroke_pass.d.ts +2 -2
- package/pass/stroke_pass.js +202 -202
- package/shaders/FXAAShaderMaterial.d.ts +3 -3
- package/shaders/FXAAShaderMaterial.js +21 -21
- package/shaders.d.ts +17 -17
- package/shaders.js +99 -99
- package/threeLoader.d.ts +26 -26
- package/threeLoader.js +189 -189
- package/threeUtils.d.ts +47 -47
- package/threeUtils.js +266 -266
package/ThreeBase.ts
CHANGED
|
@@ -99,7 +99,7 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
99
99
|
//正交相机
|
|
100
100
|
orthographicCamera = new OrthographicCamera(- 1, 1, 1, - 1, 0.01, 10000);
|
|
101
101
|
|
|
102
|
-
//相机的类型
|
|
102
|
+
//相机的类型 有透视相机和正交相机
|
|
103
103
|
cameraType: "perspectiveCamera" | "orthographicCamera" = "perspectiveCamera";
|
|
104
104
|
setCameraType(cameraType: "perspectiveCamera" | "orthographicCamera") {
|
|
105
105
|
if (this.cameraType !== cameraType) {
|
|
@@ -115,16 +115,25 @@ export default class ThreeBase extends EventDispatcher {
|
|
|
115
115
|
}
|
|
116
116
|
//获取当前使用的的相机
|
|
117
117
|
getCamera() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
switch (this.cameraType) {
|
|
119
|
+
case "orthographicCamera":
|
|
120
|
+
return this.orthographicCamera;
|
|
121
|
+
case "perspectiveCamera":
|
|
122
|
+
default:
|
|
123
|
+
return this.perspectiveCamera;
|
|
124
|
+
}
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
// 场景对象
|
|
126
128
|
scene = new Scene();
|
|
127
129
|
|
|
130
|
+
// 这个方法等效 this.scene.add
|
|
131
|
+
// 想少写2个字母就用这个方法
|
|
132
|
+
add(...object: Object3D[]) {
|
|
133
|
+
this.scene.add(...object);
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
|
|
128
137
|
///鼠标事件对象
|
|
129
138
|
threeMouse = new ThreeMouse(this.renderer, this.perspectiveCamera, this.scene);
|
|
130
139
|
|
package/ThreeMouse.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { Object3D, Scene } from "three";
|
|
3
|
-
import type { Intersection } from "three";
|
|
4
|
-
export interface ThreeMouseEvent extends Intersection {
|
|
5
|
-
renderer: THREE.Renderer;
|
|
6
|
-
camera: THREE.Camera;
|
|
7
|
-
type: string;
|
|
8
|
-
offsetX: number;
|
|
9
|
-
offsetY: number;
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* three.js 专用的鼠标拾取模型对象
|
|
15
|
-
*/
|
|
16
|
-
export default class ThreeMouse {
|
|
17
|
-
constructor(renderer: THREE.WebGLRenderer, camera: THREE.Camera, scene: THREE.Scene);
|
|
18
|
-
_renderer: THREE.WebGLRenderer;
|
|
19
|
-
_camera: THREE.Camera;
|
|
20
|
-
_scene: Scene;
|
|
21
|
-
_mosePosition: THREE.Vector2;
|
|
22
|
-
_mouseDownPosition: THREE.Vector2;
|
|
23
|
-
_mesh_on?: Object3D;
|
|
24
|
-
_mesh_Down?: Object3D;
|
|
25
|
-
_raycaster: THREE.Raycaster;
|
|
26
|
-
_frame: number;
|
|
27
|
-
_mouseInRenderer: boolean;
|
|
28
|
-
_mousemoveEvent?: MouseEvent;
|
|
29
|
-
_object3ds: Object3D[];
|
|
30
|
-
_click_num: number;
|
|
31
|
-
_getSelected(object3ds: Object3D[]): Intersection | undefined;
|
|
32
|
-
hasEvent(object?: Object3D, types?: Array<"leftclick" | "rightclick" | "click" | "dbclick" | "mouseenter" | "mouseleave" | "mousemove" | "mousedown" | "mouseup">): boolean;
|
|
33
|
-
hasCursor(object?: Object3D): boolean;
|
|
34
|
-
dispatchEvent(): void;
|
|
35
|
-
_mouseleave: (e: MouseEvent) => void;
|
|
36
|
-
_mousemove: (e: MouseEvent) => void;
|
|
37
|
-
_mousedown: (e: MouseEvent) => void;
|
|
38
|
-
_mouseup: import("lodash").DebouncedFunc<(e: PointerEvent) => Promise<void>>;
|
|
39
|
-
}
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { Object3D, Scene } from "three";
|
|
3
|
+
import type { Intersection } from "three";
|
|
4
|
+
export interface ThreeMouseEvent extends Intersection {
|
|
5
|
+
renderer: THREE.Renderer;
|
|
6
|
+
camera: THREE.Camera;
|
|
7
|
+
type: string;
|
|
8
|
+
offsetX: number;
|
|
9
|
+
offsetY: number;
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* three.js 专用的鼠标拾取模型对象
|
|
15
|
+
*/
|
|
16
|
+
export default class ThreeMouse {
|
|
17
|
+
constructor(renderer: THREE.WebGLRenderer, camera: THREE.Camera, scene: THREE.Scene);
|
|
18
|
+
_renderer: THREE.WebGLRenderer;
|
|
19
|
+
_camera: THREE.Camera;
|
|
20
|
+
_scene: Scene;
|
|
21
|
+
_mosePosition: THREE.Vector2;
|
|
22
|
+
_mouseDownPosition: THREE.Vector2;
|
|
23
|
+
_mesh_on?: Object3D;
|
|
24
|
+
_mesh_Down?: Object3D;
|
|
25
|
+
_raycaster: THREE.Raycaster;
|
|
26
|
+
_frame: number;
|
|
27
|
+
_mouseInRenderer: boolean;
|
|
28
|
+
_mousemoveEvent?: MouseEvent;
|
|
29
|
+
_object3ds: Object3D[];
|
|
30
|
+
_click_num: number;
|
|
31
|
+
_getSelected(object3ds: Object3D[]): Intersection | undefined;
|
|
32
|
+
hasEvent(object?: Object3D, types?: Array<"leftclick" | "rightclick" | "click" | "dbclick" | "mouseenter" | "mouseleave" | "mousemove" | "mousedown" | "mouseup">): boolean;
|
|
33
|
+
hasCursor(object?: Object3D): boolean;
|
|
34
|
+
dispatchEvent(): void;
|
|
35
|
+
_mouseleave: (e: MouseEvent) => void;
|
|
36
|
+
_mousemove: (e: MouseEvent) => void;
|
|
37
|
+
_mousedown: (e: MouseEvent) => void;
|
|
38
|
+
_mouseup: import("lodash").DebouncedFunc<(e: PointerEvent) => Promise<void>>;
|
|
39
|
+
}
|