angular-three-cannon 1.0.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.
Files changed (48) hide show
  1. package/README.md +7 -0
  2. package/debug/README.md +3 -0
  3. package/debug/index.d.ts +1 -0
  4. package/debug/lib/debug.d.ts +26 -0
  5. package/esm2020/angular-three-cannon.mjs +5 -0
  6. package/esm2020/debug/angular-three-cannon-debug.mjs +5 -0
  7. package/esm2020/debug/index.mjs +2 -0
  8. package/esm2020/debug/lib/debug.mjs +117 -0
  9. package/esm2020/index.mjs +4 -0
  10. package/esm2020/lib/physics.mjs +261 -0
  11. package/esm2020/lib/store.mjs +21 -0
  12. package/esm2020/lib/utils.mjs +47 -0
  13. package/esm2020/services/angular-three-cannon-services.mjs +5 -0
  14. package/esm2020/services/index.mjs +2 -0
  15. package/esm2020/services/lib/body.mjs +293 -0
  16. package/fesm2015/angular-three-cannon-debug.mjs +124 -0
  17. package/fesm2015/angular-three-cannon-debug.mjs.map +1 -0
  18. package/fesm2015/angular-three-cannon-services.mjs +299 -0
  19. package/fesm2015/angular-three-cannon-services.mjs.map +1 -0
  20. package/fesm2015/angular-three-cannon.mjs +333 -0
  21. package/fesm2015/angular-three-cannon.mjs.map +1 -0
  22. package/fesm2020/angular-three-cannon-debug.mjs +124 -0
  23. package/fesm2020/angular-three-cannon-debug.mjs.map +1 -0
  24. package/fesm2020/angular-three-cannon-services.mjs +300 -0
  25. package/fesm2020/angular-three-cannon-services.mjs.map +1 -0
  26. package/fesm2020/angular-three-cannon.mjs +331 -0
  27. package/fesm2020/angular-three-cannon.mjs.map +1 -0
  28. package/index.d.ts +3 -0
  29. package/lib/physics.d.ts +43 -0
  30. package/lib/store.d.ts +34 -0
  31. package/lib/utils.d.ts +16 -0
  32. package/package.json +56 -0
  33. package/plugin/README.md +11 -0
  34. package/plugin/generators.json +19 -0
  35. package/plugin/package.json +10 -0
  36. package/plugin/src/generators/init/compat.d.ts +2 -0
  37. package/plugin/src/generators/init/compat.js +6 -0
  38. package/plugin/src/generators/init/compat.js.map +1 -0
  39. package/plugin/src/generators/init/init.d.ts +5 -0
  40. package/plugin/src/generators/init/init.js +28 -0
  41. package/plugin/src/generators/init/init.js.map +1 -0
  42. package/plugin/src/generators/init/schema.json +7 -0
  43. package/plugin/src/index.d.ts +1 -0
  44. package/plugin/src/index.js +6 -0
  45. package/plugin/src/index.js.map +1 -0
  46. package/services/README.md +3 -0
  47. package/services/index.d.ts +1 -0
  48. package/services/lib/body.d.ts +80 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "Init",
