angular-three-rapier 4.2.1 → 4.2.2

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.
@@ -27,7 +27,7 @@ function attractorDebug(object, options, injector) {
27
27
  const store = injectStore();
28
28
  const strength = pick(options, 'strength');
29
29
  const range = pick(options, 'range');
30
- const color = computed(() => (strength() > 0 ? 0x0000ff : 0xff0000), ...(ngDevMode ? [{ debugName: "color" }] : []));
30
+ const color = computed(() => (strength() > 0 ? 0x0000ff : 0xff0000), ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
31
31
  let mesh;
32
32
  let normalsHelper;
33
33
  effect((onCleanup) => {
@@ -158,11 +158,11 @@ const defaultOptions = {
158
158
  * ```
159
159
  */
160
160
  class NgtrAttractor {
161
- position = input([0, 0, 0], ...(ngDevMode ? [{ debugName: "position" }] : []));
162
- options = input(defaultOptions, { ...(ngDevMode ? { debugName: "options" } : {}), alias: 'attractor', transform: mergeInputs(defaultOptions) });
161
+ position = input([0, 0, 0], ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
162
+ options = input(defaultOptions, { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: 'attractor', transform: mergeInputs(defaultOptions) });
163
163
  objectRef = inject(ElementRef);
164
164
  collisionGroups = pick(this.options, 'collisionGroups');
165
- linkedCollisionGroups = linkedSignal(this.collisionGroups, ...(ngDevMode ? [{ debugName: "linkedCollisionGroups" }] : []));
165
+ linkedCollisionGroups = linkedSignal(this.collisionGroups, ...(ngDevMode ? [{ debugName: "linkedCollisionGroups" }] : /* istanbul ignore next */ []));
166
166
  constructor() {
167
167
  effect(() => {
168
168
  applyProps(this.objectRef.nativeElement, { position: this.position() });
@@ -185,8 +185,8 @@ class NgtrAttractor {
185
185
  });
186
186
  attractorDebug(this.objectRef.nativeElement, this.options);
187
187
  }
188
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: NgtrAttractor, deps: [], target: i0.ɵɵFactoryTarget.Directive });
189
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.6", type: NgtrAttractor, isStandalone: true, selector: "ngt-object3D[attractor]", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "attractor", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
188
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgtrAttractor, deps: [], target: i0.ɵɵFactoryTarget.Directive });
189
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: NgtrAttractor, isStandalone: true, selector: "ngt-object3D[attractor]", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "attractor", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
190
190
  {
191
191
  provide: COLLISION_GROUPS_HANDLER,
192
192
  useFactory: (attractor) => {
@@ -198,7 +198,7 @@ class NgtrAttractor {
198
198
  },
199
199
  ], ngImport: i0 });
200
200
  }
201
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: NgtrAttractor, decorators: [{
201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgtrAttractor, decorators: [{
202
202
  type: Directive,
203
203
  args: [{
204
204
  selector: 'ngt-object3D[attractor]',
@@ -1 +1 @@
1
- {"version":3,"file":"angular-three-rapier-addons.mjs","sources":["../../../../libs/rapier/addons/src/lib/attractor-debug.ts","../../../../libs/rapier/addons/src/lib/attractor.ts","../../../../libs/rapier/addons/src/angular-three-rapier-addons.ts"],"sourcesContent":["import { computed, effect, inject, Injector } from '@angular/core';\nimport { beforeRender, injectStore, pick } from 'angular-three';\nimport { NgtrPhysics } from 'angular-three-rapier';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\nimport { VertexNormalsHelper } from 'three-stdlib';\nimport { NgtrAttactorOptions } from './attractor';\n\nconst _v3 = new THREE.Vector3();\n\n/**\n * Creates debug visualization for an attractor.\n * Shows a sphere at the attractor position with normals indicating the range.\n * Blue indicates attraction, red indicates repulsion.\n *\n * This is automatically called by NgtrAttractor when physics debug mode is enabled.\n *\n * @param object - The Object3D representing the attractor position\n * @param options - Getter function for attractor options\n * @param injector - Optional injector for dependency injection context\n *\n * @internal\n */\nexport function attractorDebug(object: THREE.Object3D, options: () => NgtrAttactorOptions, injector?: Injector) {\n\treturn assertInjector(attractorDebug, injector, () => {\n\t\tconst physics = inject(NgtrPhysics);\n\t\tconst store = injectStore();\n\n\t\tconst strength = pick(options, 'strength');\n\t\tconst range = pick(options, 'range');\n\t\tconst color = computed(() => (strength() > 0 ? 0x0000ff : 0xff0000));\n\n\t\tlet mesh: THREE.Mesh;\n\t\tlet normalsHelper: VertexNormalsHelper;\n\n\t\teffect((onCleanup) => {\n\t\t\tif (!physics['debug']()) return;\n\n\t\t\tmesh = new THREE.Mesh(\n\t\t\t\tnew THREE.SphereGeometry(0.2, 6, 6),\n\t\t\t\tnew THREE.MeshBasicMaterial({ color: color(), wireframe: true }),\n\t\t\t);\n\n\t\t\tnormalsHelper = new VertexNormalsHelper(mesh, range(), color());\n\t\t\tnormalsHelper.frustumCulled = false;\n\n\t\t\tstore.snapshot.scene.add(mesh);\n\t\t\tstore.snapshot.scene.add(normalsHelper);\n\n\t\t\tonCleanup(() => {\n\t\t\t\tif (mesh) {\n\t\t\t\t\tstore.snapshot.scene.remove(mesh);\n\t\t\t\t}\n\n\t\t\t\tif (normalsHelper) {\n\t\t\t\t\tstore.snapshot.scene.remove(normalsHelper);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tbeforeRender(() => {\n\t\t\tif (!physics['debug']() || !mesh || !normalsHelper) return;\n\n\t\t\tconst worldPosition = object.getWorldPosition(_v3);\n\t\t\tmesh.position.copy(worldPosition);\n\t\t\tnormalsHelper.update();\n\t\t});\n\t});\n}\n","import { Directive, effect, ElementRef, inject, input, linkedSignal, untracked } from '@angular/core';\nimport { InteractionGroups, RigidBody } from '@dimforge/rapier3d-compat';\nimport { applyProps, NgtVector3, pick } from 'angular-three';\nimport { beforePhysicsStep, COLLISION_GROUPS_HANDLER } from 'angular-three-rapier';\nimport { mergeInputs } from 'ngxtension/inject-inputs';\nimport * as THREE from 'three';\nimport { attractorDebug } from './attractor-debug';\n\n/**\n * Force calculation functions for different gravity types.\n * - static: Constant force regardless of distance\n * - linear: Force increases linearly as distance decreases\n * - newtonian: Force follows Newton's law of universal gravitation\n */\nconst calcForceByType = {\n\tstatic: (s: number, m2: number, r: number, d: number, G: number) => s,\n\tlinear: (s: number, m2: number, r: number, d: number, G: number) => s * (d / r),\n\tnewtonian: (s: number, m2: number, r: number, d: number, G: number) => (G * s * m2) / Math.pow(d, 2),\n};\n\nconst _position = new THREE.Vector3();\nconst _vector3 = new THREE.Vector3();\n\n/**\n * Applies attractor force to a rigid body based on its distance from the attractor.\n * Used internally by NgtrAttractor but can be called manually for custom behavior.\n *\n * @param rigidBody - The rigid body to apply the force to\n * @param options - The attractor configuration including position, strength, and type\n *\n * @example\n * ```typescript\n * beforePhysicsStep((world) => {\n * world.bodies.forEach((body) => {\n * if (body.isDynamic()) {\n * applyAttractorForceOnRigidBody(body, {\n * object: attractorMesh,\n * strength: 10,\n * range: 20,\n * type: 'newtonian',\n * gravitationalConstant: 6.673e-11\n * });\n * }\n * });\n * });\n * ```\n */\nexport function applyAttractorForceOnRigidBody(\n\trigidBody: RigidBody,\n\t{\n\t\tobject,\n\t\tstrength,\n\t\trange,\n\t\tgravitationalConstant,\n\t\tcollisionGroups,\n\t\ttype,\n\t}: NgtrAttactorOptions & { object: THREE.Object3D },\n) {\n\tconst rbPosition = rigidBody.translation();\n\t_position.set(rbPosition.x, rbPosition.y, rbPosition.z);\n\n\tconst worldPosition = object.getWorldPosition(new THREE.Vector3());\n\n\tconst distance: number = worldPosition.distanceTo(_position);\n\n\tif (distance < range) {\n\t\tlet force = calcForceByType[type](strength, rigidBody.mass(), range, distance, gravitationalConstant);\n\n\t\t// Prevent wild forces when Attractors collide\n\t\tforce = force === Infinity ? strength : force;\n\n\t\t// Naively test if the rigidBody contains a collider in one of the collision groups\n\t\tlet isRigidBodyInCollisionGroup = collisionGroups === undefined;\n\t\tif (collisionGroups !== undefined) {\n\t\t\tfor (let i = 0; i < rigidBody.numColliders(); i++) {\n\t\t\t\tconst collider = rigidBody.collider(i);\n\t\t\t\tconst colliderCollisionGroups = collider.collisionGroups();\n\t\t\t\tif (\n\t\t\t\t\t((collisionGroups >> 16) & colliderCollisionGroups) != 0 &&\n\t\t\t\t\t((colliderCollisionGroups >> 16) & collisionGroups) != 0\n\t\t\t\t) {\n\t\t\t\t\tisRigidBodyInCollisionGroup = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isRigidBodyInCollisionGroup) {\n\t\t\t_vector3.set(0, 0, 0).subVectors(worldPosition, _position).normalize().multiplyScalar(force);\n\n\t\t\trigidBody.applyImpulse(_vector3, true);\n\t\t}\n\t}\n}\n\n/**\n * Type of gravity calculation for attractors.\n * - `'static'` - Constant force regardless of distance\n * - `'linear'` - Force scales linearly with distance (closer = stronger)\n * - `'newtonian'` - Force follows Newton's law of universal gravitation (inverse square)\n */\nexport type NgtrAttractorGravityType = 'static' | 'linear' | 'newtonian';\n\n/**\n * Configuration options for the attractor directive.\n */\nexport interface NgtrAttactorOptions {\n\t/**\n\t * The strength of the attractor.\n\t * Positive values attract, negative values repel.\n\t *\n\t * @defaultValue 1\n\t */\n\tstrength: number;\n\n\t/**\n\t * The range of the attractor. Will not affect objects outside of this range.\n\t *\n\t * @defaultValue 10\n\t * @min 0\n\t */\n\trange: number;\n\n\t/**\n\t * The type of gravity to use.\n\t * - static: The gravity is constant and does not change over time.\n\t * - linear: The gravity is linearly interpolated the closer the object is to the attractor.\n\t * - newtonian: The gravity is calculated using the newtonian gravity formula.\n\t * @defaultValue \"static\"\n\t */\n\ttype: NgtrAttractorGravityType;\n\n\t/**\n\t * The mass of the attractor. Used when type is `newtonian`.\n\t * @defaultValue 6.673e-11\n\t */\n\tgravitationalConstant: number;\n\n\t/**\n\t * The collision groups that this attractor will apply effects to. If a RigidBody contains one or more colliders that are in one of the mask group, it will be affected by this attractor.\n\t * If not specified, the attractor will apply effects to all RigidBodies.\n\t */\n\tcollisionGroups?: InteractionGroups;\n}\n\nconst defaultOptions: NgtrAttactorOptions = {\n\tstrength: 1,\n\trange: 10,\n\ttype: 'static',\n\tgravitationalConstant: 6.673e-11,\n};\n\n/**\n * Directive that creates a gravitational attractor point in the physics world.\n * All dynamic rigid bodies within range will be attracted (or repelled) towards this point.\n *\n * The attractor can use different gravity models:\n * - Static: constant force\n * - Linear: force increases as objects get closer\n * - Newtonian: realistic inverse-square law\n *\n * @example\n * ```html\n * <!-- Simple attractor at origin with default options -->\n * <ngt-object3D attractor />\n *\n * <!-- Attractor with custom options -->\n * <ngt-object3D [attractor]=\"{ strength: 5, range: 20 }\" />\n *\n * <!-- Repeller (negative strength) -->\n * <ngt-object3D [attractor]=\"{ strength: -10, range: 15 }\" [position]=\"[5, 0, 0]\" />\n *\n * <!-- Newtonian gravity -->\n * <ngt-object3D [attractor]=\"{\n * strength: 1000,\n * range: 50,\n * type: 'newtonian',\n * gravitationalConstant: 0.01\n * }\" />\n * ```\n */\n@Directive({\n\tselector: 'ngt-object3D[attractor]',\n\tproviders: [\n\t\t{\n\t\t\tprovide: COLLISION_GROUPS_HANDLER,\n\t\t\tuseFactory: (attractor: NgtrAttractor) => {\n\t\t\t\treturn () => (interactionGroups: InteractionGroups) => {\n\t\t\t\t\tattractor.linkedCollisionGroups.set(interactionGroups);\n\t\t\t\t};\n\t\t\t},\n\t\t\tdeps: [NgtrAttractor],\n\t\t},\n\t],\n})\nexport class NgtrAttractor {\n\tposition = input<NgtVector3>([0, 0, 0]);\n\toptions = input(defaultOptions, { alias: 'attractor', transform: mergeInputs(defaultOptions) });\n\n\tprivate objectRef = inject<ElementRef<THREE.Object3D>>(ElementRef);\n\tprivate collisionGroups = pick(this.options, 'collisionGroups');\n\tlinkedCollisionGroups = linkedSignal(this.collisionGroups);\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tapplyProps(this.objectRef.nativeElement, { position: this.position() });\n\t\t});\n\n\t\tbeforePhysicsStep((world) => {\n\t\t\tconst { strength, range, type, gravitationalConstant } = untracked(this.options);\n\t\t\tconst collisionGroups = untracked(this.linkedCollisionGroups);\n\t\t\tworld.bodies.forEach((body) => {\n\t\t\t\tif (body.isDynamic()) {\n\t\t\t\t\tapplyAttractorForceOnRigidBody(body, {\n\t\t\t\t\t\tobject: this.objectRef.nativeElement,\n\t\t\t\t\t\tstrength,\n\t\t\t\t\t\trange,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tgravitationalConstant,\n\t\t\t\t\t\tcollisionGroups,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tattractorDebug(this.objectRef.nativeElement, this.options);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAQA,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE;AAE/B;;;;;;;;;;;;AAYG;SACa,cAAc,CAAC,MAAsB,EAAE,OAAkC,EAAE,QAAmB,EAAA;AAC7G,IAAA,OAAO,cAAc,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAK;AACpD,QAAA,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC;AACnC,QAAA,MAAM,KAAK,GAAG,WAAW,EAAE;QAE3B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,OA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QAAQ,EAAE,yBAAyB;AACnC,oBAAA,SAAS,EAAE;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,wBAAwB;AACjC,4BAAA,UAAU,EAAE,CAAC,SAAwB,KAAI;AACxC,gCAAA,OAAO,MAAM,CAAC,iBAAoC,KAAI;AACrD,oCAAA,SAAS,CAAC,qBAAqB,CAAC,GAAG,CAAC,iBAAiB,CAAC;AACvD,gCAAA,CAAC;4BACF,CAAC;AACD,4BAAA,IAAI,EAAE,CAAA,aAAA,CAAe;AACrB,yBAAA;AACD,qBAAA;AACD,iBAAA;;;AClMD;;AAEG;;;;"}
1
+ {"version":3,"file":"angular-three-rapier-addons.mjs","sources":["../../../../libs/rapier/addons/src/lib/attractor-debug.ts","../../../../libs/rapier/addons/src/lib/attractor.ts","../../../../libs/rapier/addons/src/angular-three-rapier-addons.ts"],"sourcesContent":["import { computed, effect, inject, Injector } from '@angular/core';\nimport { beforeRender, injectStore, pick } from 'angular-three';\nimport { NgtrPhysics } from 'angular-three-rapier';\nimport { assertInjector } from 'ngxtension/assert-injector';\nimport * as THREE from 'three';\nimport { VertexNormalsHelper } from 'three-stdlib';\nimport { NgtrAttactorOptions } from './attractor';\n\nconst _v3 = new THREE.Vector3();\n\n/**\n * Creates debug visualization for an attractor.\n * Shows a sphere at the attractor position with normals indicating the range.\n * Blue indicates attraction, red indicates repulsion.\n *\n * This is automatically called by NgtrAttractor when physics debug mode is enabled.\n *\n * @param object - The Object3D representing the attractor position\n * @param options - Getter function for attractor options\n * @param injector - Optional injector for dependency injection context\n *\n * @internal\n */\nexport function attractorDebug(object: THREE.Object3D, options: () => NgtrAttactorOptions, injector?: Injector) {\n\treturn assertInjector(attractorDebug, injector, () => {\n\t\tconst physics = inject(NgtrPhysics);\n\t\tconst store = injectStore();\n\n\t\tconst strength = pick(options, 'strength');\n\t\tconst range = pick(options, 'range');\n\t\tconst color = computed(() => (strength() > 0 ? 0x0000ff : 0xff0000));\n\n\t\tlet mesh: THREE.Mesh;\n\t\tlet normalsHelper: VertexNormalsHelper;\n\n\t\teffect((onCleanup) => {\n\t\t\tif (!physics['debug']()) return;\n\n\t\t\tmesh = new THREE.Mesh(\n\t\t\t\tnew THREE.SphereGeometry(0.2, 6, 6),\n\t\t\t\tnew THREE.MeshBasicMaterial({ color: color(), wireframe: true }),\n\t\t\t);\n\n\t\t\tnormalsHelper = new VertexNormalsHelper(mesh, range(), color());\n\t\t\tnormalsHelper.frustumCulled = false;\n\n\t\t\tstore.snapshot.scene.add(mesh);\n\t\t\tstore.snapshot.scene.add(normalsHelper);\n\n\t\t\tonCleanup(() => {\n\t\t\t\tif (mesh) {\n\t\t\t\t\tstore.snapshot.scene.remove(mesh);\n\t\t\t\t}\n\n\t\t\t\tif (normalsHelper) {\n\t\t\t\t\tstore.snapshot.scene.remove(normalsHelper);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tbeforeRender(() => {\n\t\t\tif (!physics['debug']() || !mesh || !normalsHelper) return;\n\n\t\t\tconst worldPosition = object.getWorldPosition(_v3);\n\t\t\tmesh.position.copy(worldPosition);\n\t\t\tnormalsHelper.update();\n\t\t});\n\t});\n}\n","import { Directive, effect, ElementRef, inject, input, linkedSignal, untracked } from '@angular/core';\nimport { InteractionGroups, RigidBody } from '@dimforge/rapier3d-compat';\nimport { applyProps, NgtVector3, pick } from 'angular-three';\nimport { beforePhysicsStep, COLLISION_GROUPS_HANDLER } from 'angular-three-rapier';\nimport { mergeInputs } from 'ngxtension/inject-inputs';\nimport * as THREE from 'three';\nimport { attractorDebug } from './attractor-debug';\n\n/**\n * Force calculation functions for different gravity types.\n * - static: Constant force regardless of distance\n * - linear: Force increases linearly as distance decreases\n * - newtonian: Force follows Newton's law of universal gravitation\n */\nconst calcForceByType = {\n\tstatic: (s: number, m2: number, r: number, d: number, G: number) => s,\n\tlinear: (s: number, m2: number, r: number, d: number, G: number) => s * (d / r),\n\tnewtonian: (s: number, m2: number, r: number, d: number, G: number) => (G * s * m2) / Math.pow(d, 2),\n};\n\nconst _position = new THREE.Vector3();\nconst _vector3 = new THREE.Vector3();\n\n/**\n * Applies attractor force to a rigid body based on its distance from the attractor.\n * Used internally by NgtrAttractor but can be called manually for custom behavior.\n *\n * @param rigidBody - The rigid body to apply the force to\n * @param options - The attractor configuration including position, strength, and type\n *\n * @example\n * ```typescript\n * beforePhysicsStep((world) => {\n * world.bodies.forEach((body) => {\n * if (body.isDynamic()) {\n * applyAttractorForceOnRigidBody(body, {\n * object: attractorMesh,\n * strength: 10,\n * range: 20,\n * type: 'newtonian',\n * gravitationalConstant: 6.673e-11\n * });\n * }\n * });\n * });\n * ```\n */\nexport function applyAttractorForceOnRigidBody(\n\trigidBody: RigidBody,\n\t{\n\t\tobject,\n\t\tstrength,\n\t\trange,\n\t\tgravitationalConstant,\n\t\tcollisionGroups,\n\t\ttype,\n\t}: NgtrAttactorOptions & { object: THREE.Object3D },\n) {\n\tconst rbPosition = rigidBody.translation();\n\t_position.set(rbPosition.x, rbPosition.y, rbPosition.z);\n\n\tconst worldPosition = object.getWorldPosition(new THREE.Vector3());\n\n\tconst distance: number = worldPosition.distanceTo(_position);\n\n\tif (distance < range) {\n\t\tlet force = calcForceByType[type](strength, rigidBody.mass(), range, distance, gravitationalConstant);\n\n\t\t// Prevent wild forces when Attractors collide\n\t\tforce = force === Infinity ? strength : force;\n\n\t\t// Naively test if the rigidBody contains a collider in one of the collision groups\n\t\tlet isRigidBodyInCollisionGroup = collisionGroups === undefined;\n\t\tif (collisionGroups !== undefined) {\n\t\t\tfor (let i = 0; i < rigidBody.numColliders(); i++) {\n\t\t\t\tconst collider = rigidBody.collider(i);\n\t\t\t\tconst colliderCollisionGroups = collider.collisionGroups();\n\t\t\t\tif (\n\t\t\t\t\t((collisionGroups >> 16) & colliderCollisionGroups) != 0 &&\n\t\t\t\t\t((colliderCollisionGroups >> 16) & collisionGroups) != 0\n\t\t\t\t) {\n\t\t\t\t\tisRigidBodyInCollisionGroup = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isRigidBodyInCollisionGroup) {\n\t\t\t_vector3.set(0, 0, 0).subVectors(worldPosition, _position).normalize().multiplyScalar(force);\n\n\t\t\trigidBody.applyImpulse(_vector3, true);\n\t\t}\n\t}\n}\n\n/**\n * Type of gravity calculation for attractors.\n * - `'static'` - Constant force regardless of distance\n * - `'linear'` - Force scales linearly with distance (closer = stronger)\n * - `'newtonian'` - Force follows Newton's law of universal gravitation (inverse square)\n */\nexport type NgtrAttractorGravityType = 'static' | 'linear' | 'newtonian';\n\n/**\n * Configuration options for the attractor directive.\n */\nexport interface NgtrAttactorOptions {\n\t/**\n\t * The strength of the attractor.\n\t * Positive values attract, negative values repel.\n\t *\n\t * @defaultValue 1\n\t */\n\tstrength: number;\n\n\t/**\n\t * The range of the attractor. Will not affect objects outside of this range.\n\t *\n\t * @defaultValue 10\n\t * @min 0\n\t */\n\trange: number;\n\n\t/**\n\t * The type of gravity to use.\n\t * - static: The gravity is constant and does not change over time.\n\t * - linear: The gravity is linearly interpolated the closer the object is to the attractor.\n\t * - newtonian: The gravity is calculated using the newtonian gravity formula.\n\t * @defaultValue \"static\"\n\t */\n\ttype: NgtrAttractorGravityType;\n\n\t/**\n\t * The mass of the attractor. Used when type is `newtonian`.\n\t * @defaultValue 6.673e-11\n\t */\n\tgravitationalConstant: number;\n\n\t/**\n\t * The collision groups that this attractor will apply effects to. If a RigidBody contains one or more colliders that are in one of the mask group, it will be affected by this attractor.\n\t * If not specified, the attractor will apply effects to all RigidBodies.\n\t */\n\tcollisionGroups?: InteractionGroups;\n}\n\nconst defaultOptions: NgtrAttactorOptions = {\n\tstrength: 1,\n\trange: 10,\n\ttype: 'static',\n\tgravitationalConstant: 6.673e-11,\n};\n\n/**\n * Directive that creates a gravitational attractor point in the physics world.\n * All dynamic rigid bodies within range will be attracted (or repelled) towards this point.\n *\n * The attractor can use different gravity models:\n * - Static: constant force\n * - Linear: force increases as objects get closer\n * - Newtonian: realistic inverse-square law\n *\n * @example\n * ```html\n * <!-- Simple attractor at origin with default options -->\n * <ngt-object3D attractor />\n *\n * <!-- Attractor with custom options -->\n * <ngt-object3D [attractor]=\"{ strength: 5, range: 20 }\" />\n *\n * <!-- Repeller (negative strength) -->\n * <ngt-object3D [attractor]=\"{ strength: -10, range: 15 }\" [position]=\"[5, 0, 0]\" />\n *\n * <!-- Newtonian gravity -->\n * <ngt-object3D [attractor]=\"{\n * strength: 1000,\n * range: 50,\n * type: 'newtonian',\n * gravitationalConstant: 0.01\n * }\" />\n * ```\n */\n@Directive({\n\tselector: 'ngt-object3D[attractor]',\n\tproviders: [\n\t\t{\n\t\t\tprovide: COLLISION_GROUPS_HANDLER,\n\t\t\tuseFactory: (attractor: NgtrAttractor) => {\n\t\t\t\treturn () => (interactionGroups: InteractionGroups) => {\n\t\t\t\t\tattractor.linkedCollisionGroups.set(interactionGroups);\n\t\t\t\t};\n\t\t\t},\n\t\t\tdeps: [NgtrAttractor],\n\t\t},\n\t],\n})\nexport class NgtrAttractor {\n\tposition = input<NgtVector3>([0, 0, 0]);\n\toptions = input(defaultOptions, { alias: 'attractor', transform: mergeInputs(defaultOptions) });\n\n\tprivate objectRef = inject<ElementRef<THREE.Object3D>>(ElementRef);\n\tprivate collisionGroups = pick(this.options, 'collisionGroups');\n\tlinkedCollisionGroups = linkedSignal(this.collisionGroups);\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tapplyProps(this.objectRef.nativeElement, { position: this.position() });\n\t\t});\n\n\t\tbeforePhysicsStep((world) => {\n\t\t\tconst { strength, range, type, gravitationalConstant } = untracked(this.options);\n\t\t\tconst collisionGroups = untracked(this.linkedCollisionGroups);\n\t\t\tworld.bodies.forEach((body) => {\n\t\t\t\tif (body.isDynamic()) {\n\t\t\t\t\tapplyAttractorForceOnRigidBody(body, {\n\t\t\t\t\t\tobject: this.objectRef.nativeElement,\n\t\t\t\t\t\tstrength,\n\t\t\t\t\t\trange,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tgravitationalConstant,\n\t\t\t\t\t\tcollisionGroups,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tattractorDebug(this.objectRef.nativeElement, this.options);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAQA,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE;AAE/B;;;;;;;;;;;;AAYG;SACa,cAAc,CAAC,MAAsB,EAAE,OAAkC,EAAE,QAAmB,EAAA;AAC7G,IAAA,OAAO,cAAc,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAK;AACpD,QAAA,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC;AACnC,QAAA,MAAM,KAAK,GAAG,WAAW,EAAE;QAE3B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;QACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,EAAE,GAAG,CAAC,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;AAEpE,QAAA,IAAI,IAAgB;AACpB,QAAA,IAAI,aAAkC;AAEtC,QAAA,MAAM,CAAC,CAAC,SAAS,KAAI;AACpB,YAAA,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;gBAAE;AAEzB,YAAA,IAAI,GAAG,IAAI,KAAK,CAAC,IAAI,CACpB,IAAI,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EACnC,IAAI,KAAK,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAChE;AAED,YAAA,a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