@hology/core 0.0.181 → 0.0.182

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.
@@ -83,9 +83,12 @@ export declare class MoveOverLife extends Behaviour {
83
83
  export declare class AnimationBehavior extends Behaviour {
84
84
  private clip;
85
85
  private timeScale;
86
+ private weight;
87
+ private loop;
88
+ private clampWhenFinished;
86
89
  private mixer;
87
90
  private action;
88
- constructor(clip: THREE.AnimationClip, timeScale?: number, easing?: EasingFunction);
91
+ constructor(clip: THREE.AnimationClip, timeScale?: number, weight?: number, loop?: THREE.AnimationActionLoopStyles, clampWhenFinished?: boolean, easing?: EasingFunction);
89
92
  initialize(particle: Particle): void;
90
93
  mutate(target: Particle | Emitter, time: number, index: number): void;
91
94
  }
@@ -1,4 +1,4 @@
1
- import{Vector3 as i}from"three";import{Behaviour as t,Vector3D as e,ease as s,MathUtils as o}from"@hology/nebula";import*as n from"three";export class RotatePosition extends t{constructor(i,t){super(),this.axis=i,this.angle=t,this.axis3D=new e(this.axis.x,this.axis.y,this.axis.z)}mutate(i,t,e){this.energize(i,t),null!=i.old&&0!=i.old.position.lengthSq()&&(a.copy(i.old.position),a.sub(i.parent.position),a.applyAxisAngle(this.axis3D,this.angle*t),a.add(i.parent.position),a.sub(i.old.position).divideScalar(t),i.velocity.sub(a)),a.copy(i.position),a.sub(i.parent.position),a.applyAxisAngle(this.axis3D,this.angle*t),a.add(i.parent.position),a.sub(i.position).divideScalar(t),i.velocity.add(a)}}const a=new i;export var AxisDirection;!function(i){i[i.x=0]="x",i[i.y=1]="y",i[i.z=2]="z",i[i.mx=3]="mx",i[i.my=4]="my",i[i.mz=5]="mz"}(AxisDirection||(AxisDirection={}));export class OrientAlongVelocity extends t{constructor(i){super(),this.axisDirection=i}initialize(i){i.transform.orientAlongVelocity=!0}mutate(i,t,e){i.target,n.Object3D}}export class FollowParent extends t{constructor(i){super(),this.speed=i}initialize(i){}mutate(i,t,e){const s=i.parent.parentParticle??i.parent;if(0===this.speed)return i.position.copy(s.old.position),i.acceleration.copy(s.acceleration),void i.velocity.copy(s.velocity);const o=r.copy(s.position).sub(i.position),n=(o.length(),o.normalize());l.copy(n).multiplyScalar(this.speed),i.velocity.copy(l)}}export class Scale extends t{constructor(i,t,e){super(void 0,e),this.scaleA=i,this.scaleB=t}initialize(i){i.transform.scaleA=i.scale*this.scaleA,i.transform.scaleB=i.scale*this.scaleB,i.transform.oldRadius=i.radius}mutate(i,t,e){this.energize(i,t),i.scale=o.lerp(i.transform.scaleA,i.transform.scaleB,this.energy),i.scale<5e-4&&(i.scale=0),i.radius=i.transform.oldRadius*i.scale}}export class ScaleComponents extends t{constructor(i,t,e){super(void 0,e),this.scaleA=i,this.scaleB=t}initialize(t){let e=t.transform.initialScale;e?(e=e.clone(),t.transform.initialScale=e):(e=new i(1,1,1),t.transform.initialScale=e),t.transform.scaleComponentsA=e.clone().multiply(this.scaleA),t.transform.scaleComponentsB=e.clone().multiply(this.scaleB)}mutate(i,t,e){this.energize(i,t);const s=i.transform.scaleComponentsA,o=i.transform.scaleComponentsB;i.transform.initialScale.lerpVectors(o,s,this.energy)}}export class LinearDamping extends t{constructor(i){super(),this.factor=i}mutate(i,t,e){this.energize(i,t);const s=r.copy(i.velocity).multiplyScalar(-this.factor*t);i.velocity.add(s)}}const r=new e,l=new e;export var AxisPlane;!function(i){i[i.xy=0]="xy",i[i.xz=1]="xz",i[i.yz=2]="yz",i[i.xyz=3]="xyz"}(AxisPlane||(AxisPlane={}));export class Disperse extends t{constructor(i,t,e=s.easeLinear){super(void 0,e,void 0,!0),this.distance=i,this.plane=t}initialize(i){i.transform.initialPos=i.position.clone();const t=c.copy(i.transform.initialPos).sub(i.parent.position).normalize();switch(this.plane){case AxisPlane.xy:t.setComponent(2,0);break;case AxisPlane.xz:t.setComponent(1,0);break;case AxisPlane.yz:t.setComponent(0,0)}i.transform.displacement=t.clone().multiplyScalar(this.distance),i.transform.prevEnergy=1}mutate(i,t,e){this.energize(i,t);i.transform.initialPos;const s=i.transform.displacement,o=i.transform.prevEnergy-this.energy;i.transform.prevEnergy=this.energy;i.position.x+=s.x*o,i.position.y+=s.y*o,i.position.z+=s.z*o}}export class MoveOverLife extends t{constructor(i,t,e,o=s.easeLinear){super(void 0,o,void 0,!0),this.x=i,this.y=t,this.z=e}initialize(i){i.transform.initialPos=i.position.clone()}mutate(i,t,e){this.energize(i,t);const s=i.transform.initialPos,o=1-this.energy;i.position.x=s.x+this.x*o,i.position.y=s.y+this.y*o,i.position.z=s.z+this.z*o}}const c=new e;export class AnimationBehavior extends t{constructor(i,t=1,e=s.easeLinear){super(void 0,e,void 0,!0),this.clip=i,this.timeScale=t}initialize(i){this.mixer=null,this.action=null}mutate(i,t,e){if(this.energize(i,t),null==this.mixer){const t=i.target;t instanceof n.Object3D&&(this.mixer=new n.AnimationMixer(t.children[0]),this.action=this.mixer.clipAction(this.clip),this.action.timeScale=this.timeScale,this.action.play())}this.mixer&&this.mixer.update(t)}}/*
1
+ import{Vector3 as i}from"three";import{Behaviour as t,Vector3D as e,ease as s,MathUtils as o}from"@hology/nebula";import*as n from"three";export class RotatePosition extends t{constructor(i,t){super(),this.axis=i,this.angle=t,this.axis3D=new e(this.axis.x,this.axis.y,this.axis.z)}mutate(i,t,e){this.energize(i,t),null!=i.old&&0!=i.old.position.lengthSq()&&(a.copy(i.old.position),a.sub(i.parent.position),a.applyAxisAngle(this.axis3D,this.angle*t),a.add(i.parent.position),a.sub(i.old.position).divideScalar(t),i.velocity.sub(a)),a.copy(i.position),a.sub(i.parent.position),a.applyAxisAngle(this.axis3D,this.angle*t),a.add(i.parent.position),a.sub(i.position).divideScalar(t),i.velocity.add(a)}}const a=new i;export var AxisDirection;!function(i){i[i.x=0]="x",i[i.y=1]="y",i[i.z=2]="z",i[i.mx=3]="mx",i[i.my=4]="my",i[i.mz=5]="mz"}(AxisDirection||(AxisDirection={}));export class OrientAlongVelocity extends t{constructor(i){super(),this.axisDirection=i}initialize(i){i.transform.orientAlongVelocity=!0}mutate(i,t,e){i.target,n.Object3D}}export class FollowParent extends t{constructor(i){super(),this.speed=i}initialize(i){}mutate(i,t,e){const s=i.parent.parentParticle??i.parent;if(0===this.speed)return i.position.copy(s.old.position),i.acceleration.copy(s.acceleration),void i.velocity.copy(s.velocity);const o=r.copy(s.position).sub(i.position),n=(o.length(),o.normalize());l.copy(n).multiplyScalar(this.speed),i.velocity.copy(l)}}export class Scale extends t{constructor(i,t,e){super(void 0,e),this.scaleA=i,this.scaleB=t}initialize(i){i.transform.scaleA=i.scale*this.scaleA,i.transform.scaleB=i.scale*this.scaleB,i.transform.oldRadius=i.radius}mutate(i,t,e){this.energize(i,t),i.scale=o.lerp(i.transform.scaleA,i.transform.scaleB,this.energy),i.scale<5e-4&&(i.scale=0),i.radius=i.transform.oldRadius*i.scale}}export class ScaleComponents extends t{constructor(i,t,e){super(void 0,e),this.scaleA=i,this.scaleB=t}initialize(t){let e=t.transform.initialScale;e?(e=e.clone(),t.transform.initialScale=e):(e=new i(1,1,1),t.transform.initialScale=e),t.transform.scaleComponentsA=e.clone().multiply(this.scaleA),t.transform.scaleComponentsB=e.clone().multiply(this.scaleB)}mutate(i,t,e){this.energize(i,t);const s=i.transform.scaleComponentsA,o=i.transform.scaleComponentsB;i.transform.initialScale.lerpVectors(o,s,this.energy)}}export class LinearDamping extends t{constructor(i){super(),this.factor=i}mutate(i,t,e){this.energize(i,t);const s=r.copy(i.velocity).multiplyScalar(-this.factor*t);i.velocity.add(s)}}const r=new e,l=new e;export var AxisPlane;!function(i){i[i.xy=0]="xy",i[i.xz=1]="xz",i[i.yz=2]="yz",i[i.xyz=3]="xyz"}(AxisPlane||(AxisPlane={}));export class Disperse extends t{constructor(i,t,e=s.easeLinear){super(void 0,e,void 0,!0),this.distance=i,this.plane=t}initialize(i){i.transform.initialPos=i.position.clone();const t=c.copy(i.transform.initialPos).sub(i.parent.position).normalize();switch(this.plane){case AxisPlane.xy:t.setComponent(2,0);break;case AxisPlane.xz:t.setComponent(1,0);break;case AxisPlane.yz:t.setComponent(0,0)}i.transform.displacement=t.clone().multiplyScalar(this.distance),i.transform.prevEnergy=1}mutate(i,t,e){this.energize(i,t);i.transform.initialPos;const s=i.transform.displacement,o=i.transform.prevEnergy-this.energy;i.transform.prevEnergy=this.energy;i.position.x+=s.x*o,i.position.y+=s.y*o,i.position.z+=s.z*o}}export class MoveOverLife extends t{constructor(i,t,e,o=s.easeLinear){super(void 0,o,void 0,!0),this.x=i,this.y=t,this.z=e}initialize(i){i.transform.initialPos=i.position.clone()}mutate(i,t,e){this.energize(i,t);const s=i.transform.initialPos,o=1-this.energy;i.position.x=s.x+this.x*o,i.position.y=s.y+this.y*o,i.position.z=s.z+this.z*o}}const c=new e,p=new WeakMap;export class AnimationBehavior extends t{constructor(i,t=1,e=1,o=n.LoopOnce,a=!0,r=s.easeLinear){super(void 0,r,void 0,!0),this.clip=i,this.timeScale=t,this.weight=e,this.loop=o,this.clampWhenFinished=a}initialize(i){this.mixer?.stopAllAction(),this.mixer=null,this.action=null}mutate(i,t,e){if(this.energize(i,t),null==this.mixer){const t=i.target;if(t instanceof n.Object3D){let i=p.get(t);i?this.mixer=i:(this.mixer=new n.AnimationMixer(t.children[0]),p.set(t,this.mixer)),this.action=this.mixer.clipAction(this.clip),this.action.timeScale=this.timeScale,this.action.weight=this.weight,this.action.loop=this.loop,this.action.clampWhenFinished=this.clampWhenFinished,this.action.play()}}this.mixer&&this.mixer.update(t)}}/*
2
2
  * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -5,6 +5,7 @@ type HexColor = `#${string}`;
5
5
  export type ShapeParameterDef<T = boolean | number | string | Vector3 | Vector2 | HexColor | Curve2 | AnimationClip> = {
6
6
  type: T extends number ? 'number' : T extends HexColor ? 'color' : T extends string ? 'string' | 'select' : T extends Vector2 ? 'vec2' : T extends Vector3 ? 'vec3' : T extends Curve2 ? 'curve' : T extends AnimationClip ? 'animationclip' : T extends boolean ? 'boolean' : never;
7
7
  default: T;
8
+ requires?: Record<string, unknown>;
8
9
  };
9
10
  type FloatParameterDef = ShapeParameterDef<number> & {
10
11
  float: boolean;
@@ -283,6 +284,15 @@ declare class AnimationBehaviorDef extends BaseBevDef<AnimationBehaviorDef> {
283
284
  parameters: {
284
285
  clip: ShapeParameterDef<AnimationClip>;
285
286
  timeScale: FloatParameterDef;
287
+ weight: FloatParameterDef;
288
+ loop: SelectParameterDef<string>;
289
+ clampWhenFinished: {
290
+ requires: {
291
+ loop: string;
292
+ };
293
+ type: "boolean";
294
+ default: boolean;
295
+ };
286
296
  };
287
297
  make(params?: ParamsType<this>): Behaviour;
288
298
  }
@@ -1,4 +1,4 @@
1
- import{MathUtils as e,Vector2 as t,Vector3 as r}from"three";import{Alpha as s,Attraction as n,BoxZone as a,CircleZone as o,Color as i,ease as c,Force as u,Gravity as m,Life as d,LineZone as p,Mass as l,Position as w,RadialVelocity as x,RandomDrift as f,Repulsion as h,Rotate as y,Vector3D as g}from"@hology/nebula";import{AnimationBehavior as k,AxisDirection as b,AxisPlane as v,Disperse as z,FollowParent as R,LinearDamping as T,MoveOverLife as L,OrientAlongVelocity as V,RotatePosition as j,Scale as D,ScaleComponents as C}from"./behaviours.js";import{AdditiveVelocity as B,InitialScale as S,InitialScaleComponents as I,RandomDirection as O,RandomRotation as A,randomRotationAxis as K,RandomScale as P,Rotation as Y}from"./initializsers.js";import{PointZone as M,SphereZone as X}from"./zones.js";import{WorldCollisionBehaviour as Z}from"./vfx-collision-behaviour.js";import{Curve2 as q}from"../../utils/curve.js";class E{build(e={}){const t=U(e,this.parameters);return this.make(t)}}class F{build(e={}){const t=U(e,this.parameters);return this.make(t)}}function G(e,t,r){return{type:"number",default:e,float:!0,min:t,max:r}}function H(e){return{type:"vec3",default:(new r).fromArray(e)}}function J(e){return{type:"color",default:e}}function N(e,t){return{type:"select",opts:e,default:t}}function Q(){return{type:"curve",default:q.linear()}}function U(e,t){const r={};for(let s in t)null==e[s]?r[s]=t[s].default:r[s]=e[s];return r}function W(e){return t=>e.getY(t)}const $={lifetime:new class extends F{constructor(){super(...arguments),this.parameters={duration:G(1,0,1e5)}}make(e={}){return new d(e.duration)}},randomLifetime:new class extends F{constructor(){super(...arguments),this.parameters={minDuration:G(1,0,1e5),maxDuration:G(2,0,1e5)}}make(e={}){return new d(e.minDuration,e.maxDuration)}},positionPoint:new class extends F{constructor(){super(...arguments),this.parameters={position:H([0,0,0])}}make(e={}){const{x:t,y:r,z:s}=e.position;return new w(new M(t,r,s))}},positionBox:new class extends F{constructor(){super(...arguments),this.parameters={position:H([0,0,0]),dimensions:H([0,0,0])}}make(e={}){const{x:t,y:r,z:s}=e.position,{x:n,y:o,z:i}=e.dimensions;return new w(new a(t,r,s,n,o,i))}},positionSphere:new class extends F{constructor(){super(...arguments),this.parameters={position:H([0,0,0]),radius:G(1)}}make(e={}){const{x:t,y:r,z:s}=e.position;return new w(new X(t,r,s,e.radius))}},positionLine:new class extends F{constructor(){super(...arguments),this.parameters={a:H([0,0,0]),b:H([0,0,1])}}make(e={}){const{x:t,y:r,z:s}=e.a,{x:n,y:a,z:o}=e.b;return new w(new p(t,r,s,n,a,o))}},positionCircle:new class extends F{constructor(){super(...arguments),this.parameters={position:H([0,0,0]),rotation:H([0,0,0]),radius:G(1,0,1e4)}}make(t={}){const{x:r,y:s,z:n}=t.position,{x:a,y:i,z:c}=t.rotation;return new w(new o(r,s,n,t.radius,0,e.degToRad(a),e.degToRad(i),e.degToRad(c)))}},positionRing:new class extends F{constructor(){super(...arguments),this.parameters={position:H([0,0,0]),rotation:H([0,0,0]),radius:G(1,0,1e4),thickness:G(.2,0,1e4)}}make(t={}){const{x:r,y:s,z:n}=t.position,{x:a,y:i,z:c}=t.rotation;return new w(new o(r,s,n,t.radius,Math.max(t.thickness,1e-4),e.degToRad(a),e.degToRad(i),e.degToRad(c)))}},rotation:new class extends F{constructor(){super(...arguments),this.parameters={rotation:H([0,0,0])}}make(t={}){const{x:s,y:n,z:a}=t.rotation;return new Y(new r(e.degToRad(s),e.degToRad(n),e.degToRad(a)))}},randomRotation:new class extends F{constructor(){super(...arguments),this.parameters={axis:N(K,"XYZ")}}make(e={}){return new A(e.axis)}},scale:new class extends F{constructor(){super(...arguments),this.parameters={scale:G(1)}}make(e={}){return new S(e.scale)}},scaleComponents:new class extends F{constructor(){super(...arguments),this.parameters={scale:H([1,1,1])}}make(e={}){return new I(e.scale)}},randomScale:new class extends F{constructor(){super(...arguments),this.parameters={min:G(1),max:G(1)}}make(e={}){return new P(e.min,e.max)}},mass:new class extends F{constructor(){super(...arguments),this.parameters={min:G(1)}}make(e={}){return new l(e.min)}},velocity:new class extends F{constructor(){super(...arguments),this.parameters={velocity:H([0,0,0])}}make(e={}){const{x:t,y:s,z:n}=e.velocity;return new B(new r(t,s,n))}},randomVelocity:new class extends F{constructor(){super(...arguments),this.parameters={min:H([0,0,0]),max:H([0,0,0])}}make(e={}){return new B(e.min,e.max)}},radialVelocity:new class extends F{constructor(){super(...arguments),this.parameters={speed:G(1),direction:H([0,1,0]),spread:G(0)}}make(e={}){return new x(e.speed,new g(e.direction.x,e.direction.y,e.direction.z),e.spread)}},randomDirection:new class extends F{constructor(){super(...arguments),this.parameters={speed:G(1)}}make(e={}){return new O(e.speed)}}},_={force:new class extends E{constructor(){super(...arguments),this.parameters={force:H([0,0,0]),ease:Q()}}make(e={}){return new u(e.force.x,e.force.y,e.force.z,void 0,W(e.ease))}},gravity:new class extends E{constructor(){super(...arguments),this.parameters={gravity:G(8),easing:Q()}}make(e={}){return new m(e.gravity,void 0,W(e.easing))}},repulsion:new class extends E{constructor(){super(...arguments),this.parameters={target:H([0,0,0]),force:G(1),radius:G(1),easing:Q()}}make(e={}){const t=new g(e.target.x,e.target.y,e.target.z);return new h(t,e.force,e.radius,void 0,W(e.easing))}},attraction:new class extends E{constructor(){super(...arguments),this.parameters={target:H([0,0,0]),force:G(1),radius:G(1),easing:Q()}}make(e={}){const t=new g(e.target.x,e.target.y,e.target.z);return new n(t,e.force,e.radius,void 0,W(e.easing))}},scale:new class extends E{constructor(){super(...arguments),this.parameters={a:G(1),b:G(1),ease:Q()}}make(e={}){return new D(e.a,e.b,W(e.ease))}},scaleComponents:new class extends E{constructor(){super(...arguments),this.parameters={a:H([1,1,1]),b:H([1,1,1]),ease:Q()}}make(e={}){return new C(e.a,e.b,W(e.ease))}},randomDrift:new class extends E{constructor(){super(...arguments),this.parameters={drift:H([1,1,1]),delay:G(0),ease:Q()}}make(e={}){return new f(e.drift.x,e.drift.y,e.drift.z,e.delay,void 0,W(e.ease))}},rotate:new class extends E{constructor(){super(...arguments),this.parameters={rotation:H([0,0,0]),ease:Q()}}make(t={}){const{x:r,y:s,z:n}=t.rotation;return new y(e.degToRad(r),e.degToRad(s),e.degToRad(n),void 0,W(t.ease))}},rotateAdd:new class extends E{constructor(){super(...arguments),this.parameters={rotation:H([0,0,0])}}make(t={}){const{x:r,y:s,z:n}=t.rotation,a=new y(e.degToRad(r),e.degToRad(s),e.degToRad(n),void 0);return a.rotationType="add",a}},changeColor:new class extends E{constructor(){super(...arguments),this.parameters={a:J("#ffffff"),b:J("#ffffff"),ease:Q()}}make(e={}){return new i(e.a,e.b,void 0,W(e.ease))}},changeOpacity:new class extends E{constructor(){super(...arguments),this.parameters={a:G(1,0,1),b:G(0,0,1),ease:Q()}}make(e={}){return new s(e.a,e.b,void 0,W(e.ease))}},vortex:new class extends E{constructor(){super(...arguments),this.parameters={axis:H([0,1,0]),amount:G(1)}}make(e={}){return new j(e.axis,e.amount)}},moveTo:new class extends E{constructor(){super(...arguments),this.parameters={target:H([0,1,0]),ease:Q()}}make(e={}){return new L(e.target.x,e.target.y,e.target.z,W(e.ease))}},linearDamping:new class extends E{constructor(){super(...arguments),this.parameters={factor:G(.1,0,1e3)}}make(e={}){return new T(e.factor)}},followParent:new class extends E{constructor(){super(...arguments),this.parameters={speed:G(0)}}make(e={}){return new R(e.speed)}},worldCollision:new class extends E{constructor(){super(...arguments),this.parameters={friction:G(1,0,1),bounce:G(1,0,1),lifeLoss:G(0,0)}}make(e={}){return new Z(null,e.bounce,e.friction,e.lifeLoss)}},animation:new class extends E{constructor(){super(...arguments),this.parameters={clip:{type:"animationclip",default:null},timeScale:G(1)}}make(e={}){return new k(e.clip,e.timeScale,c.easeLinear)}}};export const VfxInitializserLibrary=$;export const VfxInitializserLibraryKeys=Object.keys(VfxInitializserLibrary);export const VfxBehaviourLibrary=_;export const VfxBehaviourLibraryKeys=Object.keys(VfxBehaviourLibrary);/*
1
+ import{LoopOnce as e,LoopPingPong as t,LoopRepeat as r,MathUtils as s,Vector2 as n,Vector3 as a}from"three";import{Alpha as o,Attraction as i,BoxZone as c,CircleZone as u,Color as p,ease as d,Force as m,Gravity as l,Life as w,LineZone as x,Mass as f,Position as h,RadialVelocity as y,RandomDrift as g,Repulsion as k,Rotate as b,Vector3D as v}from"@hology/nebula";import{AnimationBehavior as z,AxisDirection as R,AxisPlane as T,Disperse as L,FollowParent as V,LinearDamping as j,MoveOverLife as D,OrientAlongVelocity as C,RotatePosition as O,Scale as P,ScaleComponents as B}from"./behaviours.js";import{AdditiveVelocity as S,InitialScale as I,InitialScaleComponents as A,RandomDirection as F,RandomRotation as K,randomRotationAxis as W,RandomScale as Y,Rotation as q}from"./initializsers.js";import{PointZone as M,SphereZone as X}from"./zones.js";import{WorldCollisionBehaviour as Z}from"./vfx-collision-behaviour.js";import{Curve2 as E}from"../../utils/curve.js";class G{build(e={}){const t=_(e,this.parameters);return this.make(t)}}class H{build(e={}){const t=_(e,this.parameters);return this.make(t)}}function J(e,t,r){return{type:"number",default:e,float:!0,min:t,max:r}}function N(e){return{type:"vec3",default:(new a).fromArray(e)}}function Q(e){return{type:"color",default:e}}function U(e,t){return{type:"select",opts:e,default:t}}function $(){return{type:"curve",default:E.linear()}}function _(e,t){const r={};for(let s in t)null==e[s]?r[s]=t[s].default:r[s]=e[s];return r}function ee(e){return t=>e.getY(t)}const te={lifetime:new class extends H{constructor(){super(...arguments),this.parameters={duration:J(1,0,1e5)}}make(e={}){return new w(e.duration)}},randomLifetime:new class extends H{constructor(){super(...arguments),this.parameters={minDuration:J(1,0,1e5),maxDuration:J(2,0,1e5)}}make(e={}){return new w(e.minDuration,e.maxDuration)}},positionPoint:new class extends H{constructor(){super(...arguments),this.parameters={position:N([0,0,0])}}make(e={}){const{x:t,y:r,z:s}=e.position;return new h(new M(t,r,s))}},positionBox:new class extends H{constructor(){super(...arguments),this.parameters={position:N([0,0,0]),dimensions:N([0,0,0])}}make(e={}){const{x:t,y:r,z:s}=e.position,{x:n,y:a,z:o}=e.dimensions;return new h(new c(t,r,s,n,a,o))}},positionSphere:new class extends H{constructor(){super(...arguments),this.parameters={position:N([0,0,0]),radius:J(1)}}make(e={}){const{x:t,y:r,z:s}=e.position;return new h(new X(t,r,s,e.radius))}},positionLine:new class extends H{constructor(){super(...arguments),this.parameters={a:N([0,0,0]),b:N([0,0,1])}}make(e={}){const{x:t,y:r,z:s}=e.a,{x:n,y:a,z:o}=e.b;return new h(new x(t,r,s,n,a,o))}},positionCircle:new class extends H{constructor(){super(...arguments),this.parameters={position:N([0,0,0]),rotation:N([0,0,0]),radius:J(1,0,1e4)}}make(e={}){const{x:t,y:r,z:n}=e.position,{x:a,y:o,z:i}=e.rotation;return new h(new u(t,r,n,e.radius,0,s.degToRad(a),s.degToRad(o),s.degToRad(i)))}},positionRing:new class extends H{constructor(){super(...arguments),this.parameters={position:N([0,0,0]),rotation:N([0,0,0]),radius:J(1,0,1e4),thickness:J(.2,0,1e4)}}make(e={}){const{x:t,y:r,z:n}=e.position,{x:a,y:o,z:i}=e.rotation;return new h(new u(t,r,n,e.radius,Math.max(e.thickness,1e-4),s.degToRad(a),s.degToRad(o),s.degToRad(i)))}},rotation:new class extends H{constructor(){super(...arguments),this.parameters={rotation:N([0,0,0])}}make(e={}){const{x:t,y:r,z:n}=e.rotation;return new q(new a(s.degToRad(t),s.degToRad(r),s.degToRad(n)))}},randomRotation:new class extends H{constructor(){super(...arguments),this.parameters={axis:U(W,"XYZ")}}make(e={}){return new K(e.axis)}},scale:new class extends H{constructor(){super(...arguments),this.parameters={scale:J(1)}}make(e={}){return new I(e.scale)}},scaleComponents:new class extends H{constructor(){super(...arguments),this.parameters={scale:N([1,1,1])}}make(e={}){return new A(e.scale)}},randomScale:new class extends H{constructor(){super(...arguments),this.parameters={min:J(1),max:J(1)}}make(e={}){return new Y(e.min,e.max)}},mass:new class extends H{constructor(){super(...arguments),this.parameters={min:J(1)}}make(e={}){return new f(e.min)}},velocity:new class extends H{constructor(){super(...arguments),this.parameters={velocity:N([0,0,0])}}make(e={}){const{x:t,y:r,z:s}=e.velocity;return new S(new a(t,r,s))}},randomVelocity:new class extends H{constructor(){super(...arguments),this.parameters={min:N([0,0,0]),max:N([0,0,0])}}make(e={}){return new S(e.min,e.max)}},radialVelocity:new class extends H{constructor(){super(...arguments),this.parameters={speed:J(1),direction:N([0,1,0]),spread:J(0)}}make(e={}){return new y(e.speed,new v(e.direction.x,e.direction.y,e.direction.z),e.spread)}},randomDirection:new class extends H{constructor(){super(...arguments),this.parameters={speed:J(1)}}make(e={}){return new F(e.speed)}}},re={force:new class extends G{constructor(){super(...arguments),this.parameters={force:N([0,0,0]),ease:$()}}make(e={}){return new m(e.force.x,e.force.y,e.force.z,void 0,ee(e.ease))}},gravity:new class extends G{constructor(){super(...arguments),this.parameters={gravity:J(8),easing:$()}}make(e={}){return new l(e.gravity,void 0,ee(e.easing))}},repulsion:new class extends G{constructor(){super(...arguments),this.parameters={target:N([0,0,0]),force:J(1),radius:J(1),easing:$()}}make(e={}){const t=new v(e.target.x,e.target.y,e.target.z);return new k(t,e.force,e.radius,void 0,ee(e.easing))}},attraction:new class extends G{constructor(){super(...arguments),this.parameters={target:N([0,0,0]),force:J(1),radius:J(1),easing:$()}}make(e={}){const t=new v(e.target.x,e.target.y,e.target.z);return new i(t,e.force,e.radius,void 0,ee(e.easing))}},scale:new class extends G{constructor(){super(...arguments),this.parameters={a:J(1),b:J(1),ease:$()}}make(e={}){return new P(e.a,e.b,ee(e.ease))}},scaleComponents:new class extends G{constructor(){super(...arguments),this.parameters={a:N([1,1,1]),b:N([1,1,1]),ease:$()}}make(e={}){return new B(e.a,e.b,ee(e.ease))}},randomDrift:new class extends G{constructor(){super(...arguments),this.parameters={drift:N([1,1,1]),delay:J(0),ease:$()}}make(e={}){return new g(e.drift.x,e.drift.y,e.drift.z,e.delay,void 0,ee(e.ease))}},rotate:new class extends G{constructor(){super(...arguments),this.parameters={rotation:N([0,0,0]),ease:$()}}make(e={}){const{x:t,y:r,z:n}=e.rotation;return new b(s.degToRad(t),s.degToRad(r),s.degToRad(n),void 0,ee(e.ease))}},rotateAdd:new class extends G{constructor(){super(...arguments),this.parameters={rotation:N([0,0,0])}}make(e={}){const{x:t,y:r,z:n}=e.rotation,a=new b(s.degToRad(t),s.degToRad(r),s.degToRad(n),void 0);return a.rotationType="add",a}},changeColor:new class extends G{constructor(){super(...arguments),this.parameters={a:Q("#ffffff"),b:Q("#ffffff"),ease:$()}}make(e={}){return new p(e.a,e.b,void 0,ee(e.ease))}},changeOpacity:new class extends G{constructor(){super(...arguments),this.parameters={a:J(1,0,1),b:J(0,0,1),ease:$()}}make(e={}){return new o(e.a,e.b,void 0,ee(e.ease))}},vortex:new class extends G{constructor(){super(...arguments),this.parameters={axis:N([0,1,0]),amount:J(1)}}make(e={}){return new O(e.axis,e.amount)}},moveTo:new class extends G{constructor(){super(...arguments),this.parameters={target:N([0,1,0]),ease:$()}}make(e={}){return new D(e.target.x,e.target.y,e.target.z,ee(e.ease))}},linearDamping:new class extends G{constructor(){super(...arguments),this.parameters={factor:J(.1,0,1e3)}}make(e={}){return new j(e.factor)}},followParent:new class extends G{constructor(){super(...arguments),this.parameters={speed:J(0)}}make(e={}){return new V(e.speed)}},worldCollision:new class extends G{constructor(){super(...arguments),this.parameters={friction:J(1,0,1),bounce:J(1,0,1),lifeLoss:J(0,0)}}make(e={}){return new Z(null,e.bounce,e.friction,e.lifeLoss)}},animation:new class extends G{constructor(){var e;super(...arguments),this.parameters={clip:{type:"animationclip",default:null},timeScale:J(1,0,10),weight:J(1,0,1),loop:U(["Once","Repeat","PingPong"],"Once"),clampWhenFinished:{...(e=!0,{type:"boolean",default:e}),requires:{loop:"Once"}}}}make(s={}){let n=e;return"Repeat"===s.loop?n=r:"PingPong"===s.loop&&(n=t),new z(s.clip,s.timeScale,s.weight,n,s.clampWhenFinished,d.easeLinear)}}};export const VfxInitializserLibrary=te;export const VfxInitializserLibraryKeys=Object.keys(VfxInitializserLibrary);export const VfxBehaviourLibrary=re;export const VfxBehaviourLibraryKeys=Object.keys(VfxBehaviourLibrary);/*
2
2
  * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hology/core",
3
- "version": "0.0.181",
3
+ "version": "0.0.182",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",