@galacean/engine-design 2.0.0-alpha.57 → 2.0.0-alpha.59
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/package.json +2 -2
- package/types/index.d.ts +0 -1
- package/types/physics/ICollider.d.ts +3 -1
- package/types/physics/IDynamicCollider.d.ts +10 -0
- package/types/physics/IPhysics.d.ts +5 -8
- package/types/physics/IPhysicsMaterial.d.ts +10 -0
- package/types/physics/IStaticCollider.d.ts +10 -0
- package/types/physics/index.d.ts +1 -1
- package/types/physics/shape/IMeshColliderShape.d.ts +4 -5
- package/types/xr/IXRDevice.d.ts +2 -3
- package/types/xr/IXRSession.d.ts +4 -4
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +0 -7
- package/types/renderingHardwareInterface/IPlatformPrimitive.d.ts +0 -5
- package/types/renderingHardwareInterface/IPlatformShaderProgram.d.ts +0 -4
- package/types/renderingHardwareInterface/index.d.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-design",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.59",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"types": "types/index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-math": "2.0.0-alpha.
|
|
21
|
+
"@galacean/engine-math": "2.0.0-alpha.59"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
package/types/index.d.ts
CHANGED
|
@@ -7,8 +7,10 @@ export interface ICollider {
|
|
|
7
7
|
* Attaches a shape and initializes its collision layer.
|
|
8
8
|
* @param shape - Shape to attach
|
|
9
9
|
* @param layer - Collision layer index, from 0 to 31
|
|
10
|
+
* @returns Whether the shape was accepted
|
|
11
|
+
* @remarks On failure, returns false and leaves the collider unchanged.
|
|
10
12
|
*/
|
|
11
|
-
addShape(shape: IColliderShape, layer: number):
|
|
13
|
+
addShape(shape: IColliderShape, layer: number): boolean;
|
|
12
14
|
/**
|
|
13
15
|
* Remove collider shape on collider.
|
|
14
16
|
* @param shape - The collider shape attached
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { Quaternion, Vector3 } from "@galacean/engine-math";
|
|
2
2
|
import { ICollider } from "./ICollider";
|
|
3
|
+
import { IColliderShape } from "./shape";
|
|
3
4
|
/**
|
|
4
5
|
* Interface of physics dynamic collider.
|
|
5
6
|
*/
|
|
6
7
|
export interface IDynamicCollider extends ICollider {
|
|
8
|
+
/**
|
|
9
|
+
* Atomically replace an attached shape with the same logical identity.
|
|
10
|
+
* @param previousShape - The currently attached shape
|
|
11
|
+
* @param newShape - The replacement shape
|
|
12
|
+
* @param layer - Collision layer index, from 0 to 31
|
|
13
|
+
* @returns Whether the replacement succeeded
|
|
14
|
+
* @remarks On failure, returns false and leaves the previous shape and its event state unchanged.
|
|
15
|
+
*/
|
|
16
|
+
replaceShape(previousShape: IColliderShape, newShape: IColliderShape, layer: number): boolean;
|
|
7
17
|
/**
|
|
8
18
|
* Set global transform of collider.
|
|
9
19
|
* @param position - The global position
|
|
@@ -3,7 +3,7 @@ import { ICharacterController } from "./ICharacterController";
|
|
|
3
3
|
import { ICollider } from "./ICollider";
|
|
4
4
|
import { IDynamicCollider } from "./IDynamicCollider";
|
|
5
5
|
import { IPhysicsManager } from "./IPhysicsManager";
|
|
6
|
-
import { IPhysicsMaterial } from "./IPhysicsMaterial";
|
|
6
|
+
import { IPhysicsMaterial, IPhysicsMaterialProperties } from "./IPhysicsMaterial";
|
|
7
7
|
import { IPhysicsScene } from "./IPhysicsScene";
|
|
8
8
|
import { IStaticCollider } from "./IStaticCollider";
|
|
9
9
|
import { IFixedJoint, IHingeJoint, ISpringJoint } from "./joints";
|
|
@@ -44,13 +44,9 @@ export interface IPhysics {
|
|
|
44
44
|
createCharacterController(): ICharacterController;
|
|
45
45
|
/**
|
|
46
46
|
* Create physics material.
|
|
47
|
-
* @param
|
|
48
|
-
* @param dynamicFriction - Dynamic friction
|
|
49
|
-
* @param bounciness - Restitution
|
|
50
|
-
* @param frictionCombine - The mode to combine the friction of collider
|
|
51
|
-
* @param bounceCombine - The mode to combine the bounce of collider
|
|
47
|
+
* @param properties - Physics material properties
|
|
52
48
|
*/
|
|
53
|
-
createPhysicsMaterial(
|
|
49
|
+
createPhysicsMaterial(properties: IPhysicsMaterialProperties): IPhysicsMaterial;
|
|
54
50
|
/**
|
|
55
51
|
* Create box collider shape.
|
|
56
52
|
* @param uniqueID - Shape unique id
|
|
@@ -87,8 +83,9 @@ export interface IPhysics {
|
|
|
87
83
|
* @param isConvex - Whether to create convex mesh (true) or triangle mesh (false)
|
|
88
84
|
* @param material - The material of this shape
|
|
89
85
|
* @param cookingFlags - Cooking flags
|
|
86
|
+
* @param worldScale - World scale of the shape
|
|
90
87
|
*/
|
|
91
|
-
createMeshColliderShape(uniqueID: number, positions: Vector3[], indices: Uint8Array | Uint16Array | Uint32Array | null, isConvex: boolean, material: IPhysicsMaterial, cookingFlags: number): IMeshColliderShape | null;
|
|
88
|
+
createMeshColliderShape(uniqueID: number, positions: Vector3[], indices: Uint8Array | Uint16Array | Uint32Array | null, isConvex: boolean, material: IPhysicsMaterial, cookingFlags: number, worldScale: Vector3): IMeshColliderShape | null;
|
|
92
89
|
/**
|
|
93
90
|
* Create fixed joint.
|
|
94
91
|
* @param collider - collider of joint
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Physics material properties supplied by the engine.
|
|
3
|
+
*/
|
|
4
|
+
export interface IPhysicsMaterialProperties {
|
|
5
|
+
readonly staticFriction: number;
|
|
6
|
+
readonly dynamicFriction: number;
|
|
7
|
+
readonly bounciness: number;
|
|
8
|
+
readonly frictionCombine: number;
|
|
9
|
+
readonly bounceCombine: number;
|
|
10
|
+
}
|
|
1
11
|
/**
|
|
2
12
|
* Interface of physics material.
|
|
3
13
|
*/
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { Quaternion, Vector3 } from "@galacean/engine-math";
|
|
2
2
|
import { ICollider } from "./ICollider";
|
|
3
|
+
import { IColliderShape } from "./shape";
|
|
3
4
|
/**
|
|
4
5
|
* Interface of physics static collider.
|
|
5
6
|
*/
|
|
6
7
|
export interface IStaticCollider extends ICollider {
|
|
8
|
+
/**
|
|
9
|
+
* Atomically replace an attached shape with the same logical identity.
|
|
10
|
+
* @param previousShape - The currently attached shape
|
|
11
|
+
* @param newShape - The replacement shape
|
|
12
|
+
* @param layer - Collision layer index, from 0 to 31
|
|
13
|
+
* @returns Whether the replacement succeeded
|
|
14
|
+
* @remarks On failure, returns false and leaves the previous shape and its event state unchanged.
|
|
15
|
+
*/
|
|
16
|
+
replaceShape(previousShape: IColliderShape, newShape: IColliderShape, layer: number): boolean;
|
|
7
17
|
/**
|
|
8
18
|
* Set global transform of collider.
|
|
9
19
|
* @param position - The global position
|
package/types/physics/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type { ICharacterController } from "./ICharacterController";
|
|
|
2
2
|
export type { ICollider } from "./ICollider";
|
|
3
3
|
export type { IDynamicCollider } from "./IDynamicCollider";
|
|
4
4
|
export type { IPhysics } from "./IPhysics";
|
|
5
|
-
export type { IPhysicsMaterial } from "./IPhysicsMaterial";
|
|
5
|
+
export type { IPhysicsMaterial, IPhysicsMaterialProperties } from "./IPhysicsMaterial";
|
|
6
6
|
export type { IPhysicsScene } from "./IPhysicsScene";
|
|
7
7
|
export type { IPhysicsManager } from "./IPhysicsManager";
|
|
8
8
|
export type { IStaticCollider } from "./IStaticCollider";
|
|
@@ -5,12 +5,11 @@ import { IColliderShape } from "./IColliderShape";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface IMeshColliderShape extends IColliderShape {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Update mesh data without changing the geometry type.
|
|
9
9
|
* @param positions - Vertex positions
|
|
10
|
-
* @param indices -
|
|
11
|
-
* @param isConvex - Whether to use convex mesh (true) or triangle mesh (false)
|
|
10
|
+
* @param indices - Index array (null for convex mesh)
|
|
12
11
|
* @param cookingFlags - Cooking flags
|
|
13
|
-
* @returns Whether the
|
|
12
|
+
* @returns Whether the update succeeded; failure leaves the shape unchanged
|
|
14
13
|
*/
|
|
15
|
-
setMeshData(positions: Vector3[], indices: Uint8Array | Uint16Array | Uint32Array | null,
|
|
14
|
+
setMeshData(positions: Vector3[], indices: Uint8Array | Uint16Array | Uint32Array | null, cookingFlags: number): boolean;
|
|
16
15
|
}
|
package/types/xr/IXRDevice.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IHardwareRenderer } from "../renderingHardwareInterface";
|
|
2
1
|
import { IXRSession } from "./IXRSession";
|
|
3
2
|
import { IXRPlatformFeature } from "./feature/IXRPlatformFeature";
|
|
4
3
|
/**
|
|
@@ -23,9 +22,9 @@ export interface IXRDevice {
|
|
|
23
22
|
createPlatformFeature(type: number, ...args: any[]): IXRPlatformFeature | null;
|
|
24
23
|
/**
|
|
25
24
|
* Request a session.
|
|
26
|
-
* @param
|
|
25
|
+
* @param rhi - Backend-specific graphics device handle
|
|
27
26
|
* @param mode - The mode of the session
|
|
28
27
|
* @param platformFeatures - The requested platform features
|
|
29
28
|
*/
|
|
30
|
-
requestSession(rhi:
|
|
29
|
+
requestSession(rhi: unknown, mode: number, platformFeatures: IXRPlatformFeature[]): Promise<IXRSession>;
|
|
31
30
|
}
|
package/types/xr/IXRSession.d.ts
CHANGED
|
@@ -21,10 +21,6 @@ export interface IXRSession {
|
|
|
21
21
|
* Returns the frame rate supported by the device.
|
|
22
22
|
*/
|
|
23
23
|
get supportedFrameRates(): Float32Array | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Returns the device's default main framebuffer.
|
|
26
|
-
*/
|
|
27
|
-
get framebuffer(): WebGLFramebuffer;
|
|
28
24
|
/**
|
|
29
25
|
* Returns the width of the device's default main framebuffer.
|
|
30
26
|
*/
|
|
@@ -33,6 +29,10 @@ export interface IXRSession {
|
|
|
33
29
|
* Returns the height of the device's default main framebuffer.
|
|
34
30
|
*/
|
|
35
31
|
get framebufferHeight(): number;
|
|
32
|
+
/**
|
|
33
|
+
* Synchronize per-frame session state before updating inputs and cameras.
|
|
34
|
+
*/
|
|
35
|
+
onUpdate(): void;
|
|
36
36
|
/**
|
|
37
37
|
* Set fixed foveation for camera.
|
|
38
38
|
* @param value - The fixed foveation value
|