@ue-too/dynamics 0.7.3 → 0.9.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/package.json CHANGED
@@ -1,7 +1,16 @@
1
1
  {
2
2
  "name": "@ue-too/dynamics",
3
3
  "type": "module",
4
- "version": "0.7.3",
4
+ "version": "0.9.0",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/ue-too/ue-too.git"
9
+ },
10
+ "homepage": "https://github.com/ue-too/ue-too",
11
+ "scripts": {
12
+ "test": "echo \"Error: no test specified\" && exit 1"
13
+ },
5
14
  "exports": {
6
15
  ".": {
7
16
  "types": "./index.d.ts",
@@ -11,13 +20,10 @@
11
20
  "./package.json": "./package.json"
12
21
  },
13
22
  "dependencies": {
14
- "@ue-too/math": "^0.7.3",
15
- "@ue-too/ecs": "^0.7.3"
23
+ "@ue-too/math": "^0.9.0",
24
+ "@ue-too/ecs": "^0.9.0"
16
25
  },
17
26
  "main": "./index.js",
18
27
  "types": "./index.d.ts",
19
- "module": "./index.js",
20
- "scripts": {
21
- "test": "echo \"Error: no test specified\" && exit 1"
22
- }
23
- }
28
+ "module": "./index.js"
29
+ }
package/LICENSE.txt DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2023 niuee
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the “Software”), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
package/benchmark.d.ts DELETED
@@ -1,47 +0,0 @@
1
- import { Point } from "@ue-too/math";
2
- interface MockRigidBody {
3
- AABB: {
4
- min: Point;
5
- max: Point;
6
- };
7
- id: number;
8
- velocity: Point;
9
- isStatic(): boolean;
10
- }
11
- declare class MockStaticBody implements MockRigidBody {
12
- AABB: {
13
- min: Point;
14
- max: Point;
15
- };
16
- id: number;
17
- velocity: Point;
18
- constructor(id: number, x: number, y: number, width: number, height: number);
19
- isStatic(): boolean;
20
- }
21
- declare class MockDynamicBody implements MockRigidBody {
22
- AABB: {
23
- min: Point;
24
- max: Point;
25
- };
26
- id: number;
27
- velocity: Point;
28
- constructor(id: number, x: number, y: number, width: number, height: number, vx?: number, vy?: number);
29
- isStatic(): boolean;
30
- update(dt: number): void;
31
- }
32
- declare class SpatialIndexBenchmark {
33
- private scenarios;
34
- constructor();
35
- private setupScenarios;
36
- private createDenseCluster;
37
- private createRandomDistribution;
38
- private createMovingObjects;
39
- private createLineFormation;
40
- private createMixedSizes;
41
- private benchmarkQuadTree;
42
- private benchmarkDynamicTree;
43
- private benchmarkSweepAndPrune;
44
- run(): void;
45
- }
46
- export { SpatialIndexBenchmark, MockRigidBody, MockDynamicBody, MockStaticBody };
47
- export declare function runBenchmark(): void;
@@ -1,36 +0,0 @@
1
- import { Coordinator, Entity, System } from "@ue-too/ecs";
2
- import { RigidBodyComponent } from "./component";
3
- import { Point } from "@ue-too/math";
4
- export declare class CollisionSystem implements System {
5
- private coordinator;
6
- private quadTree;
7
- entities: Set<Entity>;
8
- constructor(coordinator: Coordinator);
9
- constructQuadTree(): void;
10
- broadPhase(): {
11
- entityA: Entity;
12
- entityB: Entity;
13
- }[];
14
- narrowPhase(possibleCombinations: {
15
- entityA: Entity;
16
- entityB: Entity;
17
- }[]): void;
18
- update(deltaTime: number): void;
19
- }
20
- export declare function getVerticesAbsCoordRaw(vertices: Point[], center: Point, orientationAngle: number): Point[];
21
- export declare function updateAABBForPolygon(subjectBody: RigidBodyComponent): {
22
- min: Point;
23
- max: Point;
24
- };
25
- export declare function updateAABBForPolygonRaw(vertices: Point[], center: Point, orientationAngle: number): {
26
- min: Point;
27
- max: Point;
28
- };
29
- export declare function updateAABBForCircle(subjectBody: RigidBodyComponent): {
30
- min: Point;
31
- max: Point;
32
- };
33
- export declare function updateAABB(subjectBody: RigidBodyComponent): {
34
- min: Point;
35
- max: Point;
36
- };
@@ -1,40 +0,0 @@
1
- import { Point } from "@ue-too/math";
2
- export declare const RIGID_BODY_COMPONENT = "RigidBodyComponent";
3
- export declare const PHYSICS_COMPONENT = "PhysicsComponent";
4
- export declare const RENDER_COMPONENT = "RenderComponent";
5
- export declare const INPUT_COMPONENT = "InputComponent";
6
- export type RigidBodyComponent = {
7
- center: Point;
8
- orientationAngle: number;
9
- AABB: {
10
- min: Point;
11
- max: Point;
12
- };
13
- mass: number;
14
- staticFrictionCoeff: number;
15
- dynamicFrictionCoeff: number;
16
- momentOfInertia: number;
17
- isStatic: boolean;
18
- isMovingStatic: boolean;
19
- } & ({
20
- shapeType: "circle";
21
- radius: number;
22
- } | {
23
- shapeType: "polygon";
24
- vertices: Point[];
25
- });
26
- export type PhysicsComponent = {
27
- force: Point;
28
- angularDampingFactor: number;
29
- linearAcceleration: Point;
30
- angularAcceleration: number;
31
- linearVelocity: Point;
32
- angularVelocity: number;
33
- };
34
- export type RenderComponent = {
35
- show: boolean;
36
- };
37
- export type Direction = "idle" | "up" | "down" | "left" | "right";
38
- export type InputComponent = {
39
- direction: Direction;
40
- };
@@ -1,4 +0,0 @@
1
- export * from "./component";
2
- export * from "./collision-system";
3
- export * from "./physics-system";
4
- export * from "./render-system";
@@ -1,9 +0,0 @@
1
- import { Coordinator, Entity, System } from "@ue-too/ecs";
2
- export declare class PhysicsSystem implements System {
3
- entities: Set<Entity>;
4
- private coordinator;
5
- private _frictionEnabled;
6
- constructor(coordinator: Coordinator);
7
- get frictionEnabled(): boolean;
8
- update(deltaTime: number): void;
9
- }
@@ -1,8 +0,0 @@
1
- import { Coordinator, Entity, System } from "@ue-too/ecs";
2
- export declare class Canvas2DContextRenderSystem implements System {
3
- entities: Set<Entity>;
4
- private coordinator;
5
- private context;
6
- constructor(coordinator: Coordinator, context: CanvasRenderingContext2D);
7
- update(deltaTime: number): void;
8
- }
@@ -1,2 +0,0 @@
1
- declare function runSimpleBenchmark(): void;
2
- export { runSimpleBenchmark };