@galacean/engine-core 1.1.0-beta.3 → 1.1.0-beta.4
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 +71 -82
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +71 -82
- package/dist/module.js +71 -82
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
- package/types/RenderPipeline/SpriteElement.d.ts +3 -1
- package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
- package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
- package/types/lighting/DirectLight.d.ts +8 -1
- package/types/lighting/Light.d.ts +0 -4
- package/types/lighting/LightManager.d.ts +7 -0
- package/types/lighting/PointLight.d.ts +9 -1
- package/types/lighting/SpotLight.d.ts +12 -1
- package/types/particle/modules/MainModule.d.ts +7 -5
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +1 -1
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +0 -4
- package/types/physics/PhysicsManager.d.ts +22 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.4",
|
|
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.1.0-beta.
|
|
18
|
+
"@galacean/engine-math": "1.1.0-beta.4"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.1.0-beta.
|
|
21
|
+
"@galacean/engine-design": "1.1.0-beta.4"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -4,14 +4,16 @@ import { Material } from "../material/Material";
|
|
|
4
4
|
import { Renderer } from "../Renderer";
|
|
5
5
|
import { ShaderPass } from "../shader/ShaderPass";
|
|
6
6
|
import { RenderState } from "../shader/state/RenderState";
|
|
7
|
+
import { IPoolElement } from "./IPoolElement";
|
|
7
8
|
import { RenderElement } from "./RenderElement";
|
|
8
9
|
/**
|
|
9
10
|
* Render element.
|
|
10
11
|
*/
|
|
11
|
-
export declare class MeshRenderElement extends RenderElement {
|
|
12
|
+
export declare class MeshRenderElement extends RenderElement implements IPoolElement {
|
|
12
13
|
/** Mesh. */
|
|
13
14
|
mesh: Mesh;
|
|
14
15
|
/** Sub mesh. */
|
|
15
16
|
subMesh: SubMesh;
|
|
16
17
|
setValue(component: Renderer, mesh: Mesh, subMesh: SubMesh, material: Material, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
18
|
+
dispose(): void;
|
|
17
19
|
}
|
|
@@ -4,10 +4,12 @@ import { Renderer } from "../Renderer";
|
|
|
4
4
|
import { ShaderPass } from "../shader";
|
|
5
5
|
import { RenderState } from "../shader/state/RenderState";
|
|
6
6
|
import { Texture2D } from "../texture";
|
|
7
|
+
import { IPoolElement } from "./IPoolElement";
|
|
7
8
|
import { RenderElement } from "./RenderElement";
|
|
8
|
-
export declare class SpriteElement extends RenderElement {
|
|
9
|
+
export declare class SpriteElement extends RenderElement implements IPoolElement {
|
|
9
10
|
renderData: RenderData2D;
|
|
10
11
|
texture: Texture2D;
|
|
11
12
|
constructor();
|
|
12
13
|
setValue(component: Renderer, renderDate: RenderData2D, material: Material, texture: Texture2D, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
14
|
+
dispose(): void;
|
|
13
15
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { RenderData2D } from "../2d/data/RenderData2D";
|
|
2
2
|
import { Material } from "../material/Material";
|
|
3
3
|
import { Renderer } from "../Renderer";
|
|
4
|
+
import { IPoolElement } from "./IPoolElement";
|
|
4
5
|
import { RenderElement } from "./RenderElement";
|
|
5
|
-
export declare class SpriteMaskElement extends RenderElement {
|
|
6
|
+
export declare class SpriteMaskElement extends RenderElement implements IPoolElement {
|
|
6
7
|
renderData: RenderData2D;
|
|
7
8
|
isAdd: boolean;
|
|
8
9
|
constructor();
|
|
9
10
|
setValue(component: Renderer, renderData: RenderData2D, material: Material): void;
|
|
11
|
+
dispose(): void;
|
|
10
12
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IPoolElement } from "./IPoolElement";
|
|
1
2
|
import { RenderElement } from "./RenderElement";
|
|
2
3
|
import { SpriteElement } from "./SpriteElement";
|
|
3
|
-
export declare class TextRenderElement extends RenderElement {
|
|
4
|
+
export declare class TextRenderElement extends RenderElement implements IPoolElement {
|
|
4
5
|
charElements: SpriteElement[];
|
|
5
6
|
constructor();
|
|
7
|
+
dispose(): void;
|
|
6
8
|
}
|
|
@@ -7,7 +7,6 @@ export declare class DirectLight extends Light {
|
|
|
7
7
|
private static _cullingMaskProperty;
|
|
8
8
|
private static _colorProperty;
|
|
9
9
|
private static _directionProperty;
|
|
10
|
-
private static _combinedData;
|
|
11
10
|
private _reverseDirection;
|
|
12
11
|
/**
|
|
13
12
|
* Get direction.
|
|
@@ -18,3 +17,11 @@ export declare class DirectLight extends Light {
|
|
|
18
17
|
*/
|
|
19
18
|
get reverseDirection(): Vector3;
|
|
20
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Shader properties data of direct lights in the scene.
|
|
22
|
+
*/
|
|
23
|
+
export interface IDirectLightShaderData {
|
|
24
|
+
cullingMask: Int32Array;
|
|
25
|
+
color: Float32Array;
|
|
26
|
+
direction: Float32Array;
|
|
27
|
+
}
|
|
@@ -6,10 +6,6 @@ import { ShadowType } from "../shadow";
|
|
|
6
6
|
* Light base class.
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class Light extends Component {
|
|
9
|
-
/**
|
|
10
|
-
* Each type of light source is at most 10, beyond which it will not take effect.
|
|
11
|
-
* */
|
|
12
|
-
protected static _maxLight: number;
|
|
13
9
|
/** Light Intensity */
|
|
14
10
|
intensity: number;
|
|
15
11
|
/**
|
|
@@ -2,5 +2,12 @@
|
|
|
2
2
|
* Light manager.
|
|
3
3
|
*/
|
|
4
4
|
export declare class LightManager {
|
|
5
|
+
/**
|
|
6
|
+
* Each type of light source is at most 10, beyond which it will not take effect.
|
|
7
|
+
* */
|
|
8
|
+
private static _maxLight;
|
|
9
|
+
private _directData;
|
|
10
|
+
private _pointData;
|
|
11
|
+
private _spotData;
|
|
5
12
|
private _getSunLightIndex;
|
|
6
13
|
}
|
|
@@ -8,7 +8,6 @@ export declare class PointLight extends Light {
|
|
|
8
8
|
private static _colorProperty;
|
|
9
9
|
private static _positionProperty;
|
|
10
10
|
private static _distanceProperty;
|
|
11
|
-
private static _combinedData;
|
|
12
11
|
/** Defines a distance cutoff at which the light's intensity must be considered zero. */
|
|
13
12
|
distance: number;
|
|
14
13
|
/**
|
|
@@ -16,3 +15,12 @@ export declare class PointLight extends Light {
|
|
|
16
15
|
*/
|
|
17
16
|
get position(): Vector3;
|
|
18
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Shader properties data of point lights in the scene.
|
|
20
|
+
*/
|
|
21
|
+
export interface IPointLightShaderData {
|
|
22
|
+
cullingMask: Int32Array;
|
|
23
|
+
color: Float32Array;
|
|
24
|
+
position: Float32Array;
|
|
25
|
+
distance: Float32Array;
|
|
26
|
+
}
|
|
@@ -11,7 +11,6 @@ export declare class SpotLight extends Light {
|
|
|
11
11
|
private static _distanceProperty;
|
|
12
12
|
private static _angleCosProperty;
|
|
13
13
|
private static _penumbraCosProperty;
|
|
14
|
-
private static _combinedData;
|
|
15
14
|
/** Defines a distance cutoff at which the light's intensity must be considered zero. */
|
|
16
15
|
distance: number;
|
|
17
16
|
/** Angle, in radians, from centre of spotlight where falloff begins. */
|
|
@@ -33,3 +32,15 @@ export declare class SpotLight extends Light {
|
|
|
33
32
|
*/
|
|
34
33
|
get reverseDirection(): Vector3;
|
|
35
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Shader properties data of spot lights in the scene.
|
|
37
|
+
*/
|
|
38
|
+
export interface ISpotLightShaderData {
|
|
39
|
+
cullingMask: Int32Array;
|
|
40
|
+
color: Float32Array;
|
|
41
|
+
position: Float32Array;
|
|
42
|
+
direction: Float32Array;
|
|
43
|
+
distance: Float32Array;
|
|
44
|
+
angleCos: Float32Array;
|
|
45
|
+
penumbraCos: Float32Array;
|
|
46
|
+
}
|
|
@@ -26,22 +26,19 @@ export declare class MainModule implements ICustomClone {
|
|
|
26
26
|
startSpeed: ParticleCompositeCurve;
|
|
27
27
|
/** A flag to enable specifying particle size individually for each axis. */
|
|
28
28
|
startSize3D: boolean;
|
|
29
|
-
/** The initial size of particles when the Particle Generator first spawns them. */
|
|
30
|
-
startSize: ParticleCompositeCurve;
|
|
31
29
|
/** The initial size of particles along the x-axis when the Particle Generator first spawns them. */
|
|
32
30
|
startSizeX: ParticleCompositeCurve;
|
|
33
31
|
/** The initial size of particles along the y-axis when the Particle Generator first spawns them. */
|
|
34
32
|
startSizeY: ParticleCompositeCurve;
|
|
35
33
|
/** The initial size of particles along the z-axis when the Particle Generator first spawns them. */
|
|
36
34
|
startSizeZ: ParticleCompositeCurve;
|
|
37
|
-
/** A flag to enable 3D particle rotation. */
|
|
35
|
+
/** A flag to enable 3D particle rotation, when disabled, only `startRotationZ` is used. */
|
|
38
36
|
startRotation3D: boolean;
|
|
39
|
-
/** The initial rotation of particles when the Particle Generator first spawns them. */
|
|
40
|
-
startRotation: ParticleCompositeCurve;
|
|
41
37
|
/** The initial rotation of particles around the x-axis when emitted.*/
|
|
42
38
|
startRotationX: ParticleCompositeCurve;
|
|
43
39
|
/** The initial rotation of particles around the y-axis when emitted. */
|
|
44
40
|
startRotationY: ParticleCompositeCurve;
|
|
41
|
+
/** The initial rotation of particles around the z-axis when emitted. */
|
|
45
42
|
startRotationZ: ParticleCompositeCurve;
|
|
46
43
|
/** Makes some particles spin in the opposite direction. */
|
|
47
44
|
flipRotation: number;
|
|
@@ -65,4 +62,9 @@ export declare class MainModule implements ICustomClone {
|
|
|
65
62
|
*/
|
|
66
63
|
get maxParticles(): number;
|
|
67
64
|
set maxParticles(value: number);
|
|
65
|
+
/**
|
|
66
|
+
* The initial size of particles when the Particle Generator first spawns them.
|
|
67
|
+
*/
|
|
68
|
+
get startSize(): ParticleCompositeCurve;
|
|
69
|
+
set startSize(value: ParticleCompositeCurve);
|
|
68
70
|
}
|
|
@@ -18,7 +18,7 @@ export declare class RotationOverLifetimeModule extends ParticleGeneratorModule
|
|
|
18
18
|
static readonly _maxCurveXProperty: ShaderProperty;
|
|
19
19
|
static readonly _maxCurveYProperty: ShaderProperty;
|
|
20
20
|
static readonly _maxCurveZProperty: ShaderProperty;
|
|
21
|
-
/** Specifies whether the rotation is separate on each axis, when disabled only
|
|
21
|
+
/** Specifies whether the rotation is separate on each axis, when disabled, only `rotationZ` is used. */
|
|
22
22
|
separateAxes: boolean;
|
|
23
23
|
/** Rotation over lifetime for z axis. */
|
|
24
24
|
rotationX: ParticleCompositeCurve;
|
|
@@ -26,10 +26,6 @@ export declare class TextureSheetAnimationModule extends ParticleGeneratorModule
|
|
|
26
26
|
* */
|
|
27
27
|
get tiling(): Vector2;
|
|
28
28
|
set tiling(value: Vector2);
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
cloneTo(dest: TextureSheetAnimationModule): void;
|
|
33
29
|
}
|
|
34
30
|
/**
|
|
35
31
|
* Texture sheet animation type.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IPhysics } from "@galacean/engine-design";
|
|
1
2
|
import { Ray, Vector3 } from "@galacean/engine-math";
|
|
2
3
|
import { Engine } from "../Engine";
|
|
3
4
|
import { Layer } from "../Layer";
|
|
@@ -6,10 +7,8 @@ import { HitResult } from "./HitResult";
|
|
|
6
7
|
* A physics manager is a collection of colliders and constraints which can interact.
|
|
7
8
|
*/
|
|
8
9
|
export declare class PhysicsManager {
|
|
9
|
-
private static _collision;
|
|
10
10
|
private _engine;
|
|
11
11
|
private _restTime;
|
|
12
|
-
private _fixedTimeStep;
|
|
13
12
|
private _colliders;
|
|
14
13
|
private _gravity;
|
|
15
14
|
private _nativePhysicsManager;
|
|
@@ -20,15 +19,33 @@ export declare class PhysicsManager {
|
|
|
20
19
|
private _onTriggerEnter;
|
|
21
20
|
private _onTriggerExit;
|
|
22
21
|
private _onTriggerStay;
|
|
22
|
+
/** The fixed time step in seconds at which physics are performed. */
|
|
23
|
+
fixedTimeStep: number;
|
|
24
|
+
/**
|
|
25
|
+
* The max allowed time step in seconds one frame.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* When the frame rate is low or stutter occurs, the maximum execution time of physics will not exceed this value.
|
|
29
|
+
* So physics will slow down a bit when performance hitch occurs.
|
|
30
|
+
*/
|
|
31
|
+
maxAllowedTimeStep: number;
|
|
23
32
|
/**
|
|
24
33
|
* The gravity of physics scene.
|
|
25
34
|
*/
|
|
26
35
|
get gravity(): Vector3;
|
|
27
36
|
set gravity(value: Vector3);
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated
|
|
39
|
+
* Please use `maxAllowedTimeStep` instead.
|
|
40
|
+
*/
|
|
41
|
+
get maxSumTimeStep(): number;
|
|
42
|
+
set maxSumTimeStep(value: number);
|
|
31
43
|
constructor(engine: Engine);
|
|
44
|
+
/**
|
|
45
|
+
* initialize PhysicsManager.
|
|
46
|
+
* @param physics - Physics Engine
|
|
47
|
+
*/
|
|
48
|
+
initialize(physics: IPhysics): void;
|
|
32
49
|
/**
|
|
33
50
|
* Casts a ray through the Scene and returns the first hit.
|
|
34
51
|
* @param ray - The ray
|