@galacean/engine-design 0.9.20 → 0.9.22

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.9.20",
3
+ "version": "0.9.22",
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.9.20"
17
+ "@galacean/engine-math": "0.9.22"
18
18
  },
19
19
  "scripts": {
20
20
  "b:types": "tsc"
@@ -0,0 +1,58 @@
1
+ import { Ray, Vector3 } from "@galacean/engine-math";
2
+ import { ICharacterController } from "./ICharacterController";
3
+ import { ICollider } from "./ICollider";
4
+ import { IColliderShape } from "./shape";
5
+ /**
6
+ * Interface for physics manager.
7
+ */
8
+ export interface IPhysicsScene {
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
+ }
@@ -0,0 +1,4 @@
1
+ export interface IPlatformPrimitiveVertexBinding {
2
+ draw(tech: any, subPrimitive: any): void;
3
+ destroy(): void;
4
+ }
@@ -0,0 +1,10 @@
1
+ interface IRenderStatePropertyItemInfo {
2
+ property: string;
3
+ value: any;
4
+ index?: number;
5
+ }
6
+ export interface IRenderStateInfo {
7
+ renderStateType: "BlendState" | "DepthState" | "StencilState" | "RasterState";
8
+ properties: Array<IRenderStatePropertyItemInfo>;
9
+ }
10
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ISubShaderInfo } from "./ISubShaderInfo";
2
+ export interface IShaderInfo {
3
+ name: string;
4
+ subShaders: ISubShaderInfo[];
5
+ }
@@ -0,0 +1,10 @@
1
+ import { IShaderInfo } from "./IShaderInfo";
2
+ /**
3
+ * Shader lab interface.
4
+ */
5
+ export interface IShaderLab {
6
+ /**
7
+ * parsing shader source code.
8
+ */
9
+ parseShader(shaderSource: string): IShaderInfo;
10
+ }
@@ -0,0 +1,13 @@
1
+ import { Color } from "@galacean/engine-math";
2
+ export interface IShaderPassInfo {
3
+ name: string;
4
+ vertexSource: string;
5
+ fragmentSource: string;
6
+ tags?: Record<string, number | string | boolean>;
7
+ renderStates: [
8
+ /** Constant RenderState. */
9
+ Record<number, boolean | string | number | Color>,
10
+ /** Variable RenderState. */
11
+ Record<number, string>
12
+ ];
13
+ }
@@ -0,0 +1,6 @@
1
+ import { IShaderPassInfo } from "./IShaderPassInfo";
2
+ export interface ISubShaderInfo {
3
+ name: string;
4
+ passes: (IShaderPassInfo | string)[];
5
+ tags?: Record<string, number | string | boolean>;
6
+ }
@@ -0,0 +1,4 @@
1
+ export type { IShaderInfo } from "./IShaderInfo";
2
+ export type { IShaderLab } from "./IShaderLab";
3
+ export type { IShaderPassInfo } from "./IShaderPassInfo";
4
+ export type { ISubShaderInfo } from "./ISubShaderInfo";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Shader lab interface.
3
+ */
4
+ export interface IShaderLab {
5
+ parseShader(shaderSource: string): IShaderInfo;
6
+ }
7
+ export interface IShaderInfo {
8
+ name: string;
9
+ subShaders: ISubShaderInfo[];
10
+ }
11
+ export interface ISubShaderInfo {
12
+ passes: IShaderPassInfo[];
13
+ tags?: Record<string, number | string | boolean>;
14
+ }
15
+ export interface IShaderPassInfo {
16
+ name: string;
17
+ vert: string;
18
+ frag: string;
19
+ tags?: Record<string, number | string | boolean>;
20
+ renderStates: Record<string, any>;
21
+ }