@galacean/engine-core 1.0.0-beta.9 → 1.1.0-alpha.0
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/dist/main.js +13469 -13094
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +13469 -13094
- package/dist/module.js +13464 -13095
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/sprite/SpriteMask.d.ts +1 -2
- package/types/2d/sprite/SpriteRenderer.d.ts +1 -2
- package/types/2d/text/TextRenderer.d.ts +1 -2
- package/types/Camera.d.ts +10 -6
- package/types/Component.d.ts +1 -0
- package/types/Engine.d.ts +9 -6
- package/types/Renderer.d.ts +2 -1
- package/types/SafeLoopArray.d.ts +37 -0
- package/types/Scene.d.ts +3 -4
- package/types/SceneManager.d.ts +28 -5
- package/types/animation/Animator.d.ts +2 -3
- package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
- package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
- package/types/enums/ActiveChangeFlag.d.ts +6 -0
- package/types/index.d.ts +1 -1
- package/types/input/InputManager.d.ts +2 -2
- package/types/mesh/MeshRenderer.d.ts +1 -2
- package/types/physics/PhysicsScene.d.ts +75 -0
- package/types/physics/index.d.ts +7 -7
- package/types/shader/index.d.ts +1 -0
- package/types/shader/state/index.d.ts +6 -0
- package/types/utils/BoolUpdateFlag.d.ts +12 -0
- package/types/utils/DisorderedArray.d.ts +18 -0
- package/types/utils/SafeLoopArray.d.ts +41 -0
- package/types/utils/UpdateFlag.d.ts +20 -0
- package/types/utils/UpdateFlagManager.d.ts +1 -0
- package/types/utils/Utils.d.ts +31 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0-alpha.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-math": "1.
|
|
18
|
+
"@galacean/engine-math": "1.1.0-alpha.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.
|
|
21
|
+
"@galacean/engine-design": "1.1.0-alpha.0"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Renderer } from "../../Renderer";
|
|
2
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
3
2
|
import { Sprite } from "./Sprite";
|
|
4
3
|
/**
|
|
5
4
|
* A component for masking Sprites.
|
|
6
5
|
*/
|
|
7
|
-
export declare class SpriteMask extends Renderer
|
|
6
|
+
export declare class SpriteMask extends Renderer {
|
|
8
7
|
/** The mask layers the sprite mask influence to. */
|
|
9
8
|
influenceLayers: number;
|
|
10
9
|
private _sprite;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Color } from "@galacean/engine-math";
|
|
2
2
|
import { Renderer } from "../../Renderer";
|
|
3
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
4
3
|
import { SpriteDrawMode } from "../enums/SpriteDrawMode";
|
|
5
4
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
6
5
|
import { SpriteTileMode } from "../enums/SpriteTileMode";
|
|
@@ -8,7 +7,7 @@ import { Sprite } from "./Sprite";
|
|
|
8
7
|
/**
|
|
9
8
|
* Renders a Sprite for 2D graphics.
|
|
10
9
|
*/
|
|
11
|
-
export declare class SpriteRenderer extends Renderer
|
|
10
|
+
export declare class SpriteRenderer extends Renderer {
|
|
12
11
|
private _drawMode;
|
|
13
12
|
private _assembler;
|
|
14
13
|
private _tileMode;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BoundingBox, Color } from "@galacean/engine-math";
|
|
2
2
|
import { Entity } from "../../Entity";
|
|
3
3
|
import { Renderer } from "../../Renderer";
|
|
4
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
5
4
|
import { FontStyle } from "../enums/FontStyle";
|
|
6
5
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
7
6
|
import { TextHorizontalAlignment, TextVerticalAlignment } from "../enums/TextAlignment";
|
|
@@ -10,7 +9,7 @@ import { Font } from "./Font";
|
|
|
10
9
|
/**
|
|
11
10
|
* Renders a text for 2D graphics.
|
|
12
11
|
*/
|
|
13
|
-
export declare class TextRenderer extends Renderer
|
|
12
|
+
export declare class TextRenderer extends Renderer {
|
|
14
13
|
private static _charRenderDataPool;
|
|
15
14
|
private static _tempVec30;
|
|
16
15
|
private static _tempVec31;
|
package/types/Camera.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Matrix, Ray, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
|
-
import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
4
3
|
import { Layer } from "./Layer";
|
|
4
|
+
import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
5
5
|
import { Shader } from "./shader/Shader";
|
|
6
6
|
import { ShaderData } from "./shader/ShaderData";
|
|
7
7
|
import { ShaderTagKey } from "./shader/ShaderTagKey";
|
|
8
|
-
import { TextureCubeFace } from "./texture/enums/TextureCubeFace";
|
|
9
8
|
import { RenderTarget } from "./texture/RenderTarget";
|
|
9
|
+
import { TextureCubeFace } from "./texture/enums/TextureCubeFace";
|
|
10
10
|
/**
|
|
11
11
|
* Camera component, as the entrance to the three-dimensional world.
|
|
12
12
|
* @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
|
|
@@ -14,8 +14,6 @@ import { RenderTarget } from "./texture/RenderTarget";
|
|
|
14
14
|
export declare class Camera extends Component {
|
|
15
15
|
/** Shader data. */
|
|
16
16
|
readonly shaderData: ShaderData;
|
|
17
|
-
/** Rendering priority - A Camera with higher priority will be rendered on top of a camera with lower priority. */
|
|
18
|
-
priority: number;
|
|
19
17
|
/** Whether to enable frustum culling, it is enabled by default. */
|
|
20
18
|
enableFrustumCulling: boolean;
|
|
21
19
|
/**
|
|
@@ -28,6 +26,7 @@ export declare class Camera extends Component {
|
|
|
28
26
|
* @remarks Support bit manipulation, corresponding to `Layer`.
|
|
29
27
|
*/
|
|
30
28
|
cullingMask: Layer;
|
|
29
|
+
private _priority;
|
|
31
30
|
private _isProjMatSetting;
|
|
32
31
|
private _nearClipPlane;
|
|
33
32
|
private _farClipPlane;
|
|
@@ -73,6 +72,11 @@ export declare class Camera extends Component {
|
|
|
73
72
|
*/
|
|
74
73
|
get viewport(): Vector4;
|
|
75
74
|
set viewport(value: Vector4);
|
|
75
|
+
/**
|
|
76
|
+
* Rendering priority, higher priority will be rendered on top of a camera with lower priority.
|
|
77
|
+
*/
|
|
78
|
+
get priority(): number;
|
|
79
|
+
set priority(value: number);
|
|
76
80
|
/**
|
|
77
81
|
* Whether it is orthogonal, the default is false. True will use orthographic projection, false will use perspective projection.
|
|
78
82
|
*/
|
|
@@ -206,11 +210,11 @@ export declare class Camera extends Component {
|
|
|
206
210
|
/**
|
|
207
211
|
* @inheritdoc
|
|
208
212
|
*/
|
|
209
|
-
|
|
213
|
+
_onEnableInScene(): void;
|
|
210
214
|
/**
|
|
211
215
|
* @inheritdoc
|
|
212
216
|
*/
|
|
213
|
-
|
|
217
|
+
_onDisableInScene(): void;
|
|
214
218
|
private _projMatChange;
|
|
215
219
|
private _innerViewportToWorldPoint;
|
|
216
220
|
private _updateShaderData;
|
package/types/Component.d.ts
CHANGED
package/types/Engine.d.ts
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { IPhysics } from "@galacean/engine-design";
|
|
2
|
-
import { ResourceManager } from "./asset/ResourceManager";
|
|
3
|
-
import { EventDispatcher, Time } from "./base";
|
|
4
2
|
import { Canvas } from "./Canvas";
|
|
5
3
|
import { EngineSettings } from "./EngineSettings";
|
|
6
4
|
import { Entity } from "./Entity";
|
|
5
|
+
import { SceneManager } from "./SceneManager";
|
|
6
|
+
import { ResourceManager } from "./asset/ResourceManager";
|
|
7
|
+
import { EventDispatcher, Time } from "./base";
|
|
7
8
|
import { ColorSpace } from "./enums/ColorSpace";
|
|
8
9
|
import { InputManager } from "./input";
|
|
9
|
-
import {
|
|
10
|
+
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
10
11
|
import { IHardwareRenderer } from "./renderingHardwareInterface";
|
|
11
|
-
import { SceneManager } from "./SceneManager";
|
|
12
12
|
/**
|
|
13
13
|
* Engine.
|
|
14
14
|
*/
|
|
15
15
|
export declare class Engine extends EventDispatcher {
|
|
16
|
-
/** Physics manager of Engine. */
|
|
17
|
-
readonly physicsManager: PhysicsManager;
|
|
18
16
|
/** Input manager of Engine. */
|
|
19
17
|
readonly inputManager: InputManager;
|
|
20
18
|
private _settings;
|
|
@@ -118,6 +116,11 @@ export declare class Engine extends EventDispatcher {
|
|
|
118
116
|
private _createSpriteMaskMaterial;
|
|
119
117
|
private _onDeviceLost;
|
|
120
118
|
private _onDeviceRestored;
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated
|
|
121
|
+
* The first scene physics manager.
|
|
122
|
+
*/
|
|
123
|
+
get physicsManager(): PhysicsScene;
|
|
121
124
|
}
|
|
122
125
|
/**
|
|
123
126
|
* Engine configuration.
|
package/types/Renderer.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { BoundingBox, Vector4 } from "@galacean/engine-math";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
|
+
import { ICustomClone } from "./clone/ComponentCloner";
|
|
3
4
|
import { Material } from "./material";
|
|
4
5
|
import { ShaderData } from "./shader/ShaderData";
|
|
5
6
|
/**
|
|
6
7
|
* Basis for all renderers.
|
|
7
8
|
* @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
|
|
8
9
|
*/
|
|
9
|
-
export declare class Renderer extends Component {
|
|
10
|
+
export declare class Renderer extends Component implements ICustomClone {
|
|
10
11
|
private static _tempVector0;
|
|
11
12
|
private static _receiveShadowMacro;
|
|
12
13
|
private static _localMatrixProperty;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare class SafeLoopArray<T> {
|
|
2
|
+
private _array;
|
|
3
|
+
private _loopArray;
|
|
4
|
+
private _loopArrayDirty;
|
|
5
|
+
/**
|
|
6
|
+
* Get the length of the array.
|
|
7
|
+
*/
|
|
8
|
+
get length(): number;
|
|
9
|
+
/**
|
|
10
|
+
* Push item to the array.
|
|
11
|
+
* @param item - The item which want to be pushed
|
|
12
|
+
*/
|
|
13
|
+
push(item: T): void;
|
|
14
|
+
/**
|
|
15
|
+
* Splice the array.
|
|
16
|
+
* @param index - The index of the array
|
|
17
|
+
* @param deleteCount - The count of the array which want to be deleted
|
|
18
|
+
* @param item - The item which want to be added
|
|
19
|
+
*/
|
|
20
|
+
splice(index: number, deleteCount: number, item?: T): void;
|
|
21
|
+
/**
|
|
22
|
+
* The index of the item.
|
|
23
|
+
* @param item - The item which want to get the index
|
|
24
|
+
* @returns Index of the item
|
|
25
|
+
*/
|
|
26
|
+
indexOf(item: T): number;
|
|
27
|
+
/**
|
|
28
|
+
* Get the array.
|
|
29
|
+
* @returns The array
|
|
30
|
+
*/
|
|
31
|
+
getArray(): ReadonlyArray<T>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the array use for loop.
|
|
34
|
+
* @returns The array use for loop
|
|
35
|
+
*/
|
|
36
|
+
getLoopArray(): ReadonlyArray<T>;
|
|
37
|
+
}
|
package/types/Scene.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Entity } from "./Entity";
|
|
|
5
5
|
import { EngineObject } from "./base";
|
|
6
6
|
import { FogMode } from "./enums/FogMode";
|
|
7
7
|
import { AmbientLight } from "./lighting/AmbientLight";
|
|
8
|
+
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
8
9
|
import { ShaderData } from "./shader/ShaderData";
|
|
9
10
|
import { ShadowCascadesMode } from "./shadow/enum/ShadowCascadesMode";
|
|
10
11
|
import { ShadowResolution } from "./shadow/enum/ShadowResolution";
|
|
@@ -18,6 +19,8 @@ export declare class Scene extends EngineObject {
|
|
|
18
19
|
private static _sunlightDirectionProperty;
|
|
19
20
|
/** Scene name. */
|
|
20
21
|
name: string;
|
|
22
|
+
/** Physics. */
|
|
23
|
+
readonly physics: PhysicsScene;
|
|
21
24
|
/** The background of the scene. */
|
|
22
25
|
readonly background: Background;
|
|
23
26
|
/** Scene-related shader data. */
|
|
@@ -134,10 +137,6 @@ export declare class Scene extends EngineObject {
|
|
|
134
137
|
* @returns Entity
|
|
135
138
|
*/
|
|
136
139
|
findEntityByPath(path: string): Entity | null;
|
|
137
|
-
/**
|
|
138
|
-
* Destroy this scene.
|
|
139
|
-
*/
|
|
140
|
-
destroy(): void;
|
|
141
140
|
private _addToRootEntityList;
|
|
142
141
|
private _computeLinearFogParams;
|
|
143
142
|
private _computeExponentialFogParams;
|
package/types/SceneManager.d.ts
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
import { AssetPromise } from "./asset/AssetPromise";
|
|
2
1
|
import { Engine } from "./Engine";
|
|
3
2
|
import { Scene } from "./Scene";
|
|
3
|
+
import { AssetPromise } from "./asset/AssetPromise";
|
|
4
4
|
/**
|
|
5
5
|
* Scene manager.
|
|
6
6
|
*/
|
|
7
7
|
export declare class SceneManager {
|
|
8
8
|
readonly engine: Engine;
|
|
9
9
|
/**
|
|
10
|
-
* Get the
|
|
10
|
+
* Get the scene list.
|
|
11
11
|
*/
|
|
12
|
-
get
|
|
13
|
-
|
|
12
|
+
get scenes(): ReadonlyArray<Scene>;
|
|
13
|
+
/**
|
|
14
|
+
* Add scene.
|
|
15
|
+
* @param scene - The scene which want to be added
|
|
16
|
+
*/
|
|
17
|
+
addScene(scene: Scene): void;
|
|
18
|
+
/**
|
|
19
|
+
* Add scene at specified index.
|
|
20
|
+
* @param index - specified index
|
|
21
|
+
* @param child - The scene which want to be added
|
|
22
|
+
*/
|
|
23
|
+
addScene(index: number, scene: Scene): void;
|
|
24
|
+
/**
|
|
25
|
+
* Remove scene.
|
|
26
|
+
* @param scene - The scene which want to be removed
|
|
27
|
+
*/
|
|
28
|
+
removeScene(scene: Scene): void;
|
|
14
29
|
/**
|
|
15
30
|
* Load and activate scene.
|
|
16
31
|
* @param url - the path of the scene
|
|
17
|
-
* @param destroyOldScene - whether to destroy old scene
|
|
32
|
+
* @param destroyOldScene - whether to destroy old scene
|
|
18
33
|
* @returns scene promise
|
|
19
34
|
*/
|
|
20
35
|
loadScene(url: string, destroyOldScene?: boolean): AssetPromise<Scene>;
|
|
@@ -25,4 +40,12 @@ export declare class SceneManager {
|
|
|
25
40
|
* @param destScene - target scene
|
|
26
41
|
*/
|
|
27
42
|
mergeScenes(sourceScene: Scene, destScene: Scene): void;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated
|
|
45
|
+
* Please use `scenes` instead.
|
|
46
|
+
*
|
|
47
|
+
* Get the first scene.
|
|
48
|
+
*/
|
|
49
|
+
get activeScene(): Scene;
|
|
50
|
+
set activeScene(scene: Scene);
|
|
28
51
|
}
|
|
@@ -14,8 +14,7 @@ export declare class Animator extends Component {
|
|
|
14
14
|
protected _animatorController: AnimatorController;
|
|
15
15
|
protected _controllerUpdateFlag: BoolUpdateFlag;
|
|
16
16
|
private _animatorLayersData;
|
|
17
|
-
private
|
|
18
|
-
private _animationCurveOwners;
|
|
17
|
+
private _curveOwnerPool;
|
|
19
18
|
private _animationEventHandlerPool;
|
|
20
19
|
private _tempAnimatorStateInfo;
|
|
21
20
|
private _controlledRenderers;
|
|
@@ -61,7 +60,7 @@ export declare class Animator extends Component {
|
|
|
61
60
|
private _saveAnimatorStateData;
|
|
62
61
|
private _saveAnimatorEventHandlers;
|
|
63
62
|
private _clearCrossData;
|
|
64
|
-
private
|
|
63
|
+
private _addCrossOwner;
|
|
65
64
|
private _prepareCrossFading;
|
|
66
65
|
private _prepareStandbyCrossFading;
|
|
67
66
|
private _prepareFixedPoseCrossFading;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export { AssetPromise } from "./asset/AssetPromise";
|
|
|
22
22
|
export type { LoadItem } from "./asset/LoadItem";
|
|
23
23
|
export { AssetType } from "./asset/AssetType";
|
|
24
24
|
export { ReferResource } from "./asset/ReferResource";
|
|
25
|
-
export * from "./RenderPipeline";
|
|
25
|
+
export * from "./RenderPipeline/Index";
|
|
26
26
|
export * from "./base";
|
|
27
27
|
export { Background } from "./Background";
|
|
28
28
|
export { BackgroundMode } from "./enums/BackgroundMode";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
1
2
|
import { Keys } from "./enums/Keys";
|
|
2
|
-
import { Pointer } from "./pointer/Pointer";
|
|
3
3
|
import { PointerButton } from "./enums/PointerButton";
|
|
4
|
-
import {
|
|
4
|
+
import { Pointer } from "./pointer/Pointer";
|
|
5
5
|
/**
|
|
6
6
|
* InputManager manages device input such as mouse, touch, keyboard, etc.
|
|
7
7
|
*/
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Renderer } from "../Renderer";
|
|
2
|
-
import { ICustomClone } from "../clone/ComponentCloner";
|
|
3
2
|
import { Mesh } from "../graphic/Mesh";
|
|
4
3
|
/**
|
|
5
4
|
* MeshRenderer Component.
|
|
6
5
|
*/
|
|
7
|
-
export declare class MeshRenderer extends Renderer
|
|
6
|
+
export declare class MeshRenderer extends Renderer {
|
|
8
7
|
private static _uvMacro;
|
|
9
8
|
private static _uv1Macro;
|
|
10
9
|
private static _normalMacro;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Ray, Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { Layer } from "../Layer";
|
|
3
|
+
import { Scene } from "../Scene";
|
|
4
|
+
import { HitResult } from "./HitResult";
|
|
5
|
+
/**
|
|
6
|
+
* A physics scene is a collection of colliders and constraints which can interact.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PhysicsScene {
|
|
9
|
+
private static _collision;
|
|
10
|
+
private _scene;
|
|
11
|
+
private _restTime;
|
|
12
|
+
private _colliders;
|
|
13
|
+
private _gravity;
|
|
14
|
+
private _nativePhysicsScene;
|
|
15
|
+
private _onContactEnter;
|
|
16
|
+
private _onContactExit;
|
|
17
|
+
private _onContactStay;
|
|
18
|
+
private _onTriggerEnter;
|
|
19
|
+
private _onTriggerExit;
|
|
20
|
+
private _onTriggerStay;
|
|
21
|
+
/** The fixed time step in seconds at which physics are performed. */
|
|
22
|
+
fixedTimeStep: number;
|
|
23
|
+
/**
|
|
24
|
+
* The gravity of physics scene.
|
|
25
|
+
*/
|
|
26
|
+
get gravity(): Vector3;
|
|
27
|
+
set gravity(value: Vector3);
|
|
28
|
+
constructor(scene: Scene);
|
|
29
|
+
/**
|
|
30
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
31
|
+
* @param ray - The ray
|
|
32
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
33
|
+
*/
|
|
34
|
+
raycast(ray: Ray): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
37
|
+
* @param ray - The ray
|
|
38
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
39
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
40
|
+
*/
|
|
41
|
+
raycast(ray: Ray, outHitResult: HitResult): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
44
|
+
* @param ray - The ray
|
|
45
|
+
* @param distance - The max distance the ray should check
|
|
46
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
47
|
+
*/
|
|
48
|
+
raycast(ray: Ray, distance: number): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
51
|
+
* @param ray - The ray
|
|
52
|
+
* @param distance - The max distance the ray should check
|
|
53
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
54
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
55
|
+
*/
|
|
56
|
+
raycast(ray: Ray, distance: number, outHitResult: HitResult): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
59
|
+
* @param ray - The ray
|
|
60
|
+
* @param distance - The max distance the ray should check
|
|
61
|
+
* @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
|
|
62
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
63
|
+
*/
|
|
64
|
+
raycast(ray: Ray, distance: number, layerMask: Layer): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
67
|
+
* @param ray - The ray
|
|
68
|
+
* @param distance - The max distance the ray should check
|
|
69
|
+
* @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
|
|
70
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
71
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false.
|
|
72
|
+
*/
|
|
73
|
+
raycast(ray: Ray, distance: number, layerMask: Layer, outHitResult: HitResult): boolean;
|
|
74
|
+
private _setGravity;
|
|
75
|
+
}
|
package/types/physics/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { HitResult } from "./HitResult";
|
|
2
|
-
export { PhysicsManager } from "./PhysicsManager";
|
|
3
|
-
export { PhysicsMaterial } from "./PhysicsMaterial";
|
|
4
1
|
export { CharacterController } from "./CharacterController";
|
|
5
|
-
export * from "./shape";
|
|
6
|
-
export * from "./joint";
|
|
7
|
-
export * from "./enums";
|
|
8
2
|
export { Collider } from "./Collider";
|
|
3
|
+
export { CollisionDetectionMode, DynamicCollider, DynamicColliderConstraints } from "./DynamicCollider";
|
|
4
|
+
export { HitResult } from "./HitResult";
|
|
5
|
+
export { PhysicsMaterial } from "./PhysicsMaterial";
|
|
6
|
+
export { PhysicsScene } from "./PhysicsScene";
|
|
9
7
|
export { StaticCollider } from "./StaticCollider";
|
|
10
|
-
export
|
|
8
|
+
export * from "./enums";
|
|
9
|
+
export * from "./joint";
|
|
10
|
+
export * from "./shape";
|
package/types/shader/index.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BlendState } from "./BlendState";
|
|
2
|
+
export { DepthState } from "./DepthState";
|
|
3
|
+
export { RasterState } from "./RasterState";
|
|
4
|
+
export { RenderState } from "./RenderState";
|
|
5
|
+
export { RenderTargetBlendState } from "./RenderTargetBlendState";
|
|
6
|
+
export { StencilState } from "./StencilState";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-performance unordered array, delete uses exchange method to improve performance, internal capacity only increases.
|
|
3
|
+
*/
|
|
4
|
+
export declare class DisorderedArray<T> {
|
|
5
|
+
_elements: T[];
|
|
6
|
+
length: number;
|
|
7
|
+
constructor(count?: number);
|
|
8
|
+
add(element: T): void;
|
|
9
|
+
delete(element: T): void;
|
|
10
|
+
get(index: number): T;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param index
|
|
14
|
+
* @returns The replaced item is used to reset its index.
|
|
15
|
+
*/
|
|
16
|
+
deleteByIndex(index: number): T;
|
|
17
|
+
garbageCollection(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare class SafeLoopArray<T> {
|
|
2
|
+
private _array;
|
|
3
|
+
private _loopArray;
|
|
4
|
+
private _loopArrayDirty;
|
|
5
|
+
/**
|
|
6
|
+
* Get the length of the array.
|
|
7
|
+
*/
|
|
8
|
+
get length(): number;
|
|
9
|
+
/**
|
|
10
|
+
* Push item to the array.
|
|
11
|
+
* @param item - The item which want to be pushed
|
|
12
|
+
*/
|
|
13
|
+
push(item: T): void;
|
|
14
|
+
/**
|
|
15
|
+
* Add item to the array.
|
|
16
|
+
* @param index - The index of the array
|
|
17
|
+
* @param item - The item which want to be added
|
|
18
|
+
*/
|
|
19
|
+
add(index: number, item: T): void;
|
|
20
|
+
/**
|
|
21
|
+
* Remove item from the array.
|
|
22
|
+
* @param index - The index of the array
|
|
23
|
+
*/
|
|
24
|
+
removeByIndex(index: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* The index of the item.
|
|
27
|
+
* @param item - The item which want to get the index
|
|
28
|
+
* @returns Index of the item
|
|
29
|
+
*/
|
|
30
|
+
indexOf(item: T): number;
|
|
31
|
+
/**
|
|
32
|
+
* Get the array.
|
|
33
|
+
* @returns The array
|
|
34
|
+
*/
|
|
35
|
+
getArray(): ReadonlyArray<T>;
|
|
36
|
+
/**
|
|
37
|
+
* Get the array use for loop.
|
|
38
|
+
* @returns The array use for loop
|
|
39
|
+
*/
|
|
40
|
+
getLoopArray(): ReadonlyArray<T>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used to update tags.
|
|
3
|
+
*/
|
|
4
|
+
export declare abstract class UpdateFlag {
|
|
5
|
+
/**
|
|
6
|
+
* Dispatch.
|
|
7
|
+
* @param bit - Bit
|
|
8
|
+
* @param param - Parameter
|
|
9
|
+
*/
|
|
10
|
+
abstract dispatch(bit?: number, param?: Object): void;
|
|
11
|
+
/**
|
|
12
|
+
* Clear.
|
|
13
|
+
*/
|
|
14
|
+
clearFromManagers(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Destroy.
|
|
17
|
+
*/
|
|
18
|
+
destroy(): void;
|
|
19
|
+
private _removeFromManagers;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare class Utils {
|
|
2
|
+
/**
|
|
3
|
+
* Fast remove an element from array.
|
|
4
|
+
* @param array - Array
|
|
5
|
+
* @param item - Element
|
|
6
|
+
*/
|
|
7
|
+
static removeFromArray(array: any[], item: any): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Decodes a given Uint8Array into a string.
|
|
10
|
+
*/
|
|
11
|
+
static decodeText(array: Uint8Array): string;
|
|
12
|
+
/**
|
|
13
|
+
* Judge whether the url is absolute url.
|
|
14
|
+
* @param url - The url to be judged.
|
|
15
|
+
* @returns Whether the url is absolute url.
|
|
16
|
+
*/
|
|
17
|
+
static isAbsoluteUrl(url: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Get the values of an object.
|
|
20
|
+
*/
|
|
21
|
+
static objectValues(obj: any): any[];
|
|
22
|
+
/**
|
|
23
|
+
* Convert a relative URL to an absolute URL based on a given base URL.
|
|
24
|
+
* @param baseUrl - The base url.
|
|
25
|
+
* @param relativeUrl - The relative url.
|
|
26
|
+
* @returns The resolved url.
|
|
27
|
+
*/
|
|
28
|
+
static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
|
|
29
|
+
private static _stringToPath;
|
|
30
|
+
private static _formatRelativePath;
|
|
31
|
+
}
|