@galacean/engine-core 0.0.0-experimental-renderSort.4 → 0.0.0-experimental-stateMachine.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/LICENSE +2 -2
- package/dist/main.js +22858 -21862
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +22858 -21862
- package/dist/module.js +21193 -20200
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/BasicResources.d.ts +1 -0
- package/types/Camera.d.ts +48 -8
- package/types/Canvas.d.ts +15 -5
- package/types/Component.d.ts +2 -0
- package/types/ComponentsManager.d.ts +3 -0
- package/types/DisorderedArray.d.ts +1 -0
- package/types/Engine.d.ts +9 -3
- package/types/Entity.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +9 -32
- package/types/RenderPipeline/OpaqueTexturePass.d.ts +1 -0
- package/types/RenderPipeline/RenderQueue.d.ts +1 -9
- package/types/RenderPipeline/{Index.d.ts → index.d.ts} +0 -1
- package/types/Renderer.d.ts +4 -1
- package/types/Scene.d.ts +14 -2
- package/types/SystemInfo.d.ts +2 -0
- package/types/Utils.d.ts +7 -1
- package/types/animation/AnimationClip.d.ts +32 -4
- package/types/animation/AnimationClipCurveBinding.d.ts +12 -2
- package/types/animation/Animator.d.ts +30 -1
- package/types/animation/AnimatorCondition.d.ts +13 -0
- package/types/animation/AnimatorController.d.ts +21 -2
- package/types/animation/AnimatorControllerLayer.d.ts +3 -0
- package/types/animation/AnimatorControllerParameter.d.ts +10 -0
- package/types/animation/AnimatorLayerMask.d.ts +45 -0
- package/types/animation/AnimatorState.d.ts +17 -4
- package/types/animation/AnimatorStateMachine.d.ts +39 -0
- package/types/animation/AnimatorTransition.d.ts +33 -0
- package/types/animation/Keyframe.d.ts +1 -1
- package/types/animation/LayerPathMask.d.ts +16 -0
- package/types/animation/animationCurve/AnimationStringCurve.d.ts +7 -0
- package/types/animation/animationCurve/index.d.ts +1 -0
- package/types/animation/index.d.ts +1 -0
- package/types/asset/AssetPromise.d.ts +10 -5
- package/types/asset/AssetType.d.ts +2 -0
- package/types/asset/Loader.d.ts +7 -0
- package/types/asset/ReferResource.d.ts +3 -2
- package/types/asset/ResourceManager.d.ts +2 -0
- package/types/base/Constant.d.ts +1 -0
- package/types/enums/CameraType.d.ts +1 -0
- package/types/enums/Downsampling.d.ts +11 -0
- package/types/enums/MSAASamples.d.ts +13 -0
- package/types/index.d.ts +5 -1
- package/types/input/InputManager.d.ts +0 -2
- package/types/input/interface/IInput.d.ts +0 -8
- package/types/lighting/Light.d.ts +0 -1
- package/types/lighting/LightManager.d.ts +0 -1
- package/types/material/PBRMaterial.d.ts +23 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +2 -0
- package/types/particle/modules/MainModule.d.ts +2 -0
- package/types/particle/modules/shape/BaseShape.d.ts +2 -2
- package/types/particle/modules/shape/BoxShape.d.ts +2 -1
- package/types/particle/modules/shape/CircleShape.d.ts +2 -1
- package/types/particle/modules/shape/ConeShape.d.ts +2 -1
- package/types/particle/modules/shape/HemisphereShape.d.ts +2 -1
- package/types/particle/modules/shape/SphereShape.d.ts +2 -1
- package/types/particle/modules/shape/index.d.ts +1 -0
- package/types/physics/HitResult.d.ts +3 -0
- package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +2 -2
- package/types/renderingHardwareInterface/index.d.ts +0 -1
- package/types/shader/Shader.d.ts +15 -2
- package/types/shader/state/DepthState.d.ts +2 -2
- package/types/shaderlib/ShaderFactory.d.ts +8 -1
- package/types/shadow/CascadedShadowCasterPass.d.ts +0 -1
- package/types/texture/RenderTarget.d.ts +5 -4
- package/types/texture/Texture.d.ts +1 -0
- package/types/texture/enums/RenderBufferDepthFormat.d.ts +11 -9
- package/types/texture/enums/TextureFormat.d.ts +30 -26
- package/types/xr/XRManager.d.ts +5 -0
- package/types/RenderPipeline/MeshRenderData.d.ts +0 -17
- package/types/RenderPipeline/RenderPass.d.ts +0 -55
- package/types/physics/PhysicsManager.d.ts +0 -76
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +0 -6
package/types/shader/Shader.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Engine } from "../Engine";
|
|
2
|
+
import { IReferable } from "../asset/IReferable";
|
|
2
3
|
import { ShaderMacro } from "./ShaderMacro";
|
|
3
4
|
import { ShaderPass } from "./ShaderPass";
|
|
4
5
|
import { ShaderProperty } from "./ShaderProperty";
|
|
@@ -6,7 +7,7 @@ import { SubShader } from "./SubShader";
|
|
|
6
7
|
/**
|
|
7
8
|
* Shader for rendering.
|
|
8
9
|
*/
|
|
9
|
-
export declare class Shader {
|
|
10
|
+
export declare class Shader implements IReferable {
|
|
10
11
|
readonly name: string;
|
|
11
12
|
private static _shaderMap;
|
|
12
13
|
/**
|
|
@@ -57,11 +58,18 @@ export declare class Shader {
|
|
|
57
58
|
* @param name - Name of the shader
|
|
58
59
|
*/
|
|
59
60
|
static find(name: string): Shader;
|
|
61
|
+
private static _applyConstRenderStates;
|
|
62
|
+
private _refCount;
|
|
63
|
+
private _destroyed;
|
|
60
64
|
private _subShaders;
|
|
61
65
|
/**
|
|
62
66
|
* Sub shaders of the shader.
|
|
63
67
|
*/
|
|
64
68
|
get subShaders(): ReadonlyArray<SubShader>;
|
|
69
|
+
/**
|
|
70
|
+
* Whether it has been destroyed.
|
|
71
|
+
*/
|
|
72
|
+
get destroyed(): boolean;
|
|
65
73
|
private constructor();
|
|
66
74
|
/**
|
|
67
75
|
* Compile shader variant by macro name list.
|
|
@@ -74,7 +82,12 @@ export declare class Shader {
|
|
|
74
82
|
* @returns Is the compiled shader variant valid
|
|
75
83
|
*/
|
|
76
84
|
compileVariant(engine: Engine, macros: string[]): boolean;
|
|
77
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Destroy the shader.
|
|
87
|
+
* @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
|
|
88
|
+
* @returns Whether the release was successful.
|
|
89
|
+
*/
|
|
90
|
+
destroy(force?: boolean): boolean;
|
|
78
91
|
/**
|
|
79
92
|
* @deprecated Please use `ShaderMacro.getByName` instead
|
|
80
93
|
*
|
|
@@ -6,9 +6,9 @@ export declare class DepthState {
|
|
|
6
6
|
private static _getGLCompareFunction;
|
|
7
7
|
/** Whether to enable the depth test. */
|
|
8
8
|
enabled: boolean;
|
|
9
|
-
/** Whether the depth value can be written.*/
|
|
10
|
-
writeEnabled: boolean;
|
|
11
9
|
/** Depth comparison function. */
|
|
12
10
|
compareFunction: CompareFunction;
|
|
11
|
+
/** Whether the depth value can be written.*/
|
|
12
|
+
writeEnabled: boolean;
|
|
13
13
|
private _platformApply;
|
|
14
14
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
export declare class ShaderFactory {
|
|
2
|
+
private static readonly _has300OutInFragReg;
|
|
2
3
|
static parseCustomMacros(macros: string[]): string;
|
|
3
4
|
static registerInclude(includeName: string, includeSource: string): void;
|
|
4
|
-
static
|
|
5
|
+
static unRegisterInclude(includeName: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* @param regex The default regex is for engine's builtin glsl `#include` syntax,
|
|
8
|
+
* since `ShaderLab` use the same parsing function but different syntax for `#include` --- `/^[ \t]*#include +"([\w\d.]+)"/gm`
|
|
9
|
+
*/
|
|
10
|
+
static parseIncludes(src: string, regex?: RegExp): string;
|
|
5
11
|
/**
|
|
6
12
|
* Convert lower GLSL version to GLSL 300 es.
|
|
7
13
|
* @param shader - code
|
|
8
14
|
* @param isFrag - Whether it is a fragment shader.
|
|
9
15
|
* */
|
|
10
16
|
static convertTo300(shader: string, isFrag?: boolean): string;
|
|
17
|
+
private static _has300Output;
|
|
11
18
|
private static _replaceMRTShader;
|
|
12
19
|
}
|
|
@@ -28,7 +28,6 @@ export declare class CascadedShadowCasterPass extends PipelinePass {
|
|
|
28
28
|
private _shadowSliceData;
|
|
29
29
|
private _lightUp;
|
|
30
30
|
private _lightSide;
|
|
31
|
-
private _existShadowMap;
|
|
32
31
|
private _splitBoundSpheres;
|
|
33
32
|
/** The end is project precision problem in shader. */
|
|
34
33
|
private _shadowMatrices;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GraphicsResource } from "../asset/GraphicsResource";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
3
|
import { RenderBufferDepthFormat } from "./enums/RenderBufferDepthFormat";
|
|
4
|
+
import { TextureFormat } from "./enums/TextureFormat";
|
|
4
5
|
import { Texture } from "./Texture";
|
|
5
6
|
/**
|
|
6
7
|
* The render target used for off-screen rendering.
|
|
@@ -43,10 +44,10 @@ export declare class RenderTarget extends GraphicsResource {
|
|
|
43
44
|
* @param width - Render target width
|
|
44
45
|
* @param height - Render target height
|
|
45
46
|
* @param colorTexture - Render color texture
|
|
46
|
-
* @param depthFormat - Depth format. default
|
|
47
|
+
* @param depthFormat - Depth format. default TextureFormat.Depth, engine will automatically select the supported precision
|
|
47
48
|
* @param antiAliasing - Anti-aliasing level, default is 1
|
|
48
49
|
*/
|
|
49
|
-
constructor(engine: Engine, width: number, height: number, colorTexture: Texture, depthFormat?:
|
|
50
|
+
constructor(engine: Engine, width: number, height: number, colorTexture: Texture, depthFormat?: TextureFormat | null | RenderBufferDepthFormat, antiAliasing?: number);
|
|
50
51
|
/**
|
|
51
52
|
* Create a render target through color texture and depth format.
|
|
52
53
|
* @remarks If the color texture is not transmitted, only the depth texture is generated.
|
|
@@ -64,10 +65,10 @@ export declare class RenderTarget extends GraphicsResource {
|
|
|
64
65
|
* @param width - Render target width
|
|
65
66
|
* @param height - Render target height
|
|
66
67
|
* @param colorTextures - Render color texture array
|
|
67
|
-
* @param depthFormat - Depth format. default
|
|
68
|
+
* @param depthFormat - Depth format. default TextureFormat.Depth,engine will automatically select the supported precision
|
|
68
69
|
* @param antiAliasing - Anti-aliasing level, default is 1
|
|
69
70
|
*/
|
|
70
|
-
constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthFormat?:
|
|
71
|
+
constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthFormat?: TextureFormat | null | RenderBufferDepthFormat, antiAliasing?: number);
|
|
71
72
|
/**
|
|
72
73
|
* Create a render target with color texture array and depth texture.
|
|
73
74
|
* @param engine - Define the engine to use for this off-screen rendering
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @deprecated Please use `TextureFormat` instead.
|
|
3
|
+
*
|
|
2
4
|
* Render buffer depth format enumeration.
|
|
3
5
|
*/
|
|
4
6
|
export declare enum RenderBufferDepthFormat {
|
|
5
7
|
/** Render to depth buffer,engine will automatically select the supported precision. */
|
|
6
|
-
Depth =
|
|
7
|
-
/** Render to depth stencil buffer, engine will automatically select the supported precision. */
|
|
8
|
-
DepthStencil = 1,
|
|
8
|
+
Depth = 27,
|
|
9
9
|
/** Render to stencil buffer. */
|
|
10
|
-
Stencil =
|
|
10
|
+
Stencil = 28,
|
|
11
|
+
/** Render to depth stencil buffer, engine will automatically select the supported precision. */
|
|
12
|
+
DepthStencil = 29,
|
|
11
13
|
/** Force 16-bit depth buffer. */
|
|
12
|
-
Depth16 =
|
|
14
|
+
Depth16 = 30,
|
|
13
15
|
/** Force 24-bit depth buffer. */
|
|
14
|
-
Depth24 =
|
|
16
|
+
Depth24 = 31,
|
|
15
17
|
/** Force 32-bit depth buffer. */
|
|
16
|
-
Depth32 =
|
|
18
|
+
Depth32 = 32,
|
|
17
19
|
/** Force 16-bit depth + 8-bit stencil buffer. */
|
|
18
|
-
Depth24Stencil8 =
|
|
20
|
+
Depth24Stencil8 = 33,
|
|
19
21
|
/** Force 32-bit depth + 8-bit stencil buffer. */
|
|
20
|
-
Depth32Stencil8 =
|
|
22
|
+
Depth32Stencil8 = 34
|
|
21
23
|
}
|
|
@@ -20,56 +20,60 @@ export declare enum TextureFormat {
|
|
|
20
20
|
R16G16B16A16 = 7,
|
|
21
21
|
/** RGBA format, 32 bits per channel. */
|
|
22
22
|
R32G32B32A32 = 8,
|
|
23
|
+
/** RGBA unsigned integer format, 32 bits per channel. */
|
|
24
|
+
R32G32B32A32_UInt = 9,
|
|
23
25
|
/** RGB compressed format, 4 bits per pixel. */
|
|
24
|
-
BC1 =
|
|
26
|
+
BC1 = 10,
|
|
25
27
|
/** RGBA compressed format, 8 bits per pixel. */
|
|
26
|
-
BC3 =
|
|
28
|
+
BC3 = 11,
|
|
27
29
|
/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
|
|
28
|
-
BC7 =
|
|
30
|
+
BC7 = 12,
|
|
29
31
|
/** RGB compressed format, 4 bits per pixel. */
|
|
30
|
-
ETC1_RGB =
|
|
32
|
+
ETC1_RGB = 13,
|
|
31
33
|
/** RGB compressed format, 4 bits per pixel. */
|
|
32
|
-
ETC2_RGB =
|
|
34
|
+
ETC2_RGB = 14,
|
|
33
35
|
/** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */
|
|
34
|
-
ETC2_RGBA5 =
|
|
36
|
+
ETC2_RGBA5 = 15,
|
|
35
37
|
/** RGB compressed format, 8 bits per pixel. */
|
|
36
|
-
ETC2_RGBA8 =
|
|
38
|
+
ETC2_RGBA8 = 16,
|
|
37
39
|
/** RGB compressed format, 2 bits per pixel. */
|
|
38
|
-
PVRTC_RGB2 =
|
|
40
|
+
PVRTC_RGB2 = 17,
|
|
39
41
|
/** RGBA compressed format, 2 bits per pixel. */
|
|
40
|
-
PVRTC_RGBA2 =
|
|
42
|
+
PVRTC_RGBA2 = 18,
|
|
41
43
|
/** RGB compressed format, 4 bits per pixel. */
|
|
42
|
-
PVRTC_RGB4 =
|
|
44
|
+
PVRTC_RGB4 = 19,
|
|
43
45
|
/** RGBA compressed format, 4 bits per pixel. */
|
|
44
|
-
PVRTC_RGBA4 =
|
|
46
|
+
PVRTC_RGBA4 = 20,
|
|
45
47
|
/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
|
|
46
|
-
ASTC_4x4 =
|
|
48
|
+
ASTC_4x4 = 21,
|
|
47
49
|
/** RGB(A) compressed format, 128 bits per 5x5 pixel block. */
|
|
48
|
-
ASTC_5x5 =
|
|
50
|
+
ASTC_5x5 = 22,
|
|
49
51
|
/** RGB(A) compressed format, 128 bits per 6x6 pixel block. */
|
|
50
|
-
ASTC_6x6 =
|
|
52
|
+
ASTC_6x6 = 23,
|
|
51
53
|
/** RGB(A) compressed format, 128 bits per 8x8 pixel block. */
|
|
52
|
-
ASTC_8x8 =
|
|
54
|
+
ASTC_8x8 = 24,
|
|
53
55
|
/** RGB(A) compressed format, 128 bits per 10x10 pixel block. */
|
|
54
|
-
ASTC_10x10 =
|
|
56
|
+
ASTC_10x10 = 25,
|
|
55
57
|
/** RGB(A) compressed format, 128 bits per 12x12 pixel block. */
|
|
56
|
-
ASTC_12x12 =
|
|
58
|
+
ASTC_12x12 = 26,
|
|
57
59
|
/** Automatic depth format, engine will automatically select the supported precision. */
|
|
58
|
-
Depth =
|
|
60
|
+
Depth = 27,
|
|
61
|
+
/** Render to stencil buffer. */
|
|
62
|
+
Stencil = 28,
|
|
59
63
|
/** Automatic depth stencil format, engine will automatically select the supported precision. */
|
|
60
|
-
DepthStencil =
|
|
64
|
+
DepthStencil = 29,
|
|
61
65
|
/** 16-bit depth format. */
|
|
62
|
-
Depth16 =
|
|
66
|
+
Depth16 = 30,
|
|
63
67
|
/** 24-bit depth format. */
|
|
64
|
-
Depth24 =
|
|
68
|
+
Depth24 = 31,
|
|
65
69
|
/** 32-bit depth format. */
|
|
66
|
-
Depth32 =
|
|
70
|
+
Depth32 = 32,
|
|
67
71
|
/** 16-bit depth + 8-bit stencil format. */
|
|
68
|
-
Depth24Stencil8 =
|
|
72
|
+
Depth24Stencil8 = 33,
|
|
69
73
|
/** 32-bit depth + 8-bit stencil format. */
|
|
70
|
-
Depth32Stencil8 =
|
|
74
|
+
Depth32Stencil8 = 34,
|
|
71
75
|
/** @deprecated Use `TextureFormat.BC1` instead. */
|
|
72
|
-
DXT1 =
|
|
76
|
+
DXT1 = 10,
|
|
73
77
|
/** @deprecated Use `TextureFormat.BC3` instead. */
|
|
74
|
-
DXT5 =
|
|
78
|
+
DXT5 = 11
|
|
75
79
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Mesh } from "../graphic/Mesh";
|
|
2
|
-
import { SubMesh } from "../graphic/SubMesh";
|
|
3
|
-
import { Material } from "../material/Material";
|
|
4
|
-
import { Renderer } from "../Renderer";
|
|
5
|
-
import { IPoolElement } from "./IPoolElement";
|
|
6
|
-
import { RenderData } from "./RenderData";
|
|
7
|
-
/**
|
|
8
|
-
* Render element.
|
|
9
|
-
*/
|
|
10
|
-
export declare class MeshRenderData extends RenderData implements IPoolElement {
|
|
11
|
-
/** Mesh. */
|
|
12
|
-
mesh: Mesh;
|
|
13
|
-
/** Sub mesh. */
|
|
14
|
-
subMesh: SubMesh;
|
|
15
|
-
set(component: Renderer, material: Material, mesh: Mesh, subMesh: SubMesh): void;
|
|
16
|
-
dispose(): void;
|
|
17
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Color } from "@galacean/engine-math";
|
|
2
|
-
import { Camera } from "../Camera";
|
|
3
|
-
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
4
|
-
import { Layer } from "../Layer";
|
|
5
|
-
import { Material } from "../material/Material";
|
|
6
|
-
import { RenderTarget } from "../texture/RenderTarget";
|
|
7
|
-
import { RenderQueue } from "./RenderQueue";
|
|
8
|
-
/**
|
|
9
|
-
* RenderPass.
|
|
10
|
-
*/
|
|
11
|
-
declare class RenderPass {
|
|
12
|
-
name: string;
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
priority: number;
|
|
15
|
-
renderTarget: RenderTarget;
|
|
16
|
-
replaceMaterial: Material;
|
|
17
|
-
mask: Layer;
|
|
18
|
-
renderOverride: boolean;
|
|
19
|
-
clearFlags: CameraClearFlags | undefined;
|
|
20
|
-
clearColor: Color | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Create a RenderPass.
|
|
23
|
-
* @param name - Pass name
|
|
24
|
-
* @param priority - Priority, less than 0 before the default pass, greater than 0 after the default pass
|
|
25
|
-
* @param renderTarget - The specified Render Target
|
|
26
|
-
* @param replaceMaterial - Replaced material
|
|
27
|
-
* @param mask - Perform bit and operations with Entity.Layer to filter the objects that this Pass needs to render
|
|
28
|
-
*/
|
|
29
|
-
constructor(name?: string, priority?: number, renderTarget?: any, replaceMaterial?: any, mask?: any);
|
|
30
|
-
/**
|
|
31
|
-
* Rendering callback, will be executed if renderOverride is set to true.
|
|
32
|
-
* @param camera - Camera
|
|
33
|
-
* @param opaqueQueue - Opaque queue
|
|
34
|
-
* @param alphaTestQueue - Alpha test queue
|
|
35
|
-
* @param transparentQueue - Transparent queue
|
|
36
|
-
*/
|
|
37
|
-
render(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
38
|
-
/**
|
|
39
|
-
* Post rendering callback.
|
|
40
|
-
* @param camera - Camera
|
|
41
|
-
* @param opaqueQueue - Opaque queue
|
|
42
|
-
* @param alphaTestQueue - Alpha test queue
|
|
43
|
-
* @param transparentQueue - Transparent queue
|
|
44
|
-
*/
|
|
45
|
-
preRender(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
46
|
-
/**
|
|
47
|
-
* Post rendering callback.
|
|
48
|
-
* @param camera - Camera
|
|
49
|
-
* @param opaqueQueue - Opaque queue
|
|
50
|
-
* @param alphaTestQueue - Alpha test queue
|
|
51
|
-
* @param transparentQueue - Transparent queue
|
|
52
|
-
*/
|
|
53
|
-
postRender(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
54
|
-
}
|
|
55
|
-
export { RenderPass };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Ray, Vector3 } from "@galacean/engine-math";
|
|
2
|
-
import { Engine } from "../Engine";
|
|
3
|
-
import { Layer } from "../Layer";
|
|
4
|
-
import { HitResult } from "./HitResult";
|
|
5
|
-
/**
|
|
6
|
-
* A physics manager is a collection of colliders and constraints which can interact.
|
|
7
|
-
*/
|
|
8
|
-
export declare class PhysicsManager {
|
|
9
|
-
private static _collision;
|
|
10
|
-
private _engine;
|
|
11
|
-
private _restTime;
|
|
12
|
-
private _colliders;
|
|
13
|
-
private _gravity;
|
|
14
|
-
private _nativePhysicsManager;
|
|
15
|
-
private _physicalObjectsMap;
|
|
16
|
-
private _onContactEnter;
|
|
17
|
-
private _onContactExit;
|
|
18
|
-
private _onContactStay;
|
|
19
|
-
private _onTriggerEnter;
|
|
20
|
-
private _onTriggerExit;
|
|
21
|
-
private _onTriggerStay;
|
|
22
|
-
/** The fixed time step in seconds at which physics are performed. */
|
|
23
|
-
fixedTimeStep: number;
|
|
24
|
-
/**
|
|
25
|
-
* The gravity of physics scene.
|
|
26
|
-
*/
|
|
27
|
-
get gravity(): Vector3;
|
|
28
|
-
set gravity(value: Vector3);
|
|
29
|
-
constructor(engine: Engine);
|
|
30
|
-
/**
|
|
31
|
-
* Casts a ray through the Scene and returns the first hit.
|
|
32
|
-
* @param ray - The ray
|
|
33
|
-
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
34
|
-
*/
|
|
35
|
-
raycast(ray: Ray): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Casts a ray through the Scene and returns the first hit.
|
|
38
|
-
* @param ray - The ray
|
|
39
|
-
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
40
|
-
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
41
|
-
*/
|
|
42
|
-
raycast(ray: Ray, outHitResult: HitResult): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Casts a ray through the Scene and returns the first hit.
|
|
45
|
-
* @param ray - The ray
|
|
46
|
-
* @param distance - The max distance the ray should check
|
|
47
|
-
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
48
|
-
*/
|
|
49
|
-
raycast(ray: Ray, distance: number): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Casts a ray through the Scene and returns the first hit.
|
|
52
|
-
* @param ray - The ray
|
|
53
|
-
* @param distance - The max distance the ray should check
|
|
54
|
-
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
55
|
-
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
56
|
-
*/
|
|
57
|
-
raycast(ray: Ray, distance: number, outHitResult: HitResult): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Casts a ray through the Scene and returns the first hit.
|
|
60
|
-
* @param ray - The ray
|
|
61
|
-
* @param distance - The max distance the ray should check
|
|
62
|
-
* @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
|
|
63
|
-
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
64
|
-
*/
|
|
65
|
-
raycast(ray: Ray, distance: number, layerMask: Layer): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Casts a ray through the Scene and returns the first hit.
|
|
68
|
-
* @param ray - The ray
|
|
69
|
-
* @param distance - The max distance the ray should check
|
|
70
|
-
* @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
|
|
71
|
-
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
72
|
-
* @returns Returns True if the ray intersects with a collider, otherwise false.
|
|
73
|
-
*/
|
|
74
|
-
raycast(ray: Ray, distance: number, layerMask: Layer, outHitResult: HitResult): boolean;
|
|
75
|
-
private _setGravity;
|
|
76
|
-
}
|