@galacean/engine-physics-lite 1.0.0-beta.8 → 1.1.0-alpha.0
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/browser.js +65 -60
- package/dist/browser.min.js +1 -1
- package/dist/main.js +65 -60
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +11546 -11140
- package/dist/module.js +65 -60
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/LitePhysics.d.ts +8 -2
- package/types/LitePhysicsManager.d.ts +1 -77
- package/types/LitePhysicsScene.d.ts +79 -0
|
@@ -1,79 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Ray, Vector3 } from "@galacean/engine";
|
|
3
|
-
import { LiteCollider } from "./LiteCollider";
|
|
4
|
-
import { LiteColliderShape } from "./shape/LiteColliderShape";
|
|
5
|
-
/**
|
|
6
|
-
* A manager is a collection of colliders and constraints which can interact.
|
|
7
|
-
*/
|
|
1
|
+
import { IPhysicsManager } from "@galacean/engine-design";
|
|
8
2
|
export declare class LitePhysicsManager implements IPhysicsManager {
|
|
9
|
-
private static _tempSphere;
|
|
10
|
-
private static _tempBox;
|
|
11
|
-
private static _currentHit;
|
|
12
|
-
private static _hitResult;
|
|
13
|
-
private readonly _onContactEnter?;
|
|
14
|
-
private readonly _onContactExit?;
|
|
15
|
-
private readonly _onContactStay?;
|
|
16
|
-
private readonly _onTriggerEnter?;
|
|
17
|
-
private readonly _onTriggerExit?;
|
|
18
|
-
private readonly _onTriggerStay?;
|
|
19
|
-
private _colliders;
|
|
20
|
-
private _sphere;
|
|
21
|
-
private _box;
|
|
22
|
-
private _currentEvents;
|
|
23
|
-
private _eventMap;
|
|
24
|
-
private _eventPool;
|
|
25
|
-
constructor(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);
|
|
26
|
-
/**
|
|
27
|
-
* {@inheritDoc IPhysicsManager.setGravity }
|
|
28
|
-
*/
|
|
29
|
-
setGravity(value: Vector3): void;
|
|
30
|
-
/**
|
|
31
|
-
* {@inheritDoc IPhysicsManager.addColliderShape }
|
|
32
|
-
*/
|
|
33
|
-
addColliderShape(colliderShape: LiteColliderShape): void;
|
|
34
|
-
/**
|
|
35
|
-
* {@inheritDoc IPhysicsManager.removeColliderShape }
|
|
36
|
-
*/
|
|
37
|
-
removeColliderShape(colliderShape: LiteColliderShape): void;
|
|
38
|
-
/**
|
|
39
|
-
* {@inheritDoc IPhysicsManager.addCollider }
|
|
40
|
-
*/
|
|
41
|
-
addCollider(actor: LiteCollider): void;
|
|
42
|
-
/**
|
|
43
|
-
* {@inheritDoc IPhysicsManager.removeCollider }
|
|
44
|
-
*/
|
|
45
|
-
removeCollider(collider: LiteCollider): void;
|
|
46
|
-
/**
|
|
47
|
-
* {@inheritDoc IPhysicsManager.update }
|
|
48
|
-
*/
|
|
49
|
-
update(deltaTime: number): void;
|
|
50
|
-
/**
|
|
51
|
-
* {@inheritDoc IPhysicsManager.raycast }
|
|
52
|
-
*/
|
|
53
|
-
raycast(ray: Ray, distance: number, onRaycast: (obj: number) => boolean, hit?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* {@inheritDoc IPhysicsManager.addCharacterController }
|
|
56
|
-
*/
|
|
57
|
-
addCharacterController(characterController: ICharacterController): void;
|
|
58
|
-
/**
|
|
59
|
-
* {@inheritDoc IPhysicsManager.removeCharacterController }
|
|
60
|
-
*/
|
|
61
|
-
removeCharacterController(characterController: ICharacterController): void;
|
|
62
|
-
/**
|
|
63
|
-
* Calculate the bounding box in world space from boxCollider.
|
|
64
|
-
* @param boxCollider - The boxCollider to calculate
|
|
65
|
-
* @param out - The calculated boundingBox
|
|
66
|
-
*/
|
|
67
|
-
private static _updateWorldBox;
|
|
68
|
-
/**
|
|
69
|
-
* Get the sphere info of the given sphere collider in world space.
|
|
70
|
-
* @param sphereCollider - The given sphere collider
|
|
71
|
-
* @param out - The calculated boundingSphere
|
|
72
|
-
*/
|
|
73
|
-
private static _upWorldSphere;
|
|
74
|
-
private _getTrigger;
|
|
75
|
-
private _collisionDetection;
|
|
76
|
-
private _fireEvent;
|
|
77
|
-
private _boxCollision;
|
|
78
|
-
private _sphereCollision;
|
|
79
3
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ICharacterController, IPhysicsScene } from "@galacean/engine-design";
|
|
2
|
+
import { Ray, Vector3 } from "@galacean/engine";
|
|
3
|
+
import { LiteCollider } from "./LiteCollider";
|
|
4
|
+
import { LiteColliderShape } from "./shape/LiteColliderShape";
|
|
5
|
+
/**
|
|
6
|
+
* A manager is a collection of colliders and constraints which can interact.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LitePhysicsScene implements IPhysicsScene {
|
|
9
|
+
private static _tempSphere;
|
|
10
|
+
private static _tempBox;
|
|
11
|
+
private static _currentHit;
|
|
12
|
+
private static _hitResult;
|
|
13
|
+
private readonly _onContactEnter?;
|
|
14
|
+
private readonly _onContactExit?;
|
|
15
|
+
private readonly _onContactStay?;
|
|
16
|
+
private readonly _onTriggerEnter?;
|
|
17
|
+
private readonly _onTriggerExit?;
|
|
18
|
+
private readonly _onTriggerStay?;
|
|
19
|
+
private _colliders;
|
|
20
|
+
private _sphere;
|
|
21
|
+
private _box;
|
|
22
|
+
private _currentEvents;
|
|
23
|
+
private _eventMap;
|
|
24
|
+
private _eventPool;
|
|
25
|
+
constructor(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);
|
|
26
|
+
/**
|
|
27
|
+
* {@inheritDoc IPhysicsManager.setGravity }
|
|
28
|
+
*/
|
|
29
|
+
setGravity(value: Vector3): void;
|
|
30
|
+
/**
|
|
31
|
+
* {@inheritDoc IPhysicsManager.addColliderShape }
|
|
32
|
+
*/
|
|
33
|
+
addColliderShape(colliderShape: LiteColliderShape): void;
|
|
34
|
+
/**
|
|
35
|
+
* {@inheritDoc IPhysicsManager.removeColliderShape }
|
|
36
|
+
*/
|
|
37
|
+
removeColliderShape(colliderShape: LiteColliderShape): void;
|
|
38
|
+
/**
|
|
39
|
+
* {@inheritDoc IPhysicsManager.addCollider }
|
|
40
|
+
*/
|
|
41
|
+
addCollider(actor: LiteCollider): void;
|
|
42
|
+
/**
|
|
43
|
+
* {@inheritDoc IPhysicsManager.removeCollider }
|
|
44
|
+
*/
|
|
45
|
+
removeCollider(collider: LiteCollider): void;
|
|
46
|
+
/**
|
|
47
|
+
* {@inheritDoc IPhysicsManager.update }
|
|
48
|
+
*/
|
|
49
|
+
update(deltaTime: number): void;
|
|
50
|
+
/**
|
|
51
|
+
* {@inheritDoc IPhysicsManager.raycast }
|
|
52
|
+
*/
|
|
53
|
+
raycast(ray: Ray, distance: number, onRaycast: (obj: number) => boolean, hit?: (shapeUniqueID: number, distance: number, position: Vector3, normal: Vector3) => void): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* {@inheritDoc IPhysicsManager.addCharacterController }
|
|
56
|
+
*/
|
|
57
|
+
addCharacterController(characterController: ICharacterController): void;
|
|
58
|
+
/**
|
|
59
|
+
* {@inheritDoc IPhysicsManager.removeCharacterController }
|
|
60
|
+
*/
|
|
61
|
+
removeCharacterController(characterController: ICharacterController): void;
|
|
62
|
+
/**
|
|
63
|
+
* Calculate the bounding box in world space from boxCollider.
|
|
64
|
+
* @param boxCollider - The boxCollider to calculate
|
|
65
|
+
* @param out - The calculated boundingBox
|
|
66
|
+
*/
|
|
67
|
+
private static _updateWorldBox;
|
|
68
|
+
/**
|
|
69
|
+
* Get the sphere info of the given sphere collider in world space.
|
|
70
|
+
* @param sphereCollider - The given sphere collider
|
|
71
|
+
* @param out - The calculated boundingSphere
|
|
72
|
+
*/
|
|
73
|
+
private static _upWorldSphere;
|
|
74
|
+
private _getTrigger;
|
|
75
|
+
private _collisionDetection;
|
|
76
|
+
private _fireEvent;
|
|
77
|
+
private _boxCollision;
|
|
78
|
+
private _sphereCollision;
|
|
79
|
+
}
|