5
+ "title": "Init Angular Three Cannon"
6
+ }
7
+
@@ -0,0 +1 @@
1
+ export { default as initGenerator } from './generators/init/init';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initGenerator = void 0;
4
+ var init_1 = require("./generators/init/init");
5
+ Object.defineProperty(exports, "initGenerator", { enumerable: true, get: function () { return init_1.default; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/plugin/src/index.ts"],"names":[],"mappings":";;;AAAA,+CAAkE;AAAzD,qGAAA,OAAO,OAAiB"}
@@ -0,0 +1,3 @@
1
+ # angular-three-cannon/services
2
+
3
+ Secondary entry point of `angular-three-cannon`. It can be used by importing from `angular-three-cannon/services`.
@@ -0,0 +1 @@
1
+ export * from './lib/body';
@@ -0,0 +1,80 @@
1
+ import { AtomicName, AtomicProps, BodyProps, BoxProps, CompoundBodyProps, ConvexPolyhedronProps, CylinderProps, HeightfieldProps, ParticleProps, PlaneProps, Quad, SphereProps, TrimeshProps, Triplet, VectorName } from '@pmndrs/cannon-worker-api';
2
+ import { NgtInjectedRef } from 'angular-three';
3
+ import { Observable } from 'rxjs';
4
+ import * as THREE from 'three';
5
+ export type NgtcAtomicApi<K extends AtomicName> = {
6
+ set: (value: AtomicProps[K]) => void;
7
+ subscribe: (callback: (value: AtomicProps[K]) => void) => () => void;
8
+ };
9
+ export type NgtcQuaternionApi = {
10
+ copy: ({ w, x, y, z }: THREE.Quaternion) => void;
11
+ set: (x: number, y: number, z: number, w: number) => void;
12
+ subscribe: (callback: (value: Quad) => void) => () => void;
13
+ };
14
+ export type NgtcVectorApi = {
15
+ copy: ({ x, y, z }: THREE.Vector3 | THREE.Euler) => void;
16
+ set: (x: number, y: number, z: number) => void;
17
+ subscribe: (callback: (value: Triplet) => void) => () => void;
18
+ };
19
+ export type NgtcWorkerApi = {
20
+ [K in AtomicName]: NgtcAtomicApi<K>;
21
+ } & {
22
+ [K in VectorName]: NgtcVectorApi;
23
+ } & {
24
+ applyForce: (force: Triplet, worldPoint: Triplet) => void;
25
+ applyImpulse: (impulse: Triplet, worldPoint: Triplet) => void;
26
+ applyLocalForce: (force: Triplet, localPoint: Triplet) => void;
27
+ applyLocalImpulse: (impulse: Triplet, localPoint: Triplet) => void;
28
+ applyTorque: (torque: Triplet) => void;
29
+ quaternion: NgtcQuaternionApi;
30
+ rotation: NgtcVectorApi;
31
+ scaleOverride: (scale: Triplet) => void;
32
+ sleep: () => void;
33
+ wakeUp: () => void;
34
+ remove: () => void;
35
+ };
36
+ export interface NgtcBodyPublicApi extends NgtcWorkerApi {
37
+ at: (index: number) => NgtcWorkerApi;
38
+ }
39
+ export interface NgtcBodyReturn<TObject extends THREE.Object3D> {
40
+ ref: NgtInjectedRef<TObject>;
41
+ api: NgtcBodyPublicApi;
42
+ }
43
+ export type NgtcGetByIndex<T extends BodyProps> = (index: number) => T | Observable<T>;
44
+ export type NgtcArgFn<T> = (args: T) => unknown[];
45
+ export declare function injectPlane<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<PlaneProps>, opts?: {
46
+ ref?: NgtInjectedRef<TObject>;
47
+ waitFor?: Observable<unknown>;
48
+ }): NgtcBodyReturn<TObject>;
49
+ export declare function injectBox<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<BoxProps>, opts?: {
50
+ ref?: NgtInjectedRef<TObject>;
51
+ waitFor?: Observable<unknown>;
52
+ }): NgtcBodyReturn<TObject>;
53
+ export declare function injectCylinder<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<CylinderProps>, opts?: {
54
+ ref?: NgtInjectedRef<TObject>;
55
+ waitFor?: Observable<unknown>;
56
+ }): NgtcBodyReturn<TObject>;
57
+ export declare function injectHeightfield<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<HeightfieldProps>, opts?: {
58
+ ref?: NgtInjectedRef<TObject>;
59
+ waitFor?: Observable<unknown>;
60
+ }): NgtcBodyReturn<TObject>;
61
+ export declare function injectParticle<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<ParticleProps>, opts?: {
62
+ ref?: NgtInjectedRef<TObject>;
63
+ waitFor?: Observable<unknown>;
64
+ }): NgtcBodyReturn<TObject>;
65
+ export declare function injectSphere<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<SphereProps>, opts?: {
66
+ ref?: NgtInjectedRef<TObject>;
67
+ waitFor?: Observable<unknown>;
68
+ }): NgtcBodyReturn<TObject>;
69
+ export declare function injectTrimesh<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<TrimeshProps>, opts?: {
70
+ ref?: NgtInjectedRef<TObject>;
71
+ waitFor?: Observable<unknown>;
72
+ }): NgtcBodyReturn<TObject>;
73
+ export declare function injectConvexPolyhedron<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<ConvexPolyhedronProps>, opts?: {
74
+ ref?: NgtInjectedRef<TObject>;
75
+ waitFor?: Observable<unknown>;
76
+ }): NgtcBodyReturn<TObject>;
77
+ export declare function injectCompoundBody<TObject extends THREE.Object3D>(fn: NgtcGetByIndex<CompoundBodyProps>, opts?: {
78
+ ref?: NgtInjectedRef<TObject>;
79
+ waitFor?: Observable<unknown>;
80
+ }): NgtcBodyReturn<TObject>;