@galacean/engine-core 1.4.0-alpha.0 → 1.4.0-alpha.2
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 +2846 -1091
- package/dist/main.js.map +1 -1
- package/dist/module.js +2833 -1091
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +5 -3
- package/types/Engine.d.ts +12 -0
- package/types/Entity.d.ts +15 -3
- package/types/Polyfill.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -0
- package/types/RenderPipeline/Blitter.d.ts +28 -0
- package/types/RenderPipeline/index.d.ts +2 -1
- package/types/Renderer.d.ts +0 -2
- package/types/Scene.d.ts +3 -0
- package/types/Transform.d.ts +17 -7
- package/types/asset/AssetType.d.ts +6 -2
- package/types/asset/request.d.ts +10 -3
- package/types/audio/AudioClip.d.ts +24 -0
- package/types/audio/AudioManager.d.ts +1 -0
- package/types/audio/AudioSource.d.ts +72 -0
- package/types/audio/index.d.ts +3 -0
- package/types/index.d.ts +2 -0
- package/types/material/BaseMaterial.d.ts +4 -2
- package/types/material/PBRMaterial.d.ts +97 -4
- package/types/material/enums/Refraction.d.ts +9 -0
- package/types/material/index.d.ts +1 -0
- package/types/physics/CharacterController.d.ts +5 -6
- package/types/physics/Collider.d.ts +3 -1
- package/types/physics/Collision.d.ts +18 -0
- package/types/physics/ContactPoint.d.ts +14 -0
- package/types/physics/DynamicCollider.d.ts +33 -4
- package/types/physics/PhysicsMaterial.d.ts +5 -1
- package/types/physics/index.d.ts +2 -0
- package/types/physics/joint/FixedJoint.d.ts +1 -0
- package/types/physics/joint/HingeJoint.d.ts +9 -6
- package/types/physics/joint/Joint.d.ts +29 -10
- package/types/physics/joint/JointLimits.d.ts +34 -10
- package/types/physics/joint/JointMotor.d.ts +27 -8
- package/types/physics/joint/SpringJoint.d.ts +2 -6
- package/types/physics/shape/BoxColliderShape.d.ts +1 -0
- package/types/physics/shape/CapsuleColliderShape.d.ts +1 -0
- package/types/physics/shape/ColliderShape.d.ts +11 -3
- package/types/physics/shape/PlaneColliderShape.d.ts +2 -0
- package/types/physics/shape/SphereColliderShape.d.ts +1 -1
- package/types/postProcess/PostProcess.d.ts +60 -0
- package/types/postProcess/PostProcessEffect.d.ts +26 -0
- package/types/postProcess/PostProcessEffectParameter.d.ts +25 -0
- package/types/postProcess/PostProcessManager.d.ts +37 -1
- package/types/postProcess/PostProcessPass.d.ts +50 -0
- package/types/postProcess/PostProcessUberPass.d.ts +25 -0
- package/types/postProcess/effects/BloomEffect.d.ts +22 -64
- package/types/postProcess/effects/TonemappingEffect.d.ts +6 -16
- package/types/postProcess/index.d.ts +6 -2
|
@@ -11,7 +11,8 @@ export declare class CharacterController extends Collider {
|
|
|
11
11
|
private _upDirection;
|
|
12
12
|
private _slopeLimit;
|
|
13
13
|
/**
|
|
14
|
-
* The step offset for the controller.
|
|
14
|
+
* The step offset for the controller, the value must be greater than or equal to 0.
|
|
15
|
+
* @remarks Character can overcome obstacle less than the height(stepOffset + contractOffset of the shape).
|
|
15
16
|
*/
|
|
16
17
|
get stepOffset(): number;
|
|
17
18
|
set stepOffset(value: number);
|
|
@@ -26,7 +27,8 @@ export declare class CharacterController extends Collider {
|
|
|
26
27
|
get upDirection(): Vector3;
|
|
27
28
|
set upDirection(value: Vector3);
|
|
28
29
|
/**
|
|
29
|
-
* The slope limit for the controller.
|
|
30
|
+
* The slope limit in degrees for the controller, the value is the cosine value of the maximum slope angle.
|
|
31
|
+
* @defaultValue 45 degrees
|
|
30
32
|
*/
|
|
31
33
|
get slopeLimit(): number;
|
|
32
34
|
set slopeLimit(value: number);
|
|
@@ -43,10 +45,7 @@ export declare class CharacterController extends Collider {
|
|
|
43
45
|
* @param shape - Collider shape
|
|
44
46
|
*/
|
|
45
47
|
addShape(shape: ColliderShape): void;
|
|
46
|
-
|
|
47
|
-
* Remove all shape attached.
|
|
48
|
-
*/
|
|
49
|
-
clearShapes(): void;
|
|
48
|
+
protected _syncNative(): void;
|
|
50
49
|
private _syncWorldPositionFromPhysicalSpace;
|
|
51
50
|
private _setUpDirection;
|
|
52
51
|
}
|
|
@@ -27,5 +27,7 @@ export declare class Collider extends Component implements ICustomClone {
|
|
|
27
27
|
* Remove all shape attached.
|
|
28
28
|
*/
|
|
29
29
|
clearShapes(): void;
|
|
30
|
-
protected
|
|
30
|
+
protected _syncNative(): void;
|
|
31
|
+
protected _addNativeShape(shape: ColliderShape): void;
|
|
32
|
+
protected _removeNativeShape(shape: ColliderShape): void;
|
|
31
33
|
}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
+
import { ContactPoint } from "./ContactPoint";
|
|
1
2
|
import { ColliderShape } from "./shape";
|
|
3
|
+
/**
|
|
4
|
+
* Collision information between two shapes when they collide.
|
|
5
|
+
*/
|
|
2
6
|
export declare class Collision {
|
|
7
|
+
/** The target shape be collided. */
|
|
3
8
|
shape: ColliderShape;
|
|
9
|
+
/**
|
|
10
|
+
* Count of contact points.
|
|
11
|
+
*/
|
|
12
|
+
get contactCount(): number;
|
|
13
|
+
/**
|
|
14
|
+
* Get contact points.
|
|
15
|
+
* @param outContacts - The result of contact points
|
|
16
|
+
* @returns The actual count of contact points
|
|
17
|
+
*
|
|
18
|
+
* @remarks To optimize performance, the engine does not modify the length of the array you pass.
|
|
19
|
+
* You need to obtain the actual number of contact points from the function's return value.
|
|
20
|
+
*/
|
|
21
|
+
getContacts(outContacts: ContactPoint[]): number;
|
|
4
22
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
2
|
+
/**
|
|
3
|
+
* Describes a contact point where the collision occurs.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ContactPoint {
|
|
6
|
+
/** The position of the contact point between the shapes, in world space. */
|
|
7
|
+
readonly position: Vector3;
|
|
8
|
+
/** The normal of the contacting surfaces at the contact point. The normal direction points from the second shape to the first shape. */
|
|
9
|
+
readonly normal: Vector3;
|
|
10
|
+
/** The impulse applied at the contact point, in world space. Divide by the simulation time step to get a force value. */
|
|
11
|
+
readonly impulse: Vector3;
|
|
12
|
+
/** The separation of the shapes at the contact point. A negative separation denotes a penetration. */
|
|
13
|
+
separation: number;
|
|
14
|
+
}
|
|
@@ -14,10 +14,13 @@ export declare class DynamicCollider extends Collider {
|
|
|
14
14
|
private _maxAngularVelocity;
|
|
15
15
|
private _maxDepenetrationVelocity;
|
|
16
16
|
private _solverIterations;
|
|
17
|
+
private _useGravity;
|
|
17
18
|
private _isKinematic;
|
|
18
19
|
private _constraints;
|
|
19
20
|
private _collisionDetectionMode;
|
|
20
21
|
private _sleepThreshold;
|
|
22
|
+
private _automaticCenterOfMass;
|
|
23
|
+
private _automaticInertiaTensor;
|
|
21
24
|
/**
|
|
22
25
|
* The linear damping of the dynamic collider.
|
|
23
26
|
*/
|
|
@@ -34,7 +37,7 @@ export declare class DynamicCollider extends Collider {
|
|
|
34
37
|
get linearVelocity(): Vector3;
|
|
35
38
|
set linearVelocity(value: Vector3);
|
|
36
39
|
/**
|
|
37
|
-
* The angular velocity vector of the dynamic collider measured in
|
|
40
|
+
* The angular velocity vector of the dynamic collider measured in degrees per second.
|
|
38
41
|
*/
|
|
39
42
|
get angularVelocity(): Vector3;
|
|
40
43
|
set angularVelocity(value: Vector3);
|
|
@@ -43,18 +46,32 @@ export declare class DynamicCollider extends Collider {
|
|
|
43
46
|
*/
|
|
44
47
|
get mass(): number;
|
|
45
48
|
set mass(value: number);
|
|
49
|
+
/**
|
|
50
|
+
* Whether or not to calculate the center of mass automatically, if true, the center of mass will be calculated based on the associated shapes.
|
|
51
|
+
* @remarks Affected by the position, rotation of the shapes.
|
|
52
|
+
*/
|
|
53
|
+
get automaticCenterOfMass(): boolean;
|
|
54
|
+
set automaticCenterOfMass(value: boolean);
|
|
46
55
|
/**
|
|
47
56
|
* The center of mass relative to the transform's origin.
|
|
57
|
+
* @remarks The center of mass is automatically calculated, if you want to set it manually, please set automaticCenterOfMass to false.
|
|
48
58
|
*/
|
|
49
59
|
get centerOfMass(): Vector3;
|
|
50
60
|
set centerOfMass(value: Vector3);
|
|
61
|
+
/**
|
|
62
|
+
* Whether or not to calculate the inertia tensor automatically, if true, the inertia tensor will be calculated based on the associated shapes and mass.
|
|
63
|
+
* @remarks Affected by the position, rotation of the shapes and the mass of the collider.
|
|
64
|
+
*/
|
|
65
|
+
get automaticInertiaTensor(): boolean;
|
|
66
|
+
set automaticInertiaTensor(value: boolean);
|
|
51
67
|
/**
|
|
52
68
|
* The diagonal inertia tensor of mass relative to the center of mass.
|
|
69
|
+
* @remarks The inertia tensor is automatically calculated, if you want to set it manually, please set automaticInertiaTensor to false.
|
|
53
70
|
*/
|
|
54
71
|
get inertiaTensor(): Vector3;
|
|
55
72
|
set inertiaTensor(value: Vector3);
|
|
56
73
|
/**
|
|
57
|
-
* The maximum angular velocity of the collider measured in
|
|
74
|
+
* The maximum angular velocity of the collider measured in degrees per second.
|
|
58
75
|
*/
|
|
59
76
|
get maxAngularVelocity(): number;
|
|
60
77
|
set maxAngularVelocity(value: number);
|
|
@@ -73,6 +90,11 @@ export declare class DynamicCollider extends Collider {
|
|
|
73
90
|
*/
|
|
74
91
|
get solverIterations(): number;
|
|
75
92
|
set solverIterations(value: number);
|
|
93
|
+
/**
|
|
94
|
+
* Controls whether gravity affects the dynamic collider.
|
|
95
|
+
*/
|
|
96
|
+
get useGravity(): boolean;
|
|
97
|
+
set useGravity(value: boolean);
|
|
76
98
|
/**
|
|
77
99
|
* Controls whether physics affects the dynamic collider.
|
|
78
100
|
*/
|
|
@@ -118,14 +140,21 @@ export declare class DynamicCollider extends Collider {
|
|
|
118
140
|
* Forces a collider to sleep at least one frame.
|
|
119
141
|
*/
|
|
120
142
|
sleep(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Returns whether the collider is sleeping.
|
|
145
|
+
* @returns True if the collider is sleeping, false otherwise.
|
|
146
|
+
*/
|
|
147
|
+
isSleeping(): boolean;
|
|
121
148
|
/**
|
|
122
149
|
* Forces a collider to wake up.
|
|
123
150
|
*/
|
|
124
151
|
wakeUp(): void;
|
|
152
|
+
protected _syncNative(): void;
|
|
153
|
+
private _setMassAndUpdateInertia;
|
|
125
154
|
private _setLinearVelocity;
|
|
126
155
|
private _setAngularVelocity;
|
|
127
|
-
private
|
|
128
|
-
private
|
|
156
|
+
private _handleCenterOfMassChanged;
|
|
157
|
+
private _handleInertiaTensorChanged;
|
|
129
158
|
}
|
|
130
159
|
/**
|
|
131
160
|
* The collision detection mode constants.
|
|
@@ -11,7 +11,7 @@ export declare class PhysicsMaterial {
|
|
|
11
11
|
private _destroyed;
|
|
12
12
|
constructor();
|
|
13
13
|
/**
|
|
14
|
-
* The coefficient of bounciness.
|
|
14
|
+
* The coefficient of bounciness, ranging from 0 to 1.
|
|
15
15
|
*/
|
|
16
16
|
get bounciness(): number;
|
|
17
17
|
set bounciness(value: number);
|
|
@@ -35,4 +35,8 @@ export declare class PhysicsMaterial {
|
|
|
35
35
|
*/
|
|
36
36
|
get frictionCombine(): PhysicsMaterialCombineMode;
|
|
37
37
|
set frictionCombine(value: PhysicsMaterialCombineMode);
|
|
38
|
+
/**
|
|
39
|
+
* Destroy the material when the material is no be used by any shape.
|
|
40
|
+
*/
|
|
41
|
+
destroy(): void;
|
|
38
42
|
}
|
package/types/physics/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { HitResult } from "./HitResult";
|
|
|
5
5
|
export { PhysicsMaterial } from "./PhysicsMaterial";
|
|
6
6
|
export { PhysicsScene } from "./PhysicsScene";
|
|
7
7
|
export { StaticCollider } from "./StaticCollider";
|
|
8
|
+
export { Collision } from "./Collision";
|
|
9
|
+
export { ContactPoint } from "./ContactPoint";
|
|
8
10
|
export * from "./enums";
|
|
9
11
|
export * from "./joint";
|
|
10
12
|
export * from "./shape";
|
|
@@ -2,6 +2,7 @@ import { Vector3 } from "@galacean/engine-math";
|
|
|
2
2
|
import { Joint } from "./Joint";
|
|
3
3
|
import { JointLimits } from "./JointLimits";
|
|
4
4
|
import { JointMotor } from "./JointMotor";
|
|
5
|
+
import { Entity } from "../../Entity";
|
|
5
6
|
/**
|
|
6
7
|
* A joint which behaves in a similar way to a hinge or axle.
|
|
7
8
|
*/
|
|
@@ -9,18 +10,15 @@ export declare class HingeJoint extends Joint {
|
|
|
9
10
|
private _axis;
|
|
10
11
|
private _hingeFlags;
|
|
11
12
|
private _useSpring;
|
|
12
|
-
private
|
|
13
|
+
private _jointMotor;
|
|
13
14
|
private _limits;
|
|
15
|
+
private _angle;
|
|
16
|
+
private _velocity;
|
|
14
17
|
/**
|
|
15
18
|
* The anchor rotation.
|
|
16
19
|
*/
|
|
17
20
|
get axis(): Vector3;
|
|
18
21
|
set axis(value: Vector3);
|
|
19
|
-
/**
|
|
20
|
-
* The swing offset.
|
|
21
|
-
*/
|
|
22
|
-
get swingOffset(): Vector3;
|
|
23
|
-
set swingOffset(value: Vector3);
|
|
24
22
|
/**
|
|
25
23
|
* The current angle in degrees of the joint relative to its rest position.
|
|
26
24
|
*/
|
|
@@ -54,4 +52,9 @@ export declare class HingeJoint extends Joint {
|
|
|
54
52
|
*/
|
|
55
53
|
get limits(): JointLimits;
|
|
56
54
|
set limits(value: JointLimits);
|
|
55
|
+
constructor(entity: Entity);
|
|
56
|
+
protected _createJoint(): void;
|
|
57
|
+
protected _syncNative(): void;
|
|
58
|
+
private _onMotorChanged;
|
|
59
|
+
private _onLimitsChanged;
|
|
57
60
|
}
|
|
@@ -3,45 +3,58 @@ import { Vector3 } from "@galacean/engine-math";
|
|
|
3
3
|
import { Component } from "../../Component";
|
|
4
4
|
import { Entity } from "../../Entity";
|
|
5
5
|
import { Collider } from "../Collider";
|
|
6
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
7
6
|
/**
|
|
8
7
|
* A base class providing common functionality for joints.
|
|
9
8
|
* @decorator `@dependentComponents(Collider, DependentMode.CheckOnly)`
|
|
10
9
|
*/
|
|
11
|
-
export declare class Joint extends Component
|
|
10
|
+
export declare abstract class Joint extends Component {
|
|
11
|
+
private static _tempVector3;
|
|
12
12
|
protected _colliderInfo: JointColliderInfo;
|
|
13
13
|
protected _connectedColliderInfo: JointColliderInfo;
|
|
14
14
|
protected _nativeJoint: IJoint;
|
|
15
15
|
private _force;
|
|
16
16
|
private _torque;
|
|
17
|
+
private _automaticConnectedAnchor;
|
|
18
|
+
private _updateConnectedActualAnchor;
|
|
17
19
|
/**
|
|
18
20
|
* The connected collider.
|
|
19
21
|
*/
|
|
20
22
|
get connectedCollider(): Collider;
|
|
21
23
|
set connectedCollider(value: Collider);
|
|
24
|
+
/**
|
|
25
|
+
* The anchor position.
|
|
26
|
+
*/
|
|
27
|
+
get anchor(): Vector3;
|
|
28
|
+
set anchor(value: Vector3);
|
|
22
29
|
/**
|
|
23
30
|
* The connected anchor position.
|
|
24
31
|
* @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
|
|
32
|
+
* The connectedAnchor is automatically calculated, if you want to set it manually, please set automaticConnectedAnchor to false
|
|
25
33
|
*/
|
|
26
34
|
get connectedAnchor(): Vector3;
|
|
27
35
|
set connectedAnchor(value: Vector3);
|
|
28
36
|
/**
|
|
29
|
-
*
|
|
37
|
+
* Whether or not to calculate the connectedAnchor automatically, if true, the connectedAnchor will be calculated automatically to match the global position of the anchor property.
|
|
30
38
|
*/
|
|
31
|
-
get
|
|
32
|
-
set
|
|
39
|
+
get automaticConnectedAnchor(): boolean;
|
|
40
|
+
set automaticConnectedAnchor(value: boolean);
|
|
33
41
|
/**
|
|
34
|
-
*
|
|
42
|
+
* The scale to apply to the mass of collider 0 for resolving this constraint.
|
|
35
43
|
*/
|
|
36
|
-
get
|
|
37
|
-
set
|
|
44
|
+
get connectedMassScale(): number;
|
|
45
|
+
set connectedMassScale(value: number);
|
|
38
46
|
/**
|
|
39
|
-
* The scale to apply to the
|
|
47
|
+
* The scale to apply to the mass of collider 1 for resolving this constraint.
|
|
40
48
|
*/
|
|
41
49
|
get massScale(): number;
|
|
42
50
|
set massScale(value: number);
|
|
43
51
|
/**
|
|
44
|
-
* The scale to apply to the
|
|
52
|
+
* The scale to apply to the inertia of collider0 for resolving this constraint.
|
|
53
|
+
*/
|
|
54
|
+
get connectedInertiaScale(): number;
|
|
55
|
+
set connectedInertiaScale(value: number);
|
|
56
|
+
/**
|
|
57
|
+
* The scale to apply to the inertia of collider1 for resolving this constraint.
|
|
45
58
|
*/
|
|
46
59
|
get inertiaScale(): number;
|
|
47
60
|
set inertiaScale(value: number);
|
|
@@ -56,4 +69,10 @@ export declare class Joint extends Component implements ICustomClone {
|
|
|
56
69
|
get breakTorque(): number;
|
|
57
70
|
set breakTorque(value: number);
|
|
58
71
|
constructor(entity: Entity);
|
|
72
|
+
protected abstract _createJoint(): void;
|
|
73
|
+
protected _syncNative(): void;
|
|
74
|
+
private _calculateConnectedAnchor;
|
|
75
|
+
private _onSelfTransformChanged;
|
|
76
|
+
private _onConnectedTransformChanged;
|
|
77
|
+
private _updateActualAnchor;
|
|
59
78
|
}
|
|
@@ -1,15 +1,39 @@
|
|
|
1
|
+
import { UpdateFlagManager } from "../../UpdateFlagManager";
|
|
1
2
|
/**
|
|
2
3
|
* JointLimits is used to limit the joints angle.
|
|
3
4
|
*/
|
|
4
5
|
export declare class JointLimits {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
/** @internal */
|
|
7
|
+
_updateFlagManager: UpdateFlagManager;
|
|
8
|
+
private _max;
|
|
9
|
+
private _min;
|
|
10
|
+
private _contactDistance;
|
|
11
|
+
private _stiffness;
|
|
12
|
+
private _damping;
|
|
13
|
+
/**
|
|
14
|
+
* The upper angular limit (in degrees) of the joint.
|
|
15
|
+
*/
|
|
16
|
+
get max(): number;
|
|
17
|
+
set max(value: number);
|
|
18
|
+
/**
|
|
19
|
+
* The lower angular limit (in degrees) of the joint.
|
|
20
|
+
*/
|
|
21
|
+
get min(): number;
|
|
22
|
+
set min(value: number);
|
|
23
|
+
/**
|
|
24
|
+
* Distance inside the limit value at which the limit will be considered to be active by the solver.
|
|
25
|
+
* Default is the lesser of 0.1 radians, and 0.49 * (upperLimit - lowerLimit)
|
|
26
|
+
*/
|
|
27
|
+
get contactDistance(): number;
|
|
28
|
+
set contactDistance(value: number);
|
|
29
|
+
/**
|
|
30
|
+
* The spring forces used to reach the target position.
|
|
31
|
+
*/
|
|
32
|
+
get stiffness(): number;
|
|
33
|
+
set stiffness(value: number);
|
|
34
|
+
/**
|
|
35
|
+
* The damper force uses to dampen the spring.
|
|
36
|
+
*/
|
|
37
|
+
get damping(): number;
|
|
38
|
+
set damping(value: number);
|
|
15
39
|
}
|
|
@@ -1,13 +1,32 @@
|
|
|
1
|
+
import { UpdateFlagManager } from "../../UpdateFlagManager";
|
|
1
2
|
/**
|
|
2
3
|
* The JointMotor is used to motorize a joint.
|
|
3
4
|
*/
|
|
4
5
|
export declare class JointMotor {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
6
|
+
/** @internal */
|
|
7
|
+
_updateFlagManager: UpdateFlagManager;
|
|
8
|
+
private _targetVelocity;
|
|
9
|
+
private _forceLimit;
|
|
10
|
+
private _gearRatio;
|
|
11
|
+
private _freeSpin;
|
|
12
|
+
/**
|
|
13
|
+
* The motor will apply a force up to force to achieve targetVelocity.
|
|
14
|
+
*/
|
|
15
|
+
get targetVelocity(): number;
|
|
16
|
+
set targetVelocity(value: number);
|
|
17
|
+
/**
|
|
18
|
+
* The force limit.
|
|
19
|
+
*/
|
|
20
|
+
get forceLimit(): number;
|
|
21
|
+
set forceLimit(value: number);
|
|
22
|
+
/**
|
|
23
|
+
* Gear ration for the motor
|
|
24
|
+
*/
|
|
25
|
+
get gearRatio(): number;
|
|
26
|
+
set gearRatio(value: number);
|
|
27
|
+
/**
|
|
28
|
+
* If freeSpin is enabled the motor will only accelerate but never slow down.
|
|
29
|
+
*/
|
|
30
|
+
get freeSpin(): boolean;
|
|
31
|
+
set freeSpin(value: boolean);
|
|
13
32
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Vector3 } from "@galacean/engine-math";
|
|
2
1
|
import { Joint } from "./Joint";
|
|
3
2
|
/**
|
|
4
3
|
* A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
|
|
@@ -9,11 +8,6 @@ export declare class SpringJoint extends Joint {
|
|
|
9
8
|
private _tolerance;
|
|
10
9
|
private _stiffness;
|
|
11
10
|
private _damping;
|
|
12
|
-
/**
|
|
13
|
-
* The swing offset.
|
|
14
|
-
*/
|
|
15
|
-
get swingOffset(): Vector3;
|
|
16
|
-
set swingOffset(value: Vector3);
|
|
17
11
|
/**
|
|
18
12
|
* The minimum distance.
|
|
19
13
|
*/
|
|
@@ -39,4 +33,6 @@ export declare class SpringJoint extends Joint {
|
|
|
39
33
|
*/
|
|
40
34
|
get damping(): number;
|
|
41
35
|
set damping(value: number);
|
|
36
|
+
protected _createJoint(): void;
|
|
37
|
+
protected _syncNative(): void;
|
|
42
38
|
}
|
|
@@ -22,17 +22,17 @@ export declare abstract class ColliderShape implements ICustomClone {
|
|
|
22
22
|
*/
|
|
23
23
|
get id(): number;
|
|
24
24
|
/**
|
|
25
|
-
* Contact offset for this shape.
|
|
25
|
+
* Contact offset for this shape, the value must be greater than or equal to 0.
|
|
26
26
|
*/
|
|
27
27
|
get contactOffset(): number;
|
|
28
28
|
set contactOffset(value: number);
|
|
29
29
|
/**
|
|
30
|
-
* Physical material.
|
|
30
|
+
* Physical material, material can't be null.
|
|
31
31
|
*/
|
|
32
32
|
get material(): PhysicsMaterial;
|
|
33
33
|
set material(value: PhysicsMaterial);
|
|
34
34
|
/**
|
|
35
|
-
* The local rotation of this ColliderShape.
|
|
35
|
+
* The local rotation of this ColliderShape, in degrees.
|
|
36
36
|
*/
|
|
37
37
|
get rotation(): Vector3;
|
|
38
38
|
set rotation(value: Vector3);
|
|
@@ -47,6 +47,14 @@ export declare abstract class ColliderShape implements ICustomClone {
|
|
|
47
47
|
get isTrigger(): boolean;
|
|
48
48
|
set isTrigger(value: boolean);
|
|
49
49
|
protected constructor();
|
|
50
|
+
/**
|
|
51
|
+
* Get the distance and the closest point on the shape from a point.
|
|
52
|
+
* @param point - Location in world space you want to find the closest point to
|
|
53
|
+
* @param outClosestPoint - The closest point on the shape in world space
|
|
54
|
+
* @returns The distance between the point and the shape
|
|
55
|
+
*/
|
|
56
|
+
getClosestPoint(point: Vector3, outClosestPoint: Vector3): number;
|
|
57
|
+
protected _syncNative(): void;
|
|
50
58
|
private _setPosition;
|
|
51
59
|
private _setRotation;
|
|
52
60
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
1
2
|
import { ColliderShape } from "./ColliderShape";
|
|
2
3
|
/**
|
|
3
4
|
* Physical collider shape plane.
|
|
4
5
|
*/
|
|
5
6
|
export declare class PlaneColliderShape extends ColliderShape {
|
|
6
7
|
constructor();
|
|
8
|
+
getClosestPoint(point: Vector3, closestPoint: Vector3): number;
|
|
7
9
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Component } from "../Component";
|
|
2
|
+
import { Layer } from "../Layer";
|
|
3
|
+
import { PostProcessEffect } from "./PostProcessEffect";
|
|
4
|
+
/**
|
|
5
|
+
* Post Process component can be used for global or local post-processing.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PostProcess extends Component {
|
|
8
|
+
/**
|
|
9
|
+
* The layer to which the PostProcess belongs.
|
|
10
|
+
*/
|
|
11
|
+
layer: Layer;
|
|
12
|
+
/**
|
|
13
|
+
* The outer distance to start blending from, only takes effect when the `isGlobal` is false.
|
|
14
|
+
*/
|
|
15
|
+
blendDistance: number;
|
|
16
|
+
private _priority;
|
|
17
|
+
private _isGlobal;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the PostProcess is global.
|
|
20
|
+
* @remarks
|
|
21
|
+
* Specifies whether to apply the PostProcess to the entire Scene or in Colliders.
|
|
22
|
+
* Only support local PostProcess in physics enabled Scenes.
|
|
23
|
+
*/
|
|
24
|
+
get isGlobal(): boolean;
|
|
25
|
+
set isGlobal(value: boolean);
|
|
26
|
+
/**
|
|
27
|
+
* A value which determines which PostProcess is being used when PostProcess have an equal amount of influence on the Scene.
|
|
28
|
+
* @remarks
|
|
29
|
+
* PostProcess with a higher priority will override lower ones.
|
|
30
|
+
*/
|
|
31
|
+
get priority(): number;
|
|
32
|
+
set priority(value: number);
|
|
33
|
+
/**
|
|
34
|
+
* Get the PostProcessEffect by type.
|
|
35
|
+
* @param type - The type of PostProcessEffect
|
|
36
|
+
* @returns The PostProcessEffect found
|
|
37
|
+
*/
|
|
38
|
+
getEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
|
|
39
|
+
/**
|
|
40
|
+
* Add a PostProcessEffect to the PostProcess.
|
|
41
|
+
* @remarks Only one effect of the same type can be added to the PostProcess.
|
|
42
|
+
* @param type - The type of PostProcessEffect
|
|
43
|
+
* @returns The PostProcessEffect added
|
|
44
|
+
*/
|
|
45
|
+
addEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
|
|
46
|
+
/**
|
|
47
|
+
* Remove a PostProcessEffect from the PostProcess.
|
|
48
|
+
* @param type - The type of PostProcessEffect
|
|
49
|
+
* @returns The PostProcessEffect removed
|
|
50
|
+
*/
|
|
51
|
+
removeEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
|
|
52
|
+
/**
|
|
53
|
+
* @inheritdoc
|
|
54
|
+
*/
|
|
55
|
+
_onEnableInScene(): void;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritdoc
|
|
58
|
+
*/
|
|
59
|
+
_onDisableInScene(): void;
|
|
60
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The base class for post process effect.
|
|
3
|
+
*/
|
|
4
|
+
export declare class PostProcessEffect {
|
|
5
|
+
private _enabled;
|
|
6
|
+
private _parameters;
|
|
7
|
+
private _parameterInitialized;
|
|
8
|
+
/**
|
|
9
|
+
* Indicates whether the post process effect is enabled.
|
|
10
|
+
*/
|
|
11
|
+
get enabled(): boolean;
|
|
12
|
+
set enabled(value: boolean);
|
|
13
|
+
/**
|
|
14
|
+
* Whether the post process effect is valid.
|
|
15
|
+
* @remarks
|
|
16
|
+
* This method can be overridden to control the effect's real validity.
|
|
17
|
+
*/
|
|
18
|
+
isValid(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Get all parameters of the post process effect.
|
|
21
|
+
* @remarks
|
|
22
|
+
* Only get the parameters that are initialized in the constructor.
|
|
23
|
+
* It will don't take effect if you add a new parameter after the post process effect is created, such as `effect.** = new PostProcessEffectParameter(1)`
|
|
24
|
+
*/
|
|
25
|
+
private _getParameters;
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
2
|
+
import { Texture } from "../texture/Texture";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a parameter of a post process effect.
|
|
5
|
+
* @remarks
|
|
6
|
+
* The parameter will be mixed to a final value and be used in post process manager.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PostProcessEffectParameter<T extends Number | Boolean | Color | Vector2 | Vector3 | Vector4 | Texture> {
|
|
9
|
+
/**
|
|
10
|
+
* Whether the parameter is enabled.
|
|
11
|
+
*/
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
private _value;
|
|
14
|
+
private _needLerp;
|
|
15
|
+
private _min?;
|
|
16
|
+
private _max?;
|
|
17
|
+
/**
|
|
18
|
+
* The value of the parameter.
|
|
19
|
+
*/
|
|
20
|
+
get value(): T;
|
|
21
|
+
set value(value: T);
|
|
22
|
+
constructor(value: Exclude<T, number>, needLerp?: boolean);
|
|
23
|
+
constructor(value: Exclude<T, Boolean | Color | Vector2 | Vector3 | Vector4 | Texture>, needLerp?: boolean);
|
|
24
|
+
constructor(value: Exclude<T, Boolean | Color | Vector2 | Vector3 | Vector4 | Texture>, min?: number, max?: number, needLerp?: boolean);
|
|
25
|
+
}
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
import { Scene } from "../Scene";
|
|
2
|
+
import { PostProcessEffect } from "./PostProcessEffect";
|
|
3
|
+
/**
|
|
4
|
+
* A global manager of the PostProcess.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PostProcessManager {
|
|
7
|
+
readonly scene: Scene;
|
|
8
|
+
private static _tempColliders;
|
|
9
|
+
private static _tempVector3;
|
|
10
|
+
private _activePostProcesses;
|
|
11
|
+
private _swapRenderTarget;
|
|
12
|
+
private _srcRenderTarget;
|
|
13
|
+
private _destRenderTarget;
|
|
14
|
+
private _currentSourceRenderTarget;
|
|
15
|
+
private _currentDestRenderTarget;
|
|
16
|
+
private _blendEffectMap;
|
|
17
|
+
private _defaultEffectMap;
|
|
18
|
+
private _remainActivePassCount;
|
|
19
|
+
/**
|
|
20
|
+
* Create a PostProcessManager.
|
|
21
|
+
* @param scene - Scene to which the current PostProcessManager belongs
|
|
22
|
+
*/
|
|
23
|
+
constructor(scene: Scene);
|
|
24
|
+
/**
|
|
25
|
+
* Get the blend effect by type.
|
|
26
|
+
* @remarks
|
|
27
|
+
* The blend effect is a post process effect that is used to blend all result of the effects by the type.
|
|
28
|
+
* @param type - The type of PostProcessEffect
|
|
29
|
+
* @returns The PostProcessEffect instance found
|
|
30
|
+
*/
|
|
31
|
+
getBlendEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
|
|
32
|
+
private _sortActivePostProcess;
|
|
33
|
+
private _resetDefaultValue;
|
|
34
|
+
private _initSwapRenderTarget;
|
|
35
|
+
private _swapRT;
|
|
36
|
+
private _getCurrentSourceTexture;
|
|
37
|
+
}
|