@daneren2005/shared-memory-physics 1.9.1 → 1.9.3
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/README.md +6 -0
- package/dist/index.js +318 -305
- package/dist/index.js.map +1 -1
- package/dist/systems/physics-update.d.ts +2 -0
- package/dist/world.d.ts +4 -1
- package/package.json +12 -12
|
@@ -31,11 +31,13 @@ export interface PhysicsGroupConfig<C extends ComponentMap> {
|
|
|
31
31
|
component: keyof C & string;
|
|
32
32
|
index: number;
|
|
33
33
|
}
|
|
34
|
+
export declare const PHYSICS_WRITES: readonly ['transform', 'velocity', 'interpolation'];
|
|
34
35
|
export interface PhysicsUpdateMetadata<C extends ComponentMap> {
|
|
35
36
|
collision: boolean;
|
|
36
37
|
dynamics: boolean;
|
|
37
38
|
optional: Array<keyof C & string>;
|
|
38
39
|
group?: PhysicsGroupConfig<C>;
|
|
40
|
+
writes: Array<keyof C & string>;
|
|
39
41
|
}
|
|
40
42
|
export type PhysicsUpdateFunction<C extends ComponentMap, T extends PhysicsUpdateComponents & EntityUpdateComponents<C>, W extends PhysicsWorld = PhysicsWorld> = EntityUpdateFunction<C, T, W> & {
|
|
41
43
|
physics: PhysicsUpdateMetadata<C>;
|
package/dist/world.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import SharedSpatialMap from '@daneren2005/shared-memory-objects/spatial/shared-spatial-map';
|
|
2
2
|
import type { SharedSpatialMapConfig, SharedSpatialMapMemory } from '@daneren2005/shared-memory-objects/spatial/shared-spatial-map';
|
|
3
3
|
import { BaseWorld } from '@daneren2005/shared-memory-ecs';
|
|
4
|
-
import type { BaseEntity, ComponentDefinitionMap, ComponentsOf, EntityWorkerSystemWorld, EntityConfigOf, WorldOptions } from '@daneren2005/shared-memory-ecs';
|
|
4
|
+
import type { BaseEntity, ComponentDefinitionMap, ComponentsOf, CompressedWorldConfig, EntityWorkerSystemWorld, EntityConfigOf, WorldConfig, WorldLoadOptions, WorldOptions } from '@daneren2005/shared-memory-ecs';
|
|
5
5
|
export interface PhysicalWorldData {
|
|
6
6
|
spatialMapMemory?: SharedSpatialMapMemory;
|
|
7
7
|
}
|
|
@@ -19,8 +19,11 @@ export type PhysicalWorldFilter<R extends ComponentDefinitionMap, E extends Base
|
|
|
19
19
|
export default class PhysicalWorld<R extends ComponentDefinitionMap, E extends BaseEntity<ComponentsOf<R>, EntityConfigOf<R>> = BaseEntity<ComponentsOf<R>, EntityConfigOf<R>>> extends BaseWorld<R, ComponentsOf<R>, EntityConfigOf<R>, E> implements PhysicalWorldSource {
|
|
20
20
|
readonly spatialMap: SharedSpatialMap;
|
|
21
21
|
private spatialIds;
|
|
22
|
+
private pendingSpatial;
|
|
22
23
|
constructor(registry: R, options?: PhysicalWorldOptions<R, E>);
|
|
24
|
+
load(config: WorldConfig<EntityConfigOf<R>> | CompressedWorldConfig<EntityConfigOf<R>>, options?: WorldLoadOptions): Promise<void>;
|
|
23
25
|
updateSpatialEntity(entityOrId: PhysicalWorldEntity<R, E> | number): void;
|
|
26
|
+
private flushPendingSpatial;
|
|
24
27
|
searchSpatial(minX: number, minY: number, maxX: number, maxY: number, filter?: PhysicalWorldFilter<R, E>): Array<PhysicalWorldEntity<R, E>>;
|
|
25
28
|
searchSpatialAround(x: number, y: number, reachX: number, reachY: number, filter?: PhysicalWorldFilter<R, E>): Array<PhysicalWorldEntity<R, E>>;
|
|
26
29
|
findNearestSpatial(x: number, y: number, maxDistance?: number, filter?: PhysicalWorldFilter<R, E>): PhysicalWorldEntity<R, E> | undefined;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@daneren2005/shared-memory-physics",
|
|
3
3
|
"description": "2D physics components and systems built on the shared-memory ECS.",
|
|
4
4
|
"author": "Scott Jackson",
|
|
5
|
-
"version": "1.9.
|
|
5
|
+
"version": "1.9.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"license": "MIT",
|
|
@@ -42,28 +42,28 @@
|
|
|
42
42
|
"prepare": "husky"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@daneren2005/shared-memory-ecs": "^1.10.
|
|
46
|
-
"@daneren2005/shared-memory-objects": "^1.6.
|
|
47
|
-
"@semantic-release/git": "^
|
|
45
|
+
"@daneren2005/shared-memory-ecs": "^1.10.4",
|
|
46
|
+
"@daneren2005/shared-memory-objects": "^1.6.2",
|
|
47
|
+
"@semantic-release/git": "^11.0.1",
|
|
48
48
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
49
|
-
"@types/node": "^26.6.
|
|
50
|
-
"@vitest/web-worker": "^5.0.
|
|
49
|
+
"@types/node": "^26.6.6",
|
|
50
|
+
"@vitest/web-worker": "^5.0.5",
|
|
51
51
|
"cross-env": "^10.1.0",
|
|
52
52
|
"husky": "^9.1.7",
|
|
53
|
-
"lint-staged": "^17.
|
|
54
|
-
"oxlint": "^1.
|
|
55
|
-
"oxlint-tsgolint": "^7.0.
|
|
53
|
+
"lint-staged": "^17.6.0",
|
|
54
|
+
"oxlint": "^1.90.0",
|
|
55
|
+
"oxlint-tsgolint": "^7.0.2005",
|
|
56
56
|
"phaser": "^4.2.1",
|
|
57
57
|
"semantic-release": "^25.0.9",
|
|
58
58
|
"typescript": "^7.0.2",
|
|
59
|
-
"vite": "^8.3.
|
|
60
|
-
"vitest": "^5.0.
|
|
59
|
+
"vite": "^8.3.5",
|
|
60
|
+
"vitest": "^5.0.5"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@daneren2005/shared-memory-ecs": "^1.10.0",
|
|
64
64
|
"@daneren2005/shared-memory-objects": "^1.1.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"flatbush": "^4.
|
|
67
|
+
"flatbush": "^4.7.0"
|
|
68
68
|
}
|
|
69
69
|
}
|