@galacean/engine-design 0.0.0-experimental-double11.4 → 0.0.0-experimental-double11.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-design",
3
- "version": "0.0.0-experimental-double11.4",
3
+ "version": "0.0.0-experimental-double11.5",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "types": "types/index.d.ts",
16
16
  "dependencies": {
17
- "@galacean/engine-math": "0.0.0-experimental-double11.4"
17
+ "@galacean/engine-math": "0.0.0-experimental-double11.5"
18
18
  },
19
19
  "scripts": {
20
20
  "b:types": "tsc"
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type { IClone } from "./IClone";
1
2
  export * from "./physics/index";
2
3
  export * from "./renderingHardwareInterface/index";
3
- export type { IClone } from "./IClone";
4
+ export * from "./shader-lab/index";
@@ -4,6 +4,7 @@ import { ICollider } from "./ICollider";
4
4
  import { IDynamicCollider } from "./IDynamicCollider";
5
5
  import { IPhysicsManager } from "./IPhysicsManager";
6
6
  import { IPhysicsMaterial } from "./IPhysicsMaterial";
7
+ import { IPhysicsScene } from "./IPhysicsScene";
7
8
  import { IStaticCollider } from "./IStaticCollider";
8
9
  import { IFixedJoint, IHingeJoint, ISpringJoint } from "./joints";
9
10
  import { IBoxColliderShape, ICapsuleColliderShape, IPlaneColliderShape, ISphereColliderShape } from "./shape";
@@ -18,6 +19,11 @@ export interface IPhysics {
18
19
  initialize(): Promise<void>;
19
20
  /**
20
21
  * Create physics manager.
22
+ */
23
+ createPhysicsManager(): IPhysicsManager;
24
+ /**
25
+ * Create physics scene.
26
+ * @param physicsManager - The physics manager
21
27
  * @param onContactEnter - Function called when contact begin
22
28
  * @param onContactExit - Function called when contact end
23
29
  * @param onContactStay - Function called when contact stay
@@ -25,7 +31,7 @@ export interface IPhysics {
25
31
  * @param onTriggerExit - Function called when trigger end
26
32
  * @param onTriggerStay - Function called when trigger stay
27
33
  */
28
- createPhysicsManager(onContactEnter?: (obj1: number, obj2: number) => void, onContactExit?: (obj1: number, obj2: number) => void, onContactStay?: (obj1: number, obj2: number) => void, onTriggerEnter?: (obj1: number, obj2: number) => void, onTriggerExit?: (obj1: number, obj2: number) => void, onTriggerStay?: (obj1: number, obj2: number) => void): IPhysicsManager;
34
+ createPhysicsScene(physicsManager: IPhysicsManager, onContactEnter?: (obj1: number, obj2: number) => void, onContactExit?: (obj1: number, obj2: number) => void, onContactStay?: (obj1: number, obj2: number) => void, onTriggerEnter?: (obj1: number, obj2: number) => void, onTriggerExit?: (obj1: number, obj2: number) => void, onTriggerStay?: (obj1: number, obj2: number) => void): IPhysicsScene;
29
35
  /**
30
36
  * Create dynamic collider.
31
37
  * @param position - The global position
@@ -1,58 +1,5 @@
1
- import { Ray, Vector3 } from "@galacean/engine-math";
2
- import { ICharacterController } from "./ICharacterController";
3
- import { ICollider } from "./ICollider";
4
- import { IColliderShape } from "./shape";
5
1
  /**
6
- * Interface for physics manager.
2
+ * Interface for the physics manager.
7
3
  */
8
4
  export interface IPhysicsManager {
9
- /**
10
- * Set gravity.
11
- * @param gravity - Physics gravity
12
- */
13
- setGravity(gravity: Vector3): void;
14
- /**
15
- * Add IColliderShape into the manager.
16
- * @param colliderShape - The Collider Shape.
17
- */
18
- addColliderShape(colliderShape: IColliderShape): void;
19
- /**
20
- * Remove IColliderShape.
21
- * @param colliderShape - The Collider Shape.
22
- */
23
- removeColliderShape(colliderShape: IColliderShape): void;
24
- /**
25
- * Add ICollider into the manager.
26
- * @param collider - StaticCollider or DynamicCollider.
27
- */
28
- addCollider(collider: ICollider): void;
29
- /**
30
- * Remove ICollider.
31
- * @param collider - StaticCollider or DynamicCollider.
32
- */
33
- removeCollider(collider: ICollider): void;
34
- /**
35
- * Add ICharacterController into the manager.
36
- * @param characterController The Character Controller.
37
- */
38
- addCharacterController(characterController: ICharacterController): void;
39
- /**
40
- * Remove ICharacterController.
41
- * @param characterController The Character Controller.
42
- */
43
- removeCharacterController(characterController: ICharacterController): void;
44
- /**
45
- * Call on every frame to update pose of objects.
46
- * @param elapsedTime - Step time of update.
47
- */
48
- update(elapsedTime: number): void;
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 onRaycast - The raycast result callback which prefilter result
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, onRaycast: (obj: number) => boolean, outHitResult?: (shapeUniqueID: number, distance: number, point: Vector3, normal: Vector3) => void): boolean;
58
5
  }
@@ -1,9 +1,10 @@
1
- export type { IPhysics } from "./IPhysics";
2
- export type { IPhysicsManager } from "./IPhysicsManager";
1
+ export type { ICharacterController } from "./ICharacterController";
3
2
  export type { ICollider } from "./ICollider";
4
- export type { IStaticCollider } from "./IStaticCollider";
5
3
  export type { IDynamicCollider } from "./IDynamicCollider";
4
+ export type { IPhysics } from "./IPhysics";
6
5
  export type { IPhysicsMaterial } from "./IPhysicsMaterial";
7
- export type { ICharacterController } from "./ICharacterController";
8
- export * from "./shape/index";
6
+ export type { IPhysicsScene } from "./IPhysicsScene";
7
+ export type { IPhysicsManager } from "./IPhysicsManager";
8
+ export type { IStaticCollider } from "./IStaticCollider";
9
9
  export * from "./joints/index";
10
+ export * from "./shape/index";
@@ -19,7 +19,7 @@ export interface IHingeJoint extends IJoint {
19
19
  /**
20
20
  * The angular velocity of the joint in degrees per second.
21
21
  */
22
- getVelocity(): Readonly<Vector3>;
22
+ getVelocity(): Readonly<number>;
23
23
  /**
24
24
  * Set a cone hard limit.
25
25
  * @param lowerLimit The lower angle of the limit
@@ -1,15 +1,4 @@
1
- /**
2
- * Platform primitive interface.
3
- */
4
1
  export interface IPlatformPrimitive {
5
- /**
6
- * Draw primitive.
7
- * @param tech - Shader
8
- * @param subPrimitive - Sub primitive
9
- */
10
2
  draw(tech: any, subPrimitive: any): void;
11
- /**
12
- * Destroy.
13
- */
14
3
  destroy(): void;
15
4
  }