three-nebula 10.0.3 → 11.1.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/.claude/rules/no-coauthor.md +4 -0
- package/CHANGELOG.md +33 -0
- package/dist/three-nebula.cjs +109 -0
- package/dist/three-nebula.cjs.map +1 -0
- package/dist/three-nebula.mjs +2968 -0
- package/dist/three-nebula.mjs.map +1 -0
- package/dist/three-nebula.umd.js +109 -0
- package/dist/three-nebula.umd.js.map +1 -0
- package/package.json +32 -56
- package/specs/01-emitter-hierarchy.md +200 -0
- package/specs/02-determinism-scrubbing.md +188 -0
- package/specs/03-sound-renderer.md +183 -0
- package/specs/04-schema-versioning.md +140 -0
- package/specs/05-content-addressed-assets.md +288 -0
- package/specs/README.md +80 -0
- package/build/cjs/behaviour/Alpha.js +0 -189
- package/build/cjs/behaviour/Attraction.js +0 -189
- package/build/cjs/behaviour/Behaviour.js +0 -253
- package/build/cjs/behaviour/Collision.js +0 -146
- package/build/cjs/behaviour/Color.js +0 -148
- package/build/cjs/behaviour/CrossZone.js +0 -141
- package/build/cjs/behaviour/Force.js +0 -126
- package/build/cjs/behaviour/Gravity.js +0 -78
- package/build/cjs/behaviour/RandomDrift.js +0 -153
- package/build/cjs/behaviour/Repulsion.js +0 -123
- package/build/cjs/behaviour/Rotate.js +0 -265
- package/build/cjs/behaviour/Scale.js +0 -177
- package/build/cjs/behaviour/Spring.js +0 -133
- package/build/cjs/behaviour/constants.js +0 -28
- package/build/cjs/behaviour/index.js +0 -112
- package/build/cjs/behaviour/types.js +0 -33
- package/build/cjs/constants/index.js +0 -61
- package/build/cjs/core/Particle.js +0 -390
- package/build/cjs/core/Pool.js +0 -203
- package/build/cjs/core/System.js +0 -366
- package/build/cjs/core/constants.js +0 -163
- package/build/cjs/core/fromJSON.js +0 -128
- package/build/cjs/core/fromJSONAsync.js +0 -239
- package/build/cjs/core/index.js +0 -32
- package/build/cjs/core/three/Euler.js +0 -233
- package/build/cjs/core/three/Math.js +0 -91
- package/build/cjs/core/three/Matrix4.js +0 -745
- package/build/cjs/core/three/Quaternion.js +0 -451
- package/build/cjs/core/three/Vector3.js +0 -464
- package/build/cjs/core/three/constants.js +0 -298
- package/build/cjs/core/three/index.js +0 -48
- package/build/cjs/core/types.js +0 -13
- package/build/cjs/debug/Debug.js +0 -209
- package/build/cjs/debug/constants.js +0 -19
- package/build/cjs/debug/index.js +0 -24
- package/build/cjs/debug/log.js +0 -38
- package/build/cjs/ease/index.js +0 -149
- package/build/cjs/emitter/Emitter.js +0 -791
- package/build/cjs/emitter/FollowEmitter.js +0 -146
- package/build/cjs/emitter/constants.js +0 -20
- package/build/cjs/emitter/index.js +0 -24
- package/build/cjs/emitter/types.js +0 -11
- package/build/cjs/events/EventDispatcher.js +0 -105
- package/build/cjs/events/constants.js +0 -23
- package/build/cjs/events/index.js +0 -27
- package/build/cjs/index.js +0 -151
- package/build/cjs/initializer/Body.js +0 -122
- package/build/cjs/initializer/BodySprite.js +0 -146
- package/build/cjs/initializer/Initializer.js +0 -109
- package/build/cjs/initializer/InitializerUtil.js +0 -54
- package/build/cjs/initializer/Life.js +0 -106
- package/build/cjs/initializer/Mass.js +0 -101
- package/build/cjs/initializer/Position.js +0 -152
- package/build/cjs/initializer/Radius.js +0 -118
- package/build/cjs/initializer/Rate.js +0 -150
- package/build/cjs/initializer/Texture.js +0 -139
- package/build/cjs/initializer/Velocity/PolarVelocity.js +0 -102
- package/build/cjs/initializer/Velocity/RadialVelocity.js +0 -111
- package/build/cjs/initializer/Velocity/VectorVelocity.js +0 -108
- package/build/cjs/initializer/Velocity/Velocity.js +0 -94
- package/build/cjs/initializer/Velocity/index.js +0 -32
- package/build/cjs/initializer/constants.js +0 -43
- package/build/cjs/initializer/index.js +0 -100
- package/build/cjs/initializer/types.js +0 -35
- package/build/cjs/math/ArraySpan.js +0 -103
- package/build/cjs/math/Box.js +0 -46
- package/build/cjs/math/ColorSpan.js +0 -113
- package/build/cjs/math/MathUtils.js +0 -57
- package/build/cjs/math/Polar3D.js +0 -115
- package/build/cjs/math/Span.js +0 -88
- package/build/cjs/math/Vector3D.js +0 -76
- package/build/cjs/math/constants.js +0 -35
- package/build/cjs/math/index.js +0 -122
- package/build/cjs/math/integration.js +0 -59
- package/build/cjs/math/types.js +0 -19
- package/build/cjs/renderer/BaseRenderer.js +0 -108
- package/build/cjs/renderer/CustomRenderer.js +0 -65
- package/build/cjs/renderer/GPURenderer/Desktop/index.js +0 -350
- package/build/cjs/renderer/GPURenderer/Desktop/shaders/fragmentShader.js +0 -13
- package/build/cjs/renderer/GPURenderer/Desktop/shaders/index.js +0 -22
- package/build/cjs/renderer/GPURenderer/Desktop/shaders/vertexShader.js +0 -17
- package/build/cjs/renderer/GPURenderer/Mobile/index.js +0 -364
- package/build/cjs/renderer/GPURenderer/Mobile/shaders/fragmentShader.js +0 -13
- package/build/cjs/renderer/GPURenderer/Mobile/shaders/index.js +0 -22
- package/build/cjs/renderer/GPURenderer/Mobile/shaders/vertexShader.js +0 -15
- package/build/cjs/renderer/GPURenderer/common/ParticleBuffer/constants.js +0 -53
- package/build/cjs/renderer/GPURenderer/common/ParticleBuffer/index.js +0 -93
- package/build/cjs/renderer/GPURenderer/common/TextureAtlas/constants.js +0 -9
- package/build/cjs/renderer/GPURenderer/common/TextureAtlas/index.js +0 -221
- package/build/cjs/renderer/GPURenderer/common/constants.js +0 -22
- package/build/cjs/renderer/GPURenderer/common/index.js +0 -38
- package/build/cjs/renderer/GPURenderer/common/shaders/constants.js +0 -9
- package/build/cjs/renderer/GPURenderer/common/stores/Target.js +0 -43
- package/build/cjs/renderer/GPURenderer/common/stores/UniqueList.js +0 -51
- package/build/cjs/renderer/GPURenderer/common/stores/index.js +0 -22
- package/build/cjs/renderer/GPURenderer/index.js +0 -97
- package/build/cjs/renderer/MeshRenderer.js +0 -136
- package/build/cjs/renderer/SpriteRenderer.js +0 -63
- package/build/cjs/renderer/index.js +0 -40
- package/build/cjs/renderer/types.js +0 -21
- package/build/cjs/utils/ColorUtil.js +0 -39
- package/build/cjs/utils/PUID.js +0 -26
- package/build/cjs/utils/THREEUtil.js +0 -40
- package/build/cjs/utils/Util.js +0 -69
- package/build/cjs/utils/index.js +0 -61
- package/build/cjs/utils/uid.js +0 -14
- package/build/cjs/zone/BoxZone.js +0 -178
- package/build/cjs/zone/LineZone.js +0 -101
- package/build/cjs/zone/MeshZone.js +0 -101
- package/build/cjs/zone/PointZone.js +0 -99
- package/build/cjs/zone/ScreenZone.js +0 -164
- package/build/cjs/zone/SphereZone.js +0 -155
- package/build/cjs/zone/Zone.js +0 -172
- package/build/cjs/zone/index.js +0 -56
- package/build/cjs/zone/types.js +0 -21
- package/build/esm/behaviour/Alpha.js +0 -134
- package/build/esm/behaviour/Attraction.js +0 -135
- package/build/esm/behaviour/Behaviour.js +0 -215
- package/build/esm/behaviour/Collision.js +0 -100
- package/build/esm/behaviour/Color.js +0 -101
- package/build/esm/behaviour/CrossZone.js +0 -82
- package/build/esm/behaviour/Force.js +0 -83
- package/build/esm/behaviour/Gravity.js +0 -40
- package/build/esm/behaviour/RandomDrift.js +0 -97
- package/build/esm/behaviour/Repulsion.js +0 -81
- package/build/esm/behaviour/Rotate.js +0 -214
- package/build/esm/behaviour/Scale.js +0 -131
- package/build/esm/behaviour/Spring.js +0 -90
- package/build/esm/behaviour/constants.js +0 -11
- package/build/esm/behaviour/index.js +0 -14
- package/build/esm/behaviour/types.js +0 -14
- package/build/esm/constants/index.js +0 -42
- package/build/esm/core/Particle.js +0 -357
- package/build/esm/core/Pool.js +0 -161
- package/build/esm/core/System.js +0 -320
- package/build/esm/core/constants.js +0 -127
- package/build/esm/core/fromJSON.js +0 -107
- package/build/esm/core/fromJSONAsync.js +0 -210
- package/build/esm/core/index.js +0 -4
- package/build/esm/core/three/Euler.js +0 -224
- package/build/esm/core/three/Math.js +0 -84
- package/build/esm/core/three/Matrix4.js +0 -739
- package/build/esm/core/three/Quaternion.js +0 -445
- package/build/esm/core/three/Vector3.js +0 -457
- package/build/esm/core/three/constants.js +0 -148
- package/build/esm/core/three/index.js +0 -5
- package/build/esm/core/types.js +0 -4
- package/build/esm/debug/Debug.js +0 -195
- package/build/esm/debug/constants.js +0 -7
- package/build/esm/debug/index.js +0 -3
- package/build/esm/debug/log.js +0 -31
- package/build/esm/ease/index.js +0 -113
- package/build/esm/emitter/Emitter.js +0 -701
- package/build/esm/emitter/FollowEmitter.js +0 -97
- package/build/esm/emitter/constants.js +0 -7
- package/build/esm/emitter/index.js +0 -3
- package/build/esm/emitter/types.js +0 -3
- package/build/esm/events/EventDispatcher.js +0 -82
- package/build/esm/events/constants.js +0 -9
- package/build/esm/events/index.js +0 -4
- package/build/esm/index.js +0 -13
- package/build/esm/initializer/Body.js +0 -83
- package/build/esm/initializer/BodySprite.js +0 -108
- package/build/esm/initializer/Initializer.js +0 -84
- package/build/esm/initializer/InitializerUtil.js +0 -48
- package/build/esm/initializer/Life.js +0 -66
- package/build/esm/initializer/Mass.js +0 -60
- package/build/esm/initializer/Position.js +0 -98
- package/build/esm/initializer/Radius.js +0 -75
- package/build/esm/initializer/Rate.js +0 -107
- package/build/esm/initializer/Texture.js +0 -101
- package/build/esm/initializer/Velocity/PolarVelocity.js +0 -63
- package/build/esm/initializer/Velocity/RadialVelocity.js +0 -72
- package/build/esm/initializer/Velocity/VectorVelocity.js +0 -69
- package/build/esm/initializer/Velocity/Velocity.js +0 -52
- package/build/esm/initializer/Velocity/index.js +0 -4
- package/build/esm/initializer/constants.js +0 -26
- package/build/esm/initializer/index.js +0 -11
- package/build/esm/initializer/types.js +0 -15
- package/build/esm/math/ArraySpan.js +0 -62
- package/build/esm/math/Box.js +0 -25
- package/build/esm/math/ColorSpan.js +0 -71
- package/build/esm/math/MathUtils.js +0 -48
- package/build/esm/math/Polar3D.js +0 -81
- package/build/esm/math/Span.js +0 -63
- package/build/esm/math/Vector3D.js +0 -34
- package/build/esm/math/constants.js +0 -24
- package/build/esm/math/index.js +0 -10
- package/build/esm/math/integration.js +0 -47
- package/build/esm/math/types.js +0 -7
- package/build/esm/renderer/BaseRenderer.js +0 -78
- package/build/esm/renderer/CustomRenderer.js +0 -23
- package/build/esm/renderer/GPURenderer/Desktop/index.js +0 -331
- package/build/esm/renderer/GPURenderer/Desktop/shaders/fragmentShader.js +0 -23
- package/build/esm/renderer/GPURenderer/Desktop/shaders/index.js +0 -3
- package/build/esm/renderer/GPURenderer/Desktop/shaders/vertexShader.js +0 -33
- package/build/esm/renderer/GPURenderer/Mobile/index.js +0 -349
- package/build/esm/renderer/GPURenderer/Mobile/shaders/fragmentShader.js +0 -20
- package/build/esm/renderer/GPURenderer/Mobile/shaders/index.js +0 -3
- package/build/esm/renderer/GPURenderer/Mobile/shaders/vertexShader.js +0 -30
- package/build/esm/renderer/GPURenderer/common/ParticleBuffer/constants.js +0 -27
- package/build/esm/renderer/GPURenderer/common/ParticleBuffer/index.js +0 -70
- package/build/esm/renderer/GPURenderer/common/TextureAtlas/constants.js +0 -2
- package/build/esm/renderer/GPURenderer/common/TextureAtlas/index.js +0 -206
- package/build/esm/renderer/GPURenderer/common/constants.js +0 -13
- package/build/esm/renderer/GPURenderer/common/index.js +0 -4
- package/build/esm/renderer/GPURenderer/common/shaders/constants.js +0 -2
- package/build/esm/renderer/GPURenderer/common/stores/Target.js +0 -24
- package/build/esm/renderer/GPURenderer/common/stores/UniqueList.js +0 -29
- package/build/esm/renderer/GPURenderer/common/stores/index.js +0 -3
- package/build/esm/renderer/GPURenderer/index.js +0 -57
- package/build/esm/renderer/MeshRenderer.js +0 -94
- package/build/esm/renderer/SpriteRenderer.js +0 -26
- package/build/esm/renderer/index.js +0 -5
- package/build/esm/renderer/types.js +0 -8
- package/build/esm/utils/ColorUtil.js +0 -32
- package/build/esm/utils/PUID.js +0 -19
- package/build/esm/utils/THREEUtil.js +0 -31
- package/build/esm/utils/Util.js +0 -60
- package/build/esm/utils/index.js +0 -13
- package/build/esm/utils/uid.js +0 -3
- package/build/esm/zone/BoxZone.js +0 -133
- package/build/esm/zone/LineZone.js +0 -61
- package/build/esm/zone/MeshZone.js +0 -60
- package/build/esm/zone/PointZone.js +0 -59
- package/build/esm/zone/ScreenZone.js +0 -116
- package/build/esm/zone/SphereZone.js +0 -113
- package/build/esm/zone/Zone.js +0 -141
- package/build/esm/zone/index.js +0 -7
- package/build/esm/zone/types.js +0 -8
- package/build/three-nebula.js +0 -2
- package/build/three-nebula.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"three-nebula.mjs","names":["DEFAULT_LIFE","uid","type","Util","MathUtils","type","type","MathUtils","type","uid","type","DEFAULT_LIFE","type","PUID","type","type","type","type","type","Util","MathUtils","type","type","type","Util","type","THREEUtil","type","Util","type","Zone","type","type","type","type","type","type","type","type","uid","EventDispatcher","uid","type","MathUtils","type","type","type","ColorUtil","MathUtils","type","Zone","type","type","type","MathUtils","type","type","MathUtils","type","MathUtils","type","makeRate","makeInitializers","Initializer","makeBehaviours","Behaviour","Initializer","TextureInitializer","Behaviour","type","EventDispatcher","fromJSON","fromJSONAsync","type","Util","THREEUtil","type","type","PUID","type","THREE","fragmentShader","vertexShader","THREE","vertexShader","fragmentShader"],"sources":["../src/behaviour/types.js","../src/initializer/types.js","../src/zone/types.js","../src/renderer/types.js","../src/constants/index.js","../src/ease/index.js","../src/core/constants.js","../src/utils/ColorUtil.js","../src/utils/PUID.js","../src/core/three/Math.js","../src/core/three/Quaternion.js","../src/core/three/Vector3.js","../src/core/three/Matrix4.js","../src/core/three/Euler.js","../src/utils/THREEUtil.js","../src/utils/Util.js","../node_modules/uuid/dist/esm-browser/stringify.js","../node_modules/uuid/dist/esm-browser/rng.js","../node_modules/uuid/dist/esm-browser/v1.js","../src/utils/uid.js","../src/utils/index.js","../src/math/MathUtils.js","../src/math/types.js","../src/math/Span.js","../node_modules/lodash/_baseRandom.js","../node_modules/lodash/_arraySample.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/_baseValues.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/isLength.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/keys.js","../node_modules/lodash/values.js","../node_modules/lodash/_baseSample.js","../node_modules/lodash/sample.js","../src/math/ArraySpan.js","../src/math/ColorSpan.js","../src/math/Box.js","../src/math/constants.js","../src/math/integration.js","../src/math/Vector3D.js","../src/math/Polar3D.js","../src/core/types.js","../src/core/Particle.js","../src/core/Pool.js","../src/events/EventDispatcher.js","../src/events/constants.js","../src/events/index.js","../src/initializer/Initializer.js","../src/initializer/Body.js","../src/initializer/constants.js","../src/initializer/BodySprite.js","../src/initializer/InitializerUtil.js","../src/initializer/Life.js","../src/initializer/Mass.js","../src/zone/Zone.js","../src/zone/BoxZone.js","../src/zone/LineZone.js","../src/zone/MeshZone.js","../src/zone/PointZone.js","../src/zone/ScreenZone.js","../src/zone/SphereZone.js","../src/zone/index.js","../src/initializer/Position.js","../src/initializer/Rotation.js","../src/initializer/Radius.js","../src/initializer/Rate.js","../src/initializer/Texture.js","../src/initializer/Velocity/Velocity.js","../src/initializer/Velocity/PolarVelocity.js","../src/initializer/Velocity/RadialVelocity.js","../src/initializer/Velocity/VectorVelocity.js","../src/initializer/index.js","../src/emitter/constants.js","../node_modules/lodash/isNumber.js","../src/emitter/types.js","../src/emitter/Emitter.js","../src/behaviour/constants.js","../src/behaviour/Behaviour.js","../src/behaviour/Alpha.js","../src/behaviour/Attraction.js","../src/behaviour/Collision.js","../src/behaviour/Color.js","../src/behaviour/CrossZone.js","../src/behaviour/Force.js","../src/behaviour/Gravity.js","../src/behaviour/RandomDrift.js","../src/behaviour/Repulsion.js","../src/behaviour/Rotate.js","../src/behaviour/Scale.js","../src/behaviour/Spring.js","../src/behaviour/index.js","../src/core/fromJSON.js","../src/core/fromJSONAsync.js","../src/core/System.js","../src/debug/Debug.js","../src/debug/log.js","../src/emitter/FollowEmitter.js","../src/renderer/BaseRenderer.js","../src/renderer/CustomRenderer.js","../src/renderer/MeshRenderer.js","../src/renderer/SpriteRenderer.js","../src/renderer/GPURenderer/common/ParticleBuffer/constants.js","../src/renderer/GPURenderer/common/constants.js","../src/renderer/GPURenderer/common/stores/Target.js","../src/renderer/GPURenderer/common/stores/UniqueList.js","../src/renderer/GPURenderer/common/ParticleBuffer/index.js","../node_modules/potpack/index.mjs","../src/renderer/GPURenderer/common/TextureAtlas/index.js","../src/renderer/GPURenderer/Desktop/shaders/fragmentShader.js","../src/renderer/GPURenderer/common/shaders/constants.js","../src/renderer/GPURenderer/Desktop/shaders/vertexShader.js","../src/renderer/GPURenderer/Desktop/index.js","../src/renderer/GPURenderer/Mobile/shaders/fragmentShader.js","../src/renderer/GPURenderer/Mobile/shaders/vertexShader.js","../src/renderer/GPURenderer/Mobile/index.js","../src/renderer/GPURenderer/index.js","../src/index.js"],"sourcesContent":["export const BEHAVIOUR_TYPE_ABSTRACT = 'Behaviour';\nexport const BEHAVIOUR_TYPE_ALPHA = 'Alpha';\nexport const BEHAVIOUR_TYPE_ATTRACTION = 'Attraction';\nexport const BEHAVIOUR_TYPE_COLLISION = 'Collision';\nexport const BEHAVIOUR_TYPE_COLOR = 'Color';\nexport const BEHAVIOUR_TYPE_CROSS_ZONE = 'CrossZone';\nexport const BEHAVIOUR_TYPE_FORCE = 'Force';\nexport const BEHAVIOUR_TYPE_GRAVITY = 'Gravity';\nexport const BEHAVIOUR_TYPE_RANDOM_DRIFT = 'RandomDrift';\nexport const BEHAVIOUR_TYPE_REPULSION = 'Repulsion';\nexport const BEHAVIOUR_TYPE_ROTATE = 'Rotate';\nexport const BEHAVIOUR_TYPE_SCALE = 'Scale';\nexport const BEHAVIOUR_TYPE_SPRING = 'Spring';\n","export const INITIALIZER_TYPE_ABSTRACT = 'Initializer';\nexport const INITIALIZER_TYPE_BODY = 'Body';\nexport const INITIALIZER_TYPE_BODY_SPRITE = 'BodySprite';\nexport const INITIALIZER_TYPE_TEXTURE = 'Texture';\nexport const INITIALIZER_TYPE_LIFE = 'Life';\nexport const INITIALIZER_TYPE_MASS = 'Mass';\nexport const INITIALIZER_TYPE_POSITION = 'Position';\nexport const INITIALIZER_TYPE_ROTATION = 'Rotation';\nexport const INITIALIZER_TYPE_RADIUS = 'Radius';\nexport const INITIALIZER_TYPE_ZONE = 'Zone';\nexport const INITIALIZER_TYPE_VECTOR_VELOCITY = 'VectorVelocity';\nexport const INITIALIZER_TYPE_POLAR_VELOCITY = 'PolarVelocity';\nexport const INITIALIZER_TYPE_RADIAL_VELOCITY = 'RadialVelocity';\nexport const INITIALIZER_TYPE_RATE = 'Rate';\nexport const INITIALIZER_TYPES_THAT_REQUIRE_THREE = [\n INITIALIZER_TYPE_BODY_SPRITE,\n INITIALIZER_TYPE_TEXTURE,\n];\n","export const ZONE_TYPE_ABSTRACT = 'Zone';\nexport const ZONE_TYPE_BOX = 'BoxZone';\nexport const ZONE_TYPE_LINE = 'LineZone';\nexport const ZONE_TYPE_MESH = 'MeshZone';\nexport const ZONE_TYPE_POINT = 'PointZone';\nexport const ZONE_TYPE_SCREEN = 'ScreenZone';\nexport const ZONE_TYPE_SPHERE = 'SphereZone';\n","export const RENDERER_TYPE_BASE = 'BaseRenderer';\nexport const RENDERER_TYPE_CUSTOM = 'CustomRenderer';\nexport const RENDERER_TYPE_SPRITE = 'SpriteRenderer';\nexport const RENDERER_TYPE_MESH = 'MeshRenderer';\nexport const RENDERER_TYPE_GPU = 'GPURenderer';\nexport const RENDERER_TYPE_GPU_MOBILE = 'MobileGPURenderer';\nexport const RENDERER_TYPE_GPU_DESKTOP = 'DesktopGPURenderer';\n","export const PI = 3.142;\n\n/**\n * The max particle number in pool.\n *\n * @const {integer}\n */\nexport const POOL_MAX = 500;\nexport const TIME_STEP = 60;\nexport const DR = PI / 180;\n\n/**\n * 1:100\n *\n * @const {integer}\n */\nexport const MEASURE = 100;\nexport const EULER = 'euler';\nexport const RK2 = 'runge-kutta2';\nexport const RK4 = 'runge-kutta4';\nexport const VERLET = 'verlet';\nexport const BIND_EMITTER_EVENT = false;\n\nexport const __DEV__ = () => {\n if (!process) {\n return false;\n }\n\n if (!process.env) {\n return false;\n }\n\n if (!process.env.NODE_ENV) {\n return false;\n }\n\n if (process.env.NODE_ENV !== 'development') {\n return false;\n }\n\n return true;\n};\n","import { PI } from '../constants';\n\n/**\n * The Ease class provides a collection of easing functions for use with System\n */\nexport const ease = {\n easeLinear: function(value) {\n return value;\n },\n\n easeInQuad: function(value) {\n return Math.pow(value, 2);\n },\n\n easeOutQuad: function(value) {\n return -(Math.pow(value - 1, 2) - 1);\n },\n\n easeInOutQuad: function(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2);\n\n return -0.5 * ((value -= 2) * value - 2);\n },\n\n easeInCubic: function(value) {\n return Math.pow(value, 3);\n },\n\n easeOutCubic: function(value) {\n return Math.pow(value - 1, 3) + 1;\n },\n\n easeInOutCubic: function(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3);\n\n return 0.5 * (Math.pow(value - 2, 3) + 2);\n },\n\n easeInQuart: function(value) {\n return Math.pow(value, 4);\n },\n\n easeOutQuart: function(value) {\n return -(Math.pow(value - 1, 4) - 1);\n },\n\n easeInOutQuart: function(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4);\n\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\n },\n\n easeInSine: function(value) {\n return -Math.cos(value * (PI / 2)) + 1;\n },\n\n easeOutSine: function(value) {\n return Math.sin(value * (PI / 2));\n },\n\n easeInOutSine: function(value) {\n return -0.5 * (Math.cos(PI * value) - 1);\n },\n\n easeInExpo: function(value) {\n return value === 0 ? 0 : Math.pow(2, 10 * (value - 1));\n },\n\n easeOutExpo: function(value) {\n return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1;\n },\n\n easeInOutExpo: function(value) {\n if (value === 0) return 0;\n if (value === 1) return 1;\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1));\n\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\n },\n\n easeInCirc: function(value) {\n return -(Math.sqrt(1 - value * value) - 1);\n },\n\n easeOutCirc: function(value) {\n return Math.sqrt(1 - Math.pow(value - 1, 2));\n },\n\n easeInOutCirc: function(value) {\n if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1);\n\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\n },\n\n easeInBack: function(value) {\n var s = 1.70158;\n\n return value * value * ((s + 1) * value - s);\n },\n\n easeOutBack: function(value) {\n var s = 1.70158;\n\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\n },\n\n easeInOutBack: function(value) {\n var s = 1.70158;\n\n if ((value /= 0.5) < 1)\n return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s));\n\n return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2);\n }\n};\n\nexport const {\n easeLinear,\n easeInQuad,\n easeOutQuad,\n easeInOutQuad,\n easeInCubic,\n easeOutCubic,\n easeInOutCubic,\n easeInQuart,\n easeOutQuart,\n easeInOutQuart,\n easeInSine,\n easeOutSine,\n easeInOutSine,\n easeInExpo,\n easeOutExpo,\n easeInOutExpo,\n easeInCirc,\n easeOutCirc,\n easeInOutCirc,\n easeInBack,\n easeOutBack,\n easeInOutBack\n} = ease;\n\nexport const setEasingByName = easeName => {\n if (ease[easeName]) return ease[easeName];\n else return ease.easeLinear;\n};\n\nexport const getEasingByName = name =>\n ease[name] ? ease[name] : ease.easeLinear;\n","import {\n BEHAVIOUR_TYPE_ALPHA,\n BEHAVIOUR_TYPE_ATTRACTION,\n BEHAVIOUR_TYPE_COLOR,\n BEHAVIOUR_TYPE_CROSS_ZONE,\n BEHAVIOUR_TYPE_FORCE,\n BEHAVIOUR_TYPE_GRAVITY,\n BEHAVIOUR_TYPE_RANDOM_DRIFT,\n BEHAVIOUR_TYPE_REPULSION,\n BEHAVIOUR_TYPE_ROTATE,\n BEHAVIOUR_TYPE_SCALE,\n BEHAVIOUR_TYPE_SPRING,\n} from '../behaviour/types';\nimport {\n INITIALIZER_TYPE_BODY,\n INITIALIZER_TYPE_BODY_SPRITE,\n INITIALIZER_TYPE_LIFE,\n INITIALIZER_TYPE_MASS,\n INITIALIZER_TYPE_POLAR_VELOCITY,\n INITIALIZER_TYPE_POSITION,\n INITIALIZER_TYPE_ROTATION,\n INITIALIZER_TYPE_RADIAL_VELOCITY,\n INITIALIZER_TYPE_RADIUS,\n INITIALIZER_TYPE_TEXTURE,\n INITIALIZER_TYPE_VECTOR_VELOCITY,\n} from '../initializer/types';\nimport {\n ZONE_TYPE_BOX,\n ZONE_TYPE_LINE,\n ZONE_TYPE_MESH,\n ZONE_TYPE_POINT,\n ZONE_TYPE_SPHERE,\n} from '../zone/types';\n\nimport { RENDERER_TYPE_SPRITE } from '../renderer/types';\nimport { easeLinear } from '../ease';\n\n/**\n * @desc Default particle life\n * @type {number}\n */\nexport const DEFAULT_LIFE = Infinity;\n/**\n * @desc Default particle age\n * @type {number}\n */\nexport const DEFAULT_AGE = 0;\n/**\n * @desc Default particle energy\n * @type {number}\n */\nexport const DEFAULT_ENERGY = 1;\n/**\n * @desc Default particle dead\n * @type {boolean}\n */\nexport const DEFAULT_DEAD = false;\n/**\n * @desc Default particle sleep\n * @type {boolean}\n */\nexport const DEFAULT_SLEEP = false;\n\n/**\n * @desc Default particle index\n * @type {number}\n */\nexport const DEFAULT_INDEX = 0;\n/**\n * @desc Default particle body\n * @type {?object}\n */\nexport const DEFAULT_BODY = null;\n/**\n * @desc Default particle parent\n * @type {?Emitter}\n */\nexport const DEFAULT_PARENT = null;\n/**\n * @desc Default particle mass\n * @type {number}\n */\nexport const DEFAULT_MASS = 1;\n/**\n * @desc Default particle radius\n * @type {number}\n */\nexport const DEFAULT_RADIUS = 10;\n/**\n * @desc Default particle alpha\n * @type {number}\n */\nexport const DEFAULT_ALPHA = 1;\n/**\n * @desc Default particle scale\n * @type {number}\n */\nexport const DEFAULT_SCALE = 1;\n/**\n * @desc Default particle useColor\n * @type {boolean}\n */\nexport const DEFAULT_USE_COLOR = false;\n/**\n * @desc Default particle useAlpha\n * @type {boolean}\n */\nexport const DEFAULT_USE_ALPHA = false;\n/**\n * @desc Default particle easing\n * @type {function}\n */\nexport const DEFAULT_EASING = easeLinear;\n\n/**\n * @desc The default delta provided to the System instance\n * @type {number}\n */\nexport const DEFAULT_SYSTEM_DELTA = 0.0167;\n\n/**\n * @desc The types of initializers supported by the System.fromJSON method.\n * @type {array<string>}\n */\nexport const SUPPORTED_JSON_INITIALIZER_TYPES = [\n INITIALIZER_TYPE_POSITION,\n INITIALIZER_TYPE_ROTATION,\n INITIALIZER_TYPE_LIFE,\n INITIALIZER_TYPE_RADIUS,\n INITIALIZER_TYPE_MASS,\n INITIALIZER_TYPE_BODY,\n INITIALIZER_TYPE_BODY_SPRITE,\n INITIALIZER_TYPE_TEXTURE,\n INITIALIZER_TYPE_POLAR_VELOCITY,\n INITIALIZER_TYPE_RADIAL_VELOCITY,\n INITIALIZER_TYPE_VECTOR_VELOCITY,\n];\n\n/**\n * @desc The types of behaviours supported by the System.fromJSON method.\n * @type {array<string>}\n */\nexport const SUPPORTED_JSON_BEHAVIOUR_TYPES = [\n BEHAVIOUR_TYPE_ALPHA,\n BEHAVIOUR_TYPE_ATTRACTION,\n BEHAVIOUR_TYPE_COLOR,\n BEHAVIOUR_TYPE_CROSS_ZONE,\n BEHAVIOUR_TYPE_FORCE,\n BEHAVIOUR_TYPE_GRAVITY,\n BEHAVIOUR_TYPE_RANDOM_DRIFT,\n BEHAVIOUR_TYPE_REPULSION,\n BEHAVIOUR_TYPE_ROTATE,\n BEHAVIOUR_TYPE_SCALE,\n BEHAVIOUR_TYPE_SPRING,\n];\n\n/**\n * @desc The types of renderers supported by the System.fromJSON method.\n * @type {array<string>}\n */\nexport const SUPPORTED_JSON_RENDERER_TYPES = [RENDERER_TYPE_SPRITE];\n\n/**\n * @desc The types of zones supported by the System.fromJSON method.\n * @type {array<string>}\n */\nexport const SUPPORTED_JSON_ZONE_TYPES = [\n ZONE_TYPE_BOX,\n ZONE_TYPE_LINE,\n ZONE_TYPE_MESH,\n ZONE_TYPE_POINT,\n ZONE_TYPE_SPHERE,\n];\n\nexport { INITIALIZER_TYPES_THAT_REQUIRE_THREE } from '../initializer/types';\n","export default {\n getRGB: function(color) {\n var rgb = {};\n\n if (typeof color === 'number') {\n hex = Math.floor(color);\n rgb.r = ((color >> 16) & 255) / 255;\n rgb.g = ((color >> 8) & 255) / 255;\n rgb.b = (color & 255) / 255;\n } else if (typeof color === 'string') {\n var m;\n\n if (\n (m = /^(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(\n color\n ))\n ) {\n rgb.r = Math.min(255, parseInt(m[1], 10)) / 255;\n rgb.g = Math.min(255, parseInt(m[2], 10)) / 255;\n rgb.b = Math.min(255, parseInt(m[3], 10)) / 255;\n // eslint-disable-next-line no-useless-escape\n } else if ((m = /^\\#([A-Fa-f0-9]+)$/.exec(color))) {\n var hex = m[1];\n\n rgb.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n rgb.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n rgb.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n }\n } else {\n rgb.r = color.r;\n rgb.g = color.g;\n rgb.b = color.b;\n }\n\n return rgb;\n },\n};\n","export default {\n _id: 0,\n _uids: new Map(),\n getNewId: function() {\n return `PUID_${++this._id}`;\n },\n id: function(functionOrObject) {\n if (this._uids.has(functionOrObject)) {\n return this._uids.get(functionOrObject);\n }\n\n const newId = this.getNewId();\n\n this._uids.set(functionOrObject, newId);\n\n return newId;\n },\n};\n","/**\n * @author alteredq / http://alteredqualia.com/\n * @author mrdoob / http://mrdoob.com/\n */\n\nvar _Math = {\n\n\tDEG2RAD: Math.PI / 180,\n\tRAD2DEG: 180 / Math.PI,\n\n\tgenerateUUID: ( function () {\n\n\t\t// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\n\t\tvar lut = [];\n\n\t\tfor ( var i = 0; i < 256; i ++ ) {\n\n\t\t\tlut[ i ] = ( i < 16 ? '0' : '' ) + ( i ).toString( 16 );\n\n\t\t}\n\n\t\treturn function generateUUID() {\n\n\t\t\tvar d0 = Math.random() * 0xffffffff | 0;\n\t\t\tvar d1 = Math.random() * 0xffffffff | 0;\n\t\t\tvar d2 = Math.random() * 0xffffffff | 0;\n\t\t\tvar d3 = Math.random() * 0xffffffff | 0;\n\t\t\tvar uuid = lut[ d0 & 0xff ] + lut[ d0 >> 8 & 0xff ] + lut[ d0 >> 16 & 0xff ] + lut[ d0 >> 24 & 0xff ] + '-' +\n\t\t\t\tlut[ d1 & 0xff ] + lut[ d1 >> 8 & 0xff ] + '-' + lut[ d1 >> 16 & 0x0f | 0x40 ] + lut[ d1 >> 24 & 0xff ] + '-' +\n\t\t\t\tlut[ d2 & 0x3f | 0x80 ] + lut[ d2 >> 8 & 0xff ] + '-' + lut[ d2 >> 16 & 0xff ] + lut[ d2 >> 24 & 0xff ] +\n\t\t\t\tlut[ d3 & 0xff ] + lut[ d3 >> 8 & 0xff ] + lut[ d3 >> 16 & 0xff ] + lut[ d3 >> 24 & 0xff ];\n\n\t\t\t// .toUpperCase() here flattens concatenated strings to save heap memory space.\n\t\t\treturn uuid.toUpperCase();\n\n\t\t};\n\n\t} )(),\n\n\tclamp: function ( value, min, max ) {\n\n\t\treturn Math.max( min, Math.min( max, value ) );\n\n\t},\n\n\t// compute euclidian modulo of m % n\n\t// https://en.wikipedia.org/wiki/Modulo_operation\n\n\teuclideanModulo: function ( n, m ) {\n\n\t\treturn ( ( n % m ) + m ) % m;\n\n\t},\n\n\t// Linear mapping from range <a1, a2> to range <b1, b2>\n\n\tmapLinear: function ( x, a1, a2, b1, b2 ) {\n\n\t\treturn b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );\n\n\t},\n\n\t// https://en.wikipedia.org/wiki/Linear_interpolation\n\n\tlerp: function ( x, y, t ) {\n\n\t\treturn ( 1 - t ) * x + t * y;\n\n\t},\n\n\t// http://en.wikipedia.org/wiki/Smoothstep\n\n\tsmoothstep: function ( x, min, max ) {\n\n\t\tif ( x <= min ) return 0;\n\t\tif ( x >= max ) return 1;\n\n\t\tx = ( x - min ) / ( max - min );\n\n\t\treturn x * x * ( 3 - 2 * x );\n\n\t},\n\n\tsmootherstep: function ( x, min, max ) {\n\n\t\tif ( x <= min ) return 0;\n\t\tif ( x >= max ) return 1;\n\n\t\tx = ( x - min ) / ( max - min );\n\n\t\treturn x * x * x * ( x * ( x * 6 - 15 ) + 10 );\n\n\t},\n\n\t// Random integer from <low, high> interval\n\n\trandInt: function ( low, high ) {\n\n\t\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n\t},\n\n\t// Random float from <low, high> interval\n\n\trandFloat: function ( low, high ) {\n\n\t\treturn low + Math.random() * ( high - low );\n\n\t},\n\n\t// Random float from <-range/2, range/2> interval\n\n\trandFloatSpread: function ( range ) {\n\n\t\treturn range * ( 0.5 - Math.random() );\n\n\t},\n\n\tdegToRad: function ( degrees ) {\n\n\t\treturn degrees * _Math.DEG2RAD;\n\n\t},\n\n\tradToDeg: function ( radians ) {\n\n\t\treturn radians * _Math.RAD2DEG;\n\n\t},\n\n\tisPowerOfTwo: function ( value ) {\n\n\t\treturn ( value & ( value - 1 ) ) === 0 && value !== 0;\n\n\t},\n\n\tceilPowerOfTwo: function ( value ) {\n\n\t\treturn Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) );\n\n\t},\n\n\tfloorPowerOfTwo: function ( value ) {\n\n\t\treturn Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) );\n\n\t}\n\n};\n\n\nexport { _Math };","/**\n * @author mikael emtinger / http://gomo.se/\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author bhouston / http://clara.io\n */\n\nimport { _Math } from './Math.js';\n\nfunction Quaternion( x, y, z, w ) {\n\n\tthis._x = x || 0;\n\tthis._y = y || 0;\n\tthis._z = z || 0;\n\tthis._w = ( w !== undefined ) ? w : 1;\n\n}\n\nObject.assign( Quaternion, {\n\n\tslerp: function ( qa, qb, qm, t ) {\n\n\t\treturn qm.copy( qa ).slerp( qb, t );\n\n\t},\n\n\tslerpFlat: function ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {\n\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\n\t\tvar x0 = src0[ srcOffset0 + 0 ],\n\t\t\ty0 = src0[ srcOffset0 + 1 ],\n\t\t\tz0 = src0[ srcOffset0 + 2 ],\n\t\t\tw0 = src0[ srcOffset0 + 3 ],\n\n\t\t\tx1 = src1[ srcOffset1 + 0 ],\n\t\t\ty1 = src1[ srcOffset1 + 1 ],\n\t\t\tz1 = src1[ srcOffset1 + 2 ],\n\t\t\tw1 = src1[ srcOffset1 + 3 ];\n\n\t\tif ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {\n\n\t\t\tvar s = 1 - t,\n\n\t\t\t\tcos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\n\t\t\t\tdir = ( cos >= 0 ? 1 : - 1 ),\n\t\t\t\tsqrSin = 1 - cos * cos;\n\n\t\t\t// Skip the Slerp for tiny steps to avoid numeric problems:\n\t\t\tif ( sqrSin > Number.EPSILON ) {\n\n\t\t\t\tvar sin = Math.sqrt( sqrSin ),\n\t\t\t\t\tlen = Math.atan2( sin, cos * dir );\n\n\t\t\t\ts = Math.sin( s * len ) / sin;\n\t\t\t\tt = Math.sin( t * len ) / sin;\n\n\t\t\t}\n\n\t\t\tvar tDir = t * dir;\n\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir;\n\n\t\t\t// Normalize in case we just did a lerp:\n\t\t\tif ( s === 1 - t ) {\n\n\t\t\t\tvar f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );\n\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\n\t\t\t}\n\n\t\t}\n\n\t\tdst[ dstOffset ] = x0;\n\t\tdst[ dstOffset + 1 ] = y0;\n\t\tdst[ dstOffset + 2 ] = z0;\n\t\tdst[ dstOffset + 3 ] = w0;\n\n\t}\n\n} );\n\nObject.defineProperties( Quaternion.prototype, {\n\n\tx: {\n\n\t\tget: function () {\n\n\t\t\treturn this._x;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis._x = value;\n\t\t\tthis._onChangeCallback();\n\n\t\t}\n\n\t},\n\n\ty: {\n\n\t\tget: function () {\n\n\t\t\treturn this._y;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis._y = value;\n\t\t\tthis._onChangeCallback();\n\n\t\t}\n\n\t},\n\n\tz: {\n\n\t\tget: function () {\n\n\t\t\treturn this._z;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis._z = value;\n\t\t\tthis._onChangeCallback();\n\n\t\t}\n\n\t},\n\n\tw: {\n\n\t\tget: function () {\n\n\t\t\treturn this._w;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis._w = value;\n\t\t\tthis._onChangeCallback();\n\n\t\t}\n\n\t}\n\n} );\n\nObject.assign( Quaternion.prototype, {\n\n\tisQuaternion: true,\n\n\tset: function ( x, y, z, w ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tclone: function () {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._w );\n\n\t},\n\n\tcopy: function ( quaternion ) {\n\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tsetFromEuler: function ( euler, update ) {\n\n\t\tif ( ! ( euler && euler.isEuler ) ) {\n\n\t\t\tthrow new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' );\n\n\t\t}\n\n\t\tvar x = euler._x, y = euler._y, z = euler._z, order = euler.order;\n\n\t\t// http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tvar cos = Math.cos;\n\t\tvar sin = Math.sin;\n\n\t\tvar c1 = cos( x / 2 );\n\t\tvar c2 = cos( y / 2 );\n\t\tvar c3 = cos( z / 2 );\n\n\t\tvar s1 = sin( x / 2 );\n\t\tvar s2 = sin( y / 2 );\n\t\tvar s3 = sin( z / 2 );\n\n\t\tif ( order === 'XYZ' ) {\n\n\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\n\t\t} else if ( order === 'YXZ' ) {\n\n\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\n\t\t} else if ( order === 'ZXY' ) {\n\n\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\n\t\t} else if ( order === 'ZYX' ) {\n\n\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\n\t\t} else if ( order === 'YZX' ) {\n\n\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\n\t\t} else if ( order === 'XZY' ) {\n\n\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\n\t\t}\n\n\t\tif ( update !== false ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tsetFromAxisAngle: function ( axis, angle ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\n\t\t// assumes axis is normalized\n\n\t\tvar halfAngle = angle / 2, s = Math.sin( halfAngle );\n\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos( halfAngle );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tsetFromRotationMatrix: function ( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tvar te = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ],\n\n\t\t\ttrace = m11 + m22 + m33,\n\t\t\ts;\n\n\t\tif ( trace > 0 ) {\n\n\t\t\ts = 0.5 / Math.sqrt( trace + 1.0 );\n\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = ( m32 - m23 ) * s;\n\t\t\tthis._y = ( m13 - m31 ) * s;\n\t\t\tthis._z = ( m21 - m12 ) * s;\n\n\t\t} else if ( m11 > m22 && m11 > m33 ) {\n\n\t\t\ts = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );\n\n\t\t\tthis._w = ( m32 - m23 ) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = ( m12 + m21 ) / s;\n\t\t\tthis._z = ( m13 + m31 ) / s;\n\n\t\t} else if ( m22 > m33 ) {\n\n\t\t\ts = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );\n\n\t\t\tthis._w = ( m13 - m31 ) / s;\n\t\t\tthis._x = ( m12 + m21 ) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = ( m23 + m32 ) / s;\n\n\t\t} else {\n\n\t\t\ts = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );\n\n\t\t\tthis._w = ( m21 - m12 ) / s;\n\t\t\tthis._x = ( m13 + m31 ) / s;\n\t\t\tthis._y = ( m23 + m32 ) / s;\n\t\t\tthis._z = 0.25 * s;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tsetFromUnitVectors: function ( vFrom, vTo ) {\n\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\n\t\tvar EPS = 0.000001;\n\n\t\tvar r = vFrom.dot( vTo ) + 1;\n\n\t\tif ( r < EPS ) {\n\n\t\t\tr = 0;\n\n\t\t\tif ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) {\n\n\t\t\t\tthis._x = - vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = - vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\n\t\t}\n\n\t\treturn this.normalize();\n\n\t},\n\n\tangleTo: function ( q ) {\n\n\t\treturn 2 * Math.acos( Math.abs( _Math.clamp( this.dot( q ), - 1, 1 ) ) );\n\n\t},\n\n\trotateTowards: function ( q, step ) {\n\n\t\tvar angle = this.angleTo( q );\n\n\t\tif ( angle === 0 ) return this;\n\n\t\tvar t = Math.min( 1, step / angle );\n\n\t\tthis.slerp( q, t );\n\n\t\treturn this;\n\n\t},\n\n\tinverse: function () {\n\n\t\t// quaternion is assumed to have unit length\n\n\t\treturn this.conjugate();\n\n\t},\n\n\tconjugate: function () {\n\n\t\tthis._x *= - 1;\n\t\tthis._y *= - 1;\n\t\tthis._z *= - 1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tdot: function ( v ) {\n\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\n\t},\n\n\tlengthSq: function () {\n\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\n\t},\n\n\tlength: function () {\n\n\t\treturn Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w );\n\n\t},\n\n\tnormalize: function () {\n\n\t\tvar l = this.length();\n\n\t\tif ( l === 0 ) {\n\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\n\t\t} else {\n\n\t\t\tl = 1 / l;\n\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tmultiply: function ( q, p ) {\n\n\t\tif ( p !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' );\n\t\t\treturn this.multiplyQuaternions( q, p );\n\n\t\t}\n\n\t\treturn this.multiplyQuaternions( this, q );\n\n\t},\n\n\tpremultiply: function ( q ) {\n\n\t\treturn this.multiplyQuaternions( q, this );\n\n\t},\n\n\tmultiplyQuaternions: function ( a, b ) {\n\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\n\t\tvar qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;\n\t\tvar qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;\n\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tslerp: function ( qb, t ) {\n\n\t\tif ( t === 0 ) return this;\n\t\tif ( t === 1 ) return this.copy( qb );\n\n\t\tvar x = this._x, y = this._y, z = this._z, w = this._w;\n\n\t\t// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tvar cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif ( cosHalfTheta < 0 ) {\n\n\t\t\tthis._w = - qb._w;\n\t\t\tthis._x = - qb._x;\n\t\t\tthis._y = - qb._y;\n\t\t\tthis._z = - qb._z;\n\n\t\t\tcosHalfTheta = - cosHalfTheta;\n\n\t\t} else {\n\n\t\t\tthis.copy( qb );\n\n\t\t}\n\n\t\tif ( cosHalfTheta >= 1.0 ) {\n\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tvar sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif ( sqrSinHalfTheta <= Number.EPSILON ) {\n\n\t\t\tvar s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\n\t\t\tthis.normalize();\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tvar sinHalfTheta = Math.sqrt( sqrSinHalfTheta );\n\t\tvar halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );\n\t\tvar ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,\n\t\t\tratioB = Math.sin( t * halfTheta ) / sinHalfTheta;\n\n\t\tthis._w = ( w * ratioA + this._w * ratioB );\n\t\tthis._x = ( x * ratioA + this._x * ratioB );\n\t\tthis._y = ( y * ratioA + this._y * ratioB );\n\t\tthis._z = ( z * ratioA + this._z * ratioB );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tequals: function ( quaternion ) {\n\n\t\treturn ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w );\n\n\t},\n\n\tfromArray: function ( array, offset ) {\n\n\t\tif ( offset === undefined ) offset = 0;\n\n\t\tthis._x = array[ offset ];\n\t\tthis._y = array[ offset + 1 ];\n\t\tthis._z = array[ offset + 2 ];\n\t\tthis._w = array[ offset + 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\ttoArray: function ( array, offset ) {\n\n\t\tif ( array === undefined ) array = [];\n\t\tif ( offset === undefined ) offset = 0;\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._w;\n\n\t\treturn array;\n\n\t},\n\n\t_onChange: function ( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t},\n\n\t_onChangeCallback: function () {}\n\n} );\n\n\nexport { Quaternion };","import { _Math } from './Math.js';\nimport { Quaternion } from './Quaternion.js';\n\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author kile / http://kile.stravaganza.org/\n * @author philogb / http://blog.thejit.org/\n * @author mikael emtinger / http://gomo.se/\n * @author egraether / http://egraether.com/\n * @author WestLangley / http://github.com/WestLangley\n */\n\nfunction Vector3( x, y, z ) {\n\n\tthis.x = x || 0;\n\tthis.y = y || 0;\n\tthis.z = z || 0;\n\n}\n\nObject.assign( Vector3.prototype, {\n\n\tisVector3: true,\n\n\tset: function ( x, y, z ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t},\n\n\tsetScalar: function ( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\n\t\treturn this;\n\n\t},\n\n\tsetX: function ( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t},\n\n\tsetY: function ( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t},\n\n\tsetZ: function ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t},\n\n\tsetComponent: function ( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tgetComponent: function ( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t},\n\n\tclone: function () {\n\n\t\treturn new this.constructor( this.x, this.y, this.z );\n\n\t},\n\n\tcopy: function ( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\n\t\treturn this;\n\n\t},\n\n\tadd: function ( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );\n\t\t\treturn this.addVectors( v, w );\n\n\t\t}\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\n\t\treturn this;\n\n\t},\n\n\taddScalar: function ( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\n\t\treturn this;\n\n\t},\n\n\taddVectors: function ( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\n\t\treturn this;\n\n\t},\n\n\taddScaledVector: function ( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\n\t\treturn this;\n\n\t},\n\n\tsub: function ( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );\n\t\t\treturn this.subVectors( v, w );\n\n\t\t}\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\n\t\treturn this;\n\n\t},\n\n\tsubScalar: function ( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\n\t\treturn this;\n\n\t},\n\n\tsubVectors: function ( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\n\t\treturn this;\n\n\t},\n\n\tmultiply: function ( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' );\n\t\t\treturn this.multiplyVectors( v, w );\n\n\t\t}\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\n\t\treturn this;\n\n\t},\n\n\tmultiplyScalar: function ( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\n\t\treturn this;\n\n\t},\n\n\tmultiplyVectors: function ( a, b ) {\n\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\n\t\treturn this;\n\n\t},\n\n\tapplyEuler: function () {\n\n\t\tvar quaternion = new Quaternion();\n\n\t\treturn function applyEuler( euler ) {\n\n\t\t\tif ( ! ( euler && euler.isEuler ) ) {\n\n\t\t\t\tconsole.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' );\n\n\t\t\t}\n\n\t\t\treturn this.applyQuaternion( quaternion.setFromEuler( euler ) );\n\n\t\t};\n\n\t}(),\n\n\tapplyAxisAngle: function () {\n\n\t\tvar quaternion = new Quaternion();\n\n\t\treturn function applyAxisAngle( axis, angle ) {\n\n\t\t\treturn this.applyQuaternion( quaternion.setFromAxisAngle( axis, angle ) );\n\n\t\t};\n\n\t}(),\n\n\tapplyMatrix3: function ( m ) {\n\n\t\tvar x = this.x, y = this.y, z = this.z;\n\t\tvar e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z;\n\n\t\treturn this;\n\n\t},\n\n\tapplyMatrix4: function ( m ) {\n\n\t\tvar x = this.x, y = this.y, z = this.z;\n\t\tvar e = m.elements;\n\n\t\tvar w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] );\n\n\t\tthis.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w;\n\t\tthis.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w;\n\t\tthis.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w;\n\n\t\treturn this;\n\n\t},\n\n\tapplyQuaternion: function ( q ) {\n\n\t\tvar x = this.x, y = this.y, z = this.z;\n\t\tvar qx = q.x, qy = q.y, qz = q.z, qw = q.w;\n\n\t\t// calculate quat * vector\n\n\t\tvar ix = qw * x + qy * z - qz * y;\n\t\tvar iy = qw * y + qz * x - qx * z;\n\t\tvar iz = qw * z + qx * y - qy * x;\n\t\tvar iw = - qx * x - qy * y - qz * z;\n\n\t\t// calculate result * inverse quat\n\n\t\tthis.x = ix * qw + iw * - qx + iy * - qz - iz * - qy;\n\t\tthis.y = iy * qw + iw * - qy + iz * - qx - ix * - qz;\n\t\tthis.z = iz * qw + iw * - qz + ix * - qy - iy * - qx;\n\n\t\treturn this;\n\n\t},\n\n\tproject: function ( camera ) {\n\n\t\treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\n\t},\n\n\tunproject: function ( camera ) {\n\n\t\treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\n\t},\n\n\ttransformDirection: function ( m ) {\n\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\n\t\tvar x = this.x, y = this.y, z = this.z;\n\t\tvar e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z;\n\n\t\treturn this.normalize();\n\n\t},\n\n\tdivide: function ( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\n\t\treturn this;\n\n\t},\n\n\tdivideScalar: function ( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t},\n\n\tmin: function ( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\n\t\treturn this;\n\n\t},\n\n\tmax: function ( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\n\t\treturn this;\n\n\t},\n\n\tclamp: function ( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\n\t\treturn this;\n\n\t},\n\n\tclampScalar: function ( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\t\tthis.z = Math.max( minVal, Math.min( maxVal, this.z ) );\n\n\t\treturn this;\n\n\t},\n\n\tclampLength: function ( min, max ) {\n\n\t\tvar length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t},\n\n\tfloor: function () {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\n\t\treturn this;\n\n\t},\n\n\tceil: function () {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\n\t\treturn this;\n\n\t},\n\n\tround: function () {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\n\t\treturn this;\n\n\t},\n\n\troundToZero: function () {\n\n\t\tthis.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );\n\t\tthis.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );\n\t\tthis.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z );\n\n\t\treturn this;\n\n\t},\n\n\tnegate: function () {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\n\t\treturn this;\n\n\t},\n\n\tdot: function ( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\n\t},\n\n\t// TODO lengthSquared?\n\n\tlengthSq: function () {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\n\t},\n\n\tlength: function () {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );\n\n\t},\n\n\tmanhattanLength: function () {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );\n\n\t},\n\n\tnormalize: function () {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t},\n\n\tsetLength: function ( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t},\n\n\tlerp: function ( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\n\t\treturn this;\n\n\t},\n\n\tlerpVectors: function ( v1, v2, alpha ) {\n\n\t\treturn this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 );\n\n\t},\n\n\tcross: function ( v, w ) {\n\n\t\tif ( w !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' );\n\t\t\treturn this.crossVectors( v, w );\n\n\t\t}\n\n\t\treturn this.crossVectors( this, v );\n\n\t},\n\n\tcrossVectors: function ( a, b ) {\n\n\t\tvar ax = a.x, ay = a.y, az = a.z;\n\t\tvar bx = b.x, by = b.y, bz = b.z;\n\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\n\t\treturn this;\n\n\t},\n\n\tprojectOnVector: function ( vector ) {\n\n\t\tvar scalar = vector.dot( this ) / vector.lengthSq();\n\n\t\treturn this.copy( vector ).multiplyScalar( scalar );\n\n\t},\n\n\tprojectOnPlane: function () {\n\n\t\tvar v1 = new Vector3();\n\n\t\treturn function projectOnPlane( planeNormal ) {\n\n\t\t\tv1.copy( this ).projectOnVector( planeNormal );\n\n\t\t\treturn this.sub( v1 );\n\n\t\t};\n\n\t}(),\n\n\treflect: function () {\n\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\n\t\tvar v1 = new Vector3();\n\n\t\treturn function reflect( normal ) {\n\n\t\t\treturn this.sub( v1.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );\n\n\t\t};\n\n\t}(),\n\n\tangleTo: function ( v ) {\n\n\t\tvar theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) );\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( _Math.clamp( theta, - 1, 1 ) );\n\n\t},\n\n\tdistanceTo: function ( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t},\n\n\tdistanceToSquared: function ( v ) {\n\n\t\tvar dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;\n\n\t\treturn dx * dx + dy * dy + dz * dz;\n\n\t},\n\n\tmanhattanDistanceTo: function ( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );\n\n\t},\n\n\tsetFromSpherical: function ( s ) {\n\n\t\treturn this.setFromSphericalCoords( s.radius, s.phi, s.theta );\n\n\t},\n\n\tsetFromSphericalCoords: function ( radius, phi, theta ) {\n\n\t\tvar sinPhiRadius = Math.sin( phi ) * radius;\n\n\t\tthis.x = sinPhiRadius * Math.sin( theta );\n\t\tthis.y = Math.cos( phi ) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos( theta );\n\n\t\treturn this;\n\n\t},\n\n\tsetFromCylindrical: function ( c ) {\n\n\t\treturn this.setFromCylindricalCoords( c.radius, c.theta, c.y );\n\n\t},\n\n\tsetFromCylindricalCoords: function ( radius, theta, y ) {\n\n\t\tthis.x = radius * Math.sin( theta );\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos( theta );\n\n\t\treturn this;\n\n\t},\n\n\tsetFromMatrixPosition: function ( m ) {\n\n\t\tvar e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\n\t\treturn this;\n\n\t},\n\n\tsetFromMatrixScale: function ( m ) {\n\n\t\tvar sx = this.setFromMatrixColumn( m, 0 ).length();\n\t\tvar sy = this.setFromMatrixColumn( m, 1 ).length();\n\t\tvar sz = this.setFromMatrixColumn( m, 2 ).length();\n\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\n\t\treturn this;\n\n\t},\n\n\tsetFromMatrixColumn: function ( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 4 );\n\n\t},\n\n\tequals: function ( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );\n\n\t},\n\n\tfromArray: function ( array, offset ) {\n\n\t\tif ( offset === undefined ) offset = 0;\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t},\n\n\ttoArray: function ( array, offset ) {\n\n\t\tif ( array === undefined ) array = [];\n\t\tif ( offset === undefined ) offset = 0;\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\n\t\treturn array;\n\n\t},\n\n\tfromBufferAttribute: function ( attribute, index, offset ) {\n\n\t\tif ( offset !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' );\n\n\t\t}\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n} );\n\n\nexport { Vector3 };","import { Vector3 } from './Vector3.js';\n\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author supereggbert / http://www.paulbrunt.co.uk/\n * @author philogb / http://blog.thejit.org/\n * @author jordi_ros / http://plattsoft.com\n * @author D1plo1d / http://github.com/D1plo1d\n * @author alteredq / http://alteredqualia.com/\n * @author mikael emtinger / http://gomo.se/\n * @author timknip / http://www.floorplanner.com/\n * @author bhouston / http://clara.io\n * @author WestLangley / http://github.com/WestLangley\n */\n\nfunction Matrix4() {\n\n\tthis.elements = [\n\n\t\t1, 0, 0, 0,\n\t\t0, 1, 0, 0,\n\t\t0, 0, 1, 0,\n\t\t0, 0, 0, 1\n\n\t];\n\n\tif ( arguments.length > 0 ) {\n\n\t\tconsole.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' );\n\n\t}\n\n}\n\nObject.assign( Matrix4.prototype, {\n\n\tisMatrix4: true,\n\n\tset: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\tvar te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14;\n\t\tte[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24;\n\t\tte[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34;\n\t\tte[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44;\n\n\t\treturn this;\n\n\t},\n\n\tidentity: function () {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t},\n\n\tclone: function () {\n\n\t\treturn new Matrix4().fromArray( this.elements );\n\n\t},\n\n\tcopy: function ( m ) {\n\n\t\tvar te = this.elements;\n\t\tvar me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ];\n\t\tte[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ];\n\t\tte[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ];\n\t\tte[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ];\n\n\t\treturn this;\n\n\t},\n\n\tcopyPosition: function ( m ) {\n\n\t\tvar te = this.elements, me = m.elements;\n\n\t\tte[ 12 ] = me[ 12 ];\n\t\tte[ 13 ] = me[ 13 ];\n\t\tte[ 14 ] = me[ 14 ];\n\n\t\treturn this;\n\n\t},\n\n\textractBasis: function ( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrixColumn( this, 0 );\n\t\tyAxis.setFromMatrixColumn( this, 1 );\n\t\tzAxis.setFromMatrixColumn( this, 2 );\n\n\t\treturn this;\n\n\t},\n\n\tmakeBasis: function ( xAxis, yAxis, zAxis ) {\n\n\t\tthis.set(\n\t\t\txAxis.x, yAxis.x, zAxis.x, 0,\n\t\t\txAxis.y, yAxis.y, zAxis.y, 0,\n\t\t\txAxis.z, yAxis.z, zAxis.z, 0,\n\t\t\t0, 0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t},\n\n\textractRotation: function () {\n\n\t\tvar v1 = new Vector3();\n\n\t\treturn function extractRotation( m ) {\n\n\t\t\t// this method does not support reflection matrices\n\n\t\t\tvar te = this.elements;\n\t\t\tvar me = m.elements;\n\n\t\t\tvar scaleX = 1 / v1.setFromMatrixColumn( m, 0 ).length();\n\t\t\tvar scaleY = 1 / v1.setFromMatrixColumn( m, 1 ).length();\n\t\t\tvar scaleZ = 1 / v1.setFromMatrixColumn( m, 2 ).length();\n\n\t\t\tte[ 0 ] = me[ 0 ] * scaleX;\n\t\t\tte[ 1 ] = me[ 1 ] * scaleX;\n\t\t\tte[ 2 ] = me[ 2 ] * scaleX;\n\t\t\tte[ 3 ] = 0;\n\n\t\t\tte[ 4 ] = me[ 4 ] * scaleY;\n\t\t\tte[ 5 ] = me[ 5 ] * scaleY;\n\t\t\tte[ 6 ] = me[ 6 ] * scaleY;\n\t\t\tte[ 7 ] = 0;\n\n\t\t\tte[ 8 ] = me[ 8 ] * scaleZ;\n\t\t\tte[ 9 ] = me[ 9 ] * scaleZ;\n\t\t\tte[ 10 ] = me[ 10 ] * scaleZ;\n\t\t\tte[ 11 ] = 0;\n\n\t\t\tte[ 12 ] = 0;\n\t\t\tte[ 13 ] = 0;\n\t\t\tte[ 14 ] = 0;\n\t\t\tte[ 15 ] = 1;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}(),\n\n\tmakeRotationFromEuler: function ( euler ) {\n\n\t\tif ( ! ( euler && euler.isEuler ) ) {\n\n\t\t\tconsole.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' );\n\n\t\t}\n\n\t\tvar te = this.elements;\n\n\t\tvar x = euler.x, y = euler.y, z = euler.z;\n\t\tvar a = Math.cos( x ), b = Math.sin( x );\n\t\tvar c = Math.cos( y ), d = Math.sin( y );\n\t\tvar e = Math.cos( z ), f = Math.sin( z );\n\n\t\tif ( euler.order === 'XYZ' ) {\n\n\t\t\tvar ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - c * f;\n\t\t\tte[ 8 ] = d;\n\n\t\t\tte[ 1 ] = af + be * d;\n\t\t\tte[ 5 ] = ae - bf * d;\n\t\t\tte[ 9 ] = - b * c;\n\n\t\t\tte[ 2 ] = bf - ae * d;\n\t\t\tte[ 6 ] = be + af * d;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YXZ' ) {\n\n\t\t\tvar ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce + df * b;\n\t\t\tte[ 4 ] = de * b - cf;\n\t\t\tte[ 8 ] = a * d;\n\n\t\t\tte[ 1 ] = a * f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b;\n\n\t\t\tte[ 2 ] = cf * b - de;\n\t\t\tte[ 6 ] = df + ce * b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZXY' ) {\n\n\t\t\tvar ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce - df * b;\n\t\t\tte[ 4 ] = - a * f;\n\t\t\tte[ 8 ] = de + cf * b;\n\n\t\t\tte[ 1 ] = cf + de * b;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = df - ce * b;\n\n\t\t\tte[ 2 ] = - a * d;\n\t\t\tte[ 6 ] = b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZYX' ) {\n\n\t\t\tvar ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = be * d - af;\n\t\t\tte[ 8 ] = ae * d + bf;\n\n\t\t\tte[ 1 ] = c * f;\n\t\t\tte[ 5 ] = bf * d + ae;\n\t\t\tte[ 9 ] = af * d - be;\n\n\t\t\tte[ 2 ] = - d;\n\t\t\tte[ 6 ] = b * c;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YZX' ) {\n\n\t\t\tvar ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = bd - ac * f;\n\t\t\tte[ 8 ] = bc * f + ad;\n\n\t\t\tte[ 1 ] = f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b * e;\n\n\t\t\tte[ 2 ] = - d * e;\n\t\t\tte[ 6 ] = ad * f + bc;\n\t\t\tte[ 10 ] = ac - bd * f;\n\n\t\t} else if ( euler.order === 'XZY' ) {\n\n\t\t\tvar ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - f;\n\t\t\tte[ 8 ] = d * e;\n\n\t\t\tte[ 1 ] = ac * f + bd;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = ad * f - bc;\n\n\t\t\tte[ 2 ] = bc * f - ad;\n\t\t\tte[ 6 ] = b * e;\n\t\t\tte[ 10 ] = bd * f + ac;\n\n\t\t}\n\n\t\t// bottom row\n\t\tte[ 3 ] = 0;\n\t\tte[ 7 ] = 0;\n\t\tte[ 11 ] = 0;\n\n\t\t// last column\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t},\n\n\tmakeRotationFromQuaternion: function () {\n\n\t\tvar zero = new Vector3( 0, 0, 0 );\n\t\tvar one = new Vector3( 1, 1, 1 );\n\n\t\treturn function makeRotationFromQuaternion( q ) {\n\n\t\t\treturn this.compose( zero, q, one );\n\n\t\t};\n\n\t}(),\n\n\tlookAt: function () {\n\n\t\tvar x = new Vector3();\n\t\tvar y = new Vector3();\n\t\tvar z = new Vector3();\n\n\t\treturn function lookAt( eye, target, up ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tz.subVectors( eye, target );\n\n\t\t\tif ( z.lengthSq() === 0 ) {\n\n\t\t\t\t// eye and target are in the same position\n\n\t\t\t\tz.z = 1;\n\n\t\t\t}\n\n\t\t\tz.normalize();\n\t\t\tx.crossVectors( up, z );\n\n\t\t\tif ( x.lengthSq() === 0 ) {\n\n\t\t\t\t// up and z are parallel\n\n\t\t\t\tif ( Math.abs( up.z ) === 1 ) {\n\n\t\t\t\t\tz.x += 0.0001;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz.z += 0.0001;\n\n\t\t\t\t}\n\n\t\t\t\tz.normalize();\n\t\t\t\tx.crossVectors( up, z );\n\n\t\t\t}\n\n\t\t\tx.normalize();\n\t\t\ty.crossVectors( z, x );\n\n\t\t\tte[ 0 ] = x.x; te[ 4 ] = y.x; te[ 8 ] = z.x;\n\t\t\tte[ 1 ] = x.y; te[ 5 ] = y.y; te[ 9 ] = z.y;\n\t\t\tte[ 2 ] = x.z; te[ 6 ] = y.z; te[ 10 ] = z.z;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}(),\n\n\tmultiply: function ( m, n ) {\n\n\t\tif ( n !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' );\n\t\t\treturn this.multiplyMatrices( m, n );\n\n\t\t}\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t},\n\n\tpremultiply: function ( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t},\n\n\tmultiplyMatrices: function ( a, b ) {\n\n\t\tvar ae = a.elements;\n\t\tvar be = b.elements;\n\t\tvar te = this.elements;\n\n\t\tvar a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ];\n\t\tvar a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ];\n\t\tvar a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ];\n\t\tvar a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ];\n\n\t\tvar b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ];\n\t\tvar b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ];\n\t\tvar b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ];\n\t\tvar b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n\t\tte[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\n\t\treturn this;\n\n\t},\n\n\tmultiplyScalar: function ( s ) {\n\n\t\tvar te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s;\n\t\tte[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s;\n\t\tte[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s;\n\t\tte[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s;\n\n\t\treturn this;\n\n\t},\n\n\tapplyToBufferAttribute: function () {\n\n\t\tvar v1 = new Vector3();\n\n\t\treturn function applyToBufferAttribute( attribute ) {\n\n\t\t\tfor ( var i = 0, l = attribute.count; i < l; i ++ ) {\n\n\t\t\t\tv1.x = attribute.getX( i );\n\t\t\t\tv1.y = attribute.getY( i );\n\t\t\t\tv1.z = attribute.getZ( i );\n\n\t\t\t\tv1.applyMatrix4( this );\n\n\t\t\t\tattribute.setXYZ( i, v1.x, v1.y, v1.z );\n\n\t\t\t}\n\n\t\t\treturn attribute;\n\n\t\t};\n\n\t}(),\n\n\tdeterminant: function () {\n\n\t\tvar te = this.elements;\n\n\t\tvar n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ];\n\t\tvar n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ];\n\t\tvar n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ];\n\t\tvar n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ];\n\n\t\t//TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn (\n\t\t\tn41 * (\n\t\t\t\t+ n14 * n23 * n32\n\t\t\t\t - n13 * n24 * n32\n\t\t\t\t - n14 * n22 * n33\n\t\t\t\t + n12 * n24 * n33\n\t\t\t\t + n13 * n22 * n34\n\t\t\t\t - n12 * n23 * n34\n\t\t\t) +\n\t\t\tn42 * (\n\t\t\t\t+ n11 * n23 * n34\n\t\t\t\t - n11 * n24 * n33\n\t\t\t\t + n14 * n21 * n33\n\t\t\t\t - n13 * n21 * n34\n\t\t\t\t + n13 * n24 * n31\n\t\t\t\t - n14 * n23 * n31\n\t\t\t) +\n\t\t\tn43 * (\n\t\t\t\t+ n11 * n24 * n32\n\t\t\t\t - n11 * n22 * n34\n\t\t\t\t - n14 * n21 * n32\n\t\t\t\t + n12 * n21 * n34\n\t\t\t\t + n14 * n22 * n31\n\t\t\t\t - n12 * n24 * n31\n\t\t\t) +\n\t\t\tn44 * (\n\t\t\t\t- n13 * n22 * n31\n\t\t\t\t - n11 * n23 * n32\n\t\t\t\t + n11 * n22 * n33\n\t\t\t\t + n13 * n21 * n32\n\t\t\t\t - n12 * n21 * n33\n\t\t\t\t + n12 * n23 * n31\n\t\t\t)\n\n\t\t);\n\n\t},\n\n\ttranspose: function () {\n\n\t\tvar te = this.elements;\n\t\tvar tmp;\n\n\t\ttmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp;\n\t\ttmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp;\n\t\ttmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp;\n\n\t\ttmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp;\n\t\ttmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp;\n\t\ttmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp;\n\n\t\treturn this;\n\n\t},\n\n\tsetPosition: function ( x, y, z ) {\n\n\t\tvar te = this.elements;\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tte[ 12 ] = x.x;\n\t\t\tte[ 13 ] = x.y;\n\t\t\tte[ 14 ] = x.z;\n\n\t\t} else {\n\n\t\t\tte[ 12 ] = x;\n\t\t\tte[ 13 ] = y;\n\t\t\tte[ 14 ] = z;\n\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tgetInverse: function ( m, throwOnDegenerate ) {\n\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tvar te = this.elements,\n\t\t\tme = m.elements,\n\n\t\t\tn11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ],\n\t\t\tn12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ],\n\t\t\tn13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ],\n\t\t\tn14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ],\n\n\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\n\t\tvar det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\n\t\tif ( det === 0 ) {\n\n\t\t\tvar msg = \"THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0\";\n\n\t\t\tif ( throwOnDegenerate === true ) {\n\n\t\t\t\tthrow new Error( msg );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( msg );\n\n\t\t\t}\n\n\t\t\treturn this.identity();\n\n\t\t}\n\n\t\tvar detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv;\n\t\tte[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv;\n\t\tte[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv;\n\n\t\tte[ 4 ] = t12 * detInv;\n\t\tte[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv;\n\t\tte[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv;\n\t\tte[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv;\n\n\t\tte[ 8 ] = t13 * detInv;\n\t\tte[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv;\n\t\tte[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv;\n\t\tte[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv;\n\n\t\tte[ 12 ] = t14 * detInv;\n\t\tte[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv;\n\t\tte[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv;\n\t\tte[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv;\n\n\t\treturn this;\n\n\t},\n\n\tscale: function ( v ) {\n\n\t\tvar te = this.elements;\n\t\tvar x = v.x, y = v.y, z = v.z;\n\n\t\tte[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z;\n\t\tte[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z;\n\t\tte[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z;\n\t\tte[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z;\n\n\t\treturn this;\n\n\t},\n\n\tgetMaxScaleOnAxis: function () {\n\n\t\tvar te = this.elements;\n\n\t\tvar scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ];\n\t\tvar scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ];\n\t\tvar scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ];\n\n\t\treturn Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) );\n\n\t},\n\n\tmakeTranslation: function ( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, x,\n\t\t\t0, 1, 0, y,\n\t\t\t0, 0, 1, z,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t},\n\n\tmakeRotationX: function ( theta ) {\n\n\t\tvar c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, c, - s, 0,\n\t\t\t0, s, c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t},\n\n\tmakeRotationY: function ( theta ) {\n\n\t\tvar c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t c, 0, s, 0,\n\t\t\t 0, 1, 0, 0,\n\t\t\t- s, 0, c, 0,\n\t\t\t 0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t},\n\n\tmakeRotationZ: function ( theta ) {\n\n\t\tvar c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0, 0,\n\t\t\ts, c, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t},\n\n\tmakeRotationAxis: function ( axis, angle ) {\n\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\n\t\tvar c = Math.cos( angle );\n\t\tvar s = Math.sin( angle );\n\t\tvar t = 1 - c;\n\t\tvar x = axis.x, y = axis.y, z = axis.z;\n\t\tvar tx = t * x, ty = t * y;\n\n\t\tthis.set(\n\n\t\t\ttx * x + c, tx * y - s * z, tx * z + s * y, 0,\n\t\t\ttx * y + s * z, ty * y + c, ty * z - s * x, 0,\n\t\t\ttx * z - s * y, ty * z + s * x, t * z * z + c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\t return this;\n\n\t},\n\n\tmakeScale: function ( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0, 0,\n\t\t\t0, y, 0, 0,\n\t\t\t0, 0, z, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t},\n\n\tmakeShear: function ( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\t1, y, z, 0,\n\t\t\tx, 1, z, 0,\n\t\t\tx, y, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t},\n\n\tcompose: function ( position, quaternion, scale ) {\n\n\t\tvar te = this.elements;\n\n\t\tvar x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w;\n\t\tvar x2 = x + x,\ty2 = y + y, z2 = z + z;\n\t\tvar xx = x * x2, xy = x * y2, xz = x * z2;\n\t\tvar yy = y * y2, yz = y * z2, zz = z * z2;\n\t\tvar wx = w * x2, wy = w * y2, wz = w * z2;\n\n\t\tvar sx = scale.x, sy = scale.y, sz = scale.z;\n\n\t\tte[ 0 ] = ( 1 - ( yy + zz ) ) * sx;\n\t\tte[ 1 ] = ( xy + wz ) * sx;\n\t\tte[ 2 ] = ( xz - wy ) * sx;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = ( xy - wz ) * sy;\n\t\tte[ 5 ] = ( 1 - ( xx + zz ) ) * sy;\n\t\tte[ 6 ] = ( yz + wx ) * sy;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = ( xz + wy ) * sz;\n\t\tte[ 9 ] = ( yz - wx ) * sz;\n\t\tte[ 10 ] = ( 1 - ( xx + yy ) ) * sz;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = position.x;\n\t\tte[ 13 ] = position.y;\n\t\tte[ 14 ] = position.z;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t},\n\n\tdecompose: function () {\n\n\t\tvar vector = new Vector3();\n\t\tvar matrix = new Matrix4();\n\n\t\treturn function decompose( position, quaternion, scale ) {\n\n\t\t\tvar te = this.elements;\n\n\t\t\tvar sx = vector.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length();\n\t\t\tvar sy = vector.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length();\n\t\t\tvar sz = vector.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length();\n\n\t\t\t// if determine is negative, we need to invert one scale\n\t\t\tvar det = this.determinant();\n\t\t\tif ( det < 0 ) sx = - sx;\n\n\t\t\tposition.x = te[ 12 ];\n\t\t\tposition.y = te[ 13 ];\n\t\t\tposition.z = te[ 14 ];\n\n\t\t\t// scale the rotation part\n\t\t\tmatrix.copy( this );\n\n\t\t\tvar invSX = 1 / sx;\n\t\t\tvar invSY = 1 / sy;\n\t\t\tvar invSZ = 1 / sz;\n\n\t\t\tmatrix.elements[ 0 ] *= invSX;\n\t\t\tmatrix.elements[ 1 ] *= invSX;\n\t\t\tmatrix.elements[ 2 ] *= invSX;\n\n\t\t\tmatrix.elements[ 4 ] *= invSY;\n\t\t\tmatrix.elements[ 5 ] *= invSY;\n\t\t\tmatrix.elements[ 6 ] *= invSY;\n\n\t\t\tmatrix.elements[ 8 ] *= invSZ;\n\t\t\tmatrix.elements[ 9 ] *= invSZ;\n\t\t\tmatrix.elements[ 10 ] *= invSZ;\n\n\t\t\tquaternion.setFromRotationMatrix( matrix );\n\n\t\t\tscale.x = sx;\n\t\t\tscale.y = sy;\n\t\t\tscale.z = sz;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}(),\n\n\tmakePerspective: function ( left, right, top, bottom, near, far ) {\n\n\t\tif ( far === undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' );\n\n\t\t}\n\n\t\tvar te = this.elements;\n\t\tvar x = 2 * near / ( right - left );\n\t\tvar y = 2 * near / ( top - bottom );\n\n\t\tvar a = ( right + left ) / ( right - left );\n\t\tvar b = ( top + bottom ) / ( top - bottom );\n\t\tvar c = - ( far + near ) / ( far - near );\n\t\tvar d = - 2 * far * near / ( far - near );\n\n\t\tte[ 0 ] = x;\tte[ 4 ] = 0;\tte[ 8 ] = a;\tte[ 12 ] = 0;\n\t\tte[ 1 ] = 0;\tte[ 5 ] = y;\tte[ 9 ] = b;\tte[ 13 ] = 0;\n\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = c;\tte[ 14 ] = d;\n\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = - 1;\tte[ 15 ] = 0;\n\n\t\treturn this;\n\n\t},\n\n\tmakeOrthographic: function ( left, right, top, bottom, near, far ) {\n\n\t\tvar te = this.elements;\n\t\tvar w = 1.0 / ( right - left );\n\t\tvar h = 1.0 / ( top - bottom );\n\t\tvar p = 1.0 / ( far - near );\n\n\t\tvar x = ( right + left ) * w;\n\t\tvar y = ( top + bottom ) * h;\n\t\tvar z = ( far + near ) * p;\n\n\t\tte[ 0 ] = 2 * w;\tte[ 4 ] = 0;\tte[ 8 ] = 0;\tte[ 12 ] = - x;\n\t\tte[ 1 ] = 0;\tte[ 5 ] = 2 * h;\tte[ 9 ] = 0;\tte[ 13 ] = - y;\n\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = - 2 * p;\tte[ 14 ] = - z;\n\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = 0;\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t},\n\n\tequals: function ( matrix ) {\n\n\t\tvar te = this.elements;\n\t\tvar me = matrix.elements;\n\n\t\tfor ( var i = 0; i < 16; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t},\n\n\tfromArray: function ( array, offset ) {\n\n\t\tif ( offset === undefined ) offset = 0;\n\n\t\tfor ( var i = 0; i < 16; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\ttoArray: function ( array, offset ) {\n\n\t\tif ( array === undefined ) array = [];\n\t\tif ( offset === undefined ) offset = 0;\n\n\t\tvar te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\t\tarray[ offset + 9 ] = te[ 9 ];\n\t\tarray[ offset + 10 ] = te[ 10 ];\n\t\tarray[ offset + 11 ] = te[ 11 ];\n\n\t\tarray[ offset + 12 ] = te[ 12 ];\n\t\tarray[ offset + 13 ] = te[ 13 ];\n\t\tarray[ offset + 14 ] = te[ 14 ];\n\t\tarray[ offset + 15 ] = te[ 15 ];\n\n\t\treturn array;\n\n\t}\n\n} );\n\n\nexport { Matrix4 };","import { Quaternion } from './Quaternion.js';\nimport { Vector3 } from './Vector3.js';\nimport { Matrix4 } from './Matrix4.js';\nimport { _Math } from './Math.js';\n\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author bhouston / http://clara.io\n */\n\nfunction Euler( x, y, z, order ) {\n\n\tthis._x = x || 0;\n\tthis._y = y || 0;\n\tthis._z = z || 0;\n\tthis._order = order || Euler.DefaultOrder;\n\n}\n\nEuler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ];\n\nEuler.DefaultOrder = 'XYZ';\n\nObject.defineProperties( Euler.prototype, {\n\n\tx: {\n\n\t\tget: function () {\n\n\t\t\treturn this._x;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis._x = value;\n\t\t\tthis._onChangeCallback();\n\n\t\t}\n\n\t},\n\n\ty: {\n\n\t\tget: function () {\n\n\t\t\treturn this._y;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis._y = value;\n\t\t\tthis._onChangeCallback();\n\n\t\t}\n\n\t},\n\n\tz: {\n\n\t\tget: function () {\n\n\t\t\treturn this._z;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis._z = value;\n\t\t\tthis._onChangeCallback();\n\n\t\t}\n\n\t},\n\n\torder: {\n\n\t\tget: function () {\n\n\t\t\treturn this._order;\n\n\t\t},\n\n\t\tset: function ( value ) {\n\n\t\t\tthis._order = value;\n\t\t\tthis._onChangeCallback();\n\n\t\t}\n\n\t}\n\n} );\n\nObject.assign( Euler.prototype, {\n\n\tisEuler: true,\n\n\tset: function ( x, y, z, order ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order || this._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tclone: function () {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._order );\n\n\t},\n\n\tcopy: function ( euler ) {\n\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tsetFromRotationMatrix: function ( m, order, update ) {\n\n\t\tvar clamp = _Math.clamp;\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tvar te = m.elements;\n\t\tvar m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ];\n\t\tvar m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ];\n\t\tvar m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\torder = order || this._order;\n\n\t\tif ( order === 'XYZ' ) {\n\n\t\t\tthis._y = Math.asin( clamp( m13, - 1, 1 ) );\n\n\t\t\tif ( Math.abs( m13 ) < 0.99999 ) {\n\n\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\tthis._z = Math.atan2( - m12, m11 );\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\tthis._z = 0;\n\n\t\t\t}\n\n\t\t} else if ( order === 'YXZ' ) {\n\n\t\t\tthis._x = Math.asin( - clamp( m23, - 1, 1 ) );\n\n\t\t\tif ( Math.abs( m23 ) < 0.99999 ) {\n\n\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\t\t\t\tthis._z = Math.atan2( m21, m22 );\n\n\t\t\t} else {\n\n\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\t\t\t\tthis._z = 0;\n\n\t\t\t}\n\n\t\t} else if ( order === 'ZXY' ) {\n\n\t\t\tthis._x = Math.asin( clamp( m32, - 1, 1 ) );\n\n\t\t\tif ( Math.abs( m32 ) < 0.99999 ) {\n\n\t\t\t\tthis._y = Math.atan2( - m31, m33 );\n\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t} else {\n\n\t\t\t\tthis._y = 0;\n\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t}\n\n\t\t} else if ( order === 'ZYX' ) {\n\n\t\t\tthis._y = Math.asin( - clamp( m31, - 1, 1 ) );\n\n\t\t\tif ( Math.abs( m31 ) < 0.99999 ) {\n\n\t\t\t\tthis._x = Math.atan2( m32, m33 );\n\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t}\n\n\t\t} else if ( order === 'YZX' ) {\n\n\t\t\tthis._z = Math.asin( clamp( m21, - 1, 1 ) );\n\n\t\t\tif ( Math.abs( m21 ) < 0.99999 ) {\n\n\t\t\t\tthis._x = Math.atan2( - m23, m22 );\n\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\n\t\t\t}\n\n\t\t} else if ( order === 'XZY' ) {\n\n\t\t\tthis._z = Math.asin( - clamp( m12, - 1, 1 ) );\n\n\t\t\tif ( Math.abs( m12 ) < 0.99999 ) {\n\n\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\tthis._y = Math.atan2( m13, m11 );\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\tthis._y = 0;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + order );\n\n\t\t}\n\n\t\tthis._order = order;\n\n\t\tif ( update !== false ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\tsetFromQuaternion: function () {\n\n\t\tvar matrix = new Matrix4();\n\n\t\treturn function setFromQuaternion( q, order, update ) {\n\n\t\t\tmatrix.makeRotationFromQuaternion( q );\n\n\t\t\treturn this.setFromRotationMatrix( matrix, order, update );\n\n\t\t};\n\n\t}(),\n\n\tsetFromVector3: function ( v, order ) {\n\n\t\treturn this.set( v.x, v.y, v.z, order || this._order );\n\n\t},\n\n\treorder: function () {\n\n\t\t// WARNING: this discards revolution information -bhouston\n\n\t\tvar q = new Quaternion();\n\n\t\treturn function reorder( newOrder ) {\n\n\t\t\tq.setFromEuler( this );\n\n\t\t\treturn this.setFromQuaternion( q, newOrder );\n\n\t\t};\n\n\t}(),\n\n\tequals: function ( euler ) {\n\n\t\treturn ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order );\n\n\t},\n\n\tfromArray: function ( array ) {\n\n\t\tthis._x = array[ 0 ];\n\t\tthis._y = array[ 1 ];\n\t\tthis._z = array[ 2 ];\n\t\tif ( array[ 3 ] !== undefined ) this._order = array[ 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t},\n\n\ttoArray: function ( array, offset ) {\n\n\t\tif ( array === undefined ) array = [];\n\t\tif ( offset === undefined ) offset = 0;\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._order;\n\n\t\treturn array;\n\n\t},\n\n\ttoVector3: function ( optionalResult ) {\n\n\t\tif ( optionalResult ) {\n\n\t\t\treturn optionalResult.set( this._x, this._y, this._z );\n\n\t\t} else {\n\n\t\t\treturn new Vector3( this._x, this._y, this._z );\n\n\t\t}\n\n\t},\n\n\t_onChange: function ( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t},\n\n\t_onChangeCallback: function () {}\n\n} );\n\n\nexport { Euler };","import { Vector3 } from '../core/three/';\n\nexport default {\n toScreenPos: (function() {\n var vector = new Vector3();\n\n return function(pos, camera, canvas) {\n vector.copy(pos);\n // map to normalized device coordinate (NDC) space\n vector.project(camera);\n // map to 2D screen space\n vector.x = Math.round(((vector.x + 1) * canvas.width) / 2);\n vector.y = Math.round(((-vector.y + 1) * canvas.height) / 2);\n vector.z = 0;\n\n return vector;\n };\n })(),\n\n toSpacePos: (function() {\n var vector = new Vector3(),\n dir = new Vector3(),\n distance;\n\n return function(pos, camera, canvas) {\n vector.set(\n (pos.x / canvas.width) * 2 - 1,\n -(pos.y / canvas.height) * 2 + 1,\n 0.5\n );\n vector.unproject(camera);\n\n dir.copy(vector.sub(camera.position).normalize());\n distance = -camera.position.z / dir.z;\n vector.copy(camera.position);\n vector.add(dir.multiplyScalar(distance));\n\n return vector;\n };\n })(),\n};\n","export default {\n initValue: function(value, defaults) {\n var _value = value != null && value != undefined ? value : defaults;\n\n return _value;\n },\n\n isArray: function(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n },\n\n destroyArray: function(array) {\n array.length = 0;\n },\n\n destroyObject: function(obj) {\n for (var o in obj) delete obj[o];\n },\n\n isUndefined: function() {\n for (var id in arguments) {\n var arg = arguments[id];\n\n if (arg !== undefined) return false;\n }\n\n return true;\n },\n\n setVectorByObj: function(target, pOBJ) {\n if (pOBJ['x'] !== undefined) target.position.x = pOBJ['x'];\n if (pOBJ['y'] !== undefined) target.position.y = pOBJ['y'];\n if (pOBJ['z'] !== undefined) target.position.z = pOBJ['z'];\n\n if (pOBJ['vx'] !== undefined) target.velocity.x = pOBJ['vx'];\n if (pOBJ['vy'] !== undefined) target.velocity.y = pOBJ['vy'];\n if (pOBJ['vz'] !== undefined) target.velocity.z = pOBJ['vz'];\n\n if (pOBJ['ax'] !== undefined) target.acceleration.x = pOBJ['ax'];\n if (pOBJ['ay'] !== undefined) target.acceleration.y = pOBJ['ay'];\n if (pOBJ['az'] !== undefined) target.acceleration.z = pOBJ['az'];\n\n if (pOBJ['p'] !== undefined) target.position.copy(pOBJ['p']);\n if (pOBJ['v'] !== undefined) target.velocity.copy(pOBJ['v']);\n if (pOBJ['a'] !== undefined) target.acceleration.copy(pOBJ['a']);\n\n if (pOBJ['position'] !== undefined) target.position.copy(pOBJ['position']);\n if (pOBJ['velocity'] !== undefined) target.velocity.copy(pOBJ['velocity']);\n if (pOBJ['accelerate'] !== undefined)\n target.acceleration.copy(pOBJ['accelerate']);\n },\n\n //set prototype\n setPrototypeByObj: function(target, proObj, filters) {\n for (var key in proObj) {\n // eslint-disable-next-line no-prototype-builtins\n if (target.hasOwnProperty(key)) {\n if (filters) {\n if (filters.indexOf(key) < 0)\n target[key] = this._getValue(proObj[key]);\n } else {\n target[key] = this._getValue(proObj[key]);\n }\n }\n }\n\n return target;\n },\n\n _getValue: function(pan) {\n if (pan.constructor.type === 'Span') return pan.getValue();\n else return pan;\n },\n};\n","import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","import rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nconst _state = {};\nfunction v1(options, buf, offset) {\n let bytes;\n const isV6 = options?._v6 ?? false;\n if (options) {\n const optionsKeys = Object.keys(options);\n if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') {\n options = undefined;\n }\n }\n if (options) {\n bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset);\n }\n else {\n const now = Date.now();\n const rnds = rng();\n updateV1State(_state, now, rnds);\n bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset);\n }\n return buf ?? unsafeStringify(bytes);\n}\nexport function updateV1State(state, now, rnds) {\n state.msecs ??= -Infinity;\n state.nsecs ??= 0;\n if (now === state.msecs) {\n state.nsecs++;\n if (state.nsecs >= 10000) {\n state.node = undefined;\n state.nsecs = 0;\n }\n }\n else if (now > state.msecs) {\n state.nsecs = 0;\n }\n else if (now < state.msecs) {\n state.node = undefined;\n }\n if (!state.node) {\n state.node = rnds.slice(10, 16);\n state.node[0] |= 0x01;\n state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff;\n }\n state.msecs = now;\n return state;\n}\nfunction v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) {\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n if (!buf) {\n buf = new Uint8Array(16);\n offset = 0;\n }\n else {\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n }\n msecs ??= Date.now();\n nsecs ??= 0;\n clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff;\n node ??= rnds.slice(10, 16);\n msecs += 12219292800000;\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n buf[offset++] = (tl >>> 24) & 0xff;\n buf[offset++] = (tl >>> 16) & 0xff;\n buf[offset++] = (tl >>> 8) & 0xff;\n buf[offset++] = tl & 0xff;\n const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff;\n buf[offset++] = (tmh >>> 8) & 0xff;\n buf[offset++] = tmh & 0xff;\n buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10;\n buf[offset++] = (tmh >>> 16) & 0xff;\n buf[offset++] = (clockseq >>> 8) | 0x80;\n buf[offset++] = clockseq & 0xff;\n for (let n = 0; n < 6; ++n) {\n buf[offset++] = node[n];\n }\n return buf;\n}\nexport default v1;\n","import { v1 as uid } from 'uuid';\n\nexport default uid;\n","export { default as ColorUtil } from './ColorUtil';\nexport { default as PUID } from './PUID';\nexport { default as THREEUtil } from './THREEUtil';\nexport { default as Util } from './Util';\nexport { default as uid } from './uid';\n\nexport const withDefaults = (defaults, properties) => ({\n ...defaults,\n ...properties,\n});\n","import { PI } from '../constants';\n\nexport default {\n randomAToB: function(a, b, INT) {\n if (!INT) return a + Math.random() * (b - a);\n else return ((Math.random() * (b - a)) >> 0) + a;\n },\n randomFloating: function(center, f, INT) {\n return this.randomAToB(center - f, center + f, INT);\n },\n\n randomZone: function(display) {}, //eslint-disable-line\n\n degreeTransform: function(a) {\n return (a * PI) / 180;\n },\n\n toColor16: function getRGB(num) {\n return '#' + num.toString(16);\n },\n\n randomColor: function() {\n return (\n '#' +\n ('00000' + ((Math.random() * 0x1000000) << 0).toString(16)).slice(-6)\n );\n },\n\n lerp: function(a, b, energy) {\n return b + (a - b) * energy;\n },\n\n getNormal: function(v, n) {\n if (v.x == 0 && v.y == 0) {\n if (v.z == 0) n.set(1, 0, 1);\n else n.set(1, 1, -v.y / v.z);\n } else {\n if (v.x == 0) n.set(1, 0, 1);\n else n.set(-v.y / v.x, 1, 1);\n }\n\n return n.normalize();\n },\n\n /**\n * Rodrigues' Rotation Formula\n * https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula\n * v′ = vcos(θ) + k(k⋅v)(1−cos(θ)) + (k*v)sin(θ)\n */\n axisRotate: function(v0, v, k, tha) {\n var cos = Math.cos(tha);\n var sin = Math.sin(tha);\n var p = k.dot(v) * (1 - cos);\n\n v0.copy(k);\n v0.cross(v).scalar(sin);\n v0.addValue(v.x * cos, v.y * cos, v.z * cos);\n v0.addValue(k.x * p, k.y * p, k.z * p);\n }\n};\n","export const MATH_TYPE_ARRAY_SPAN = 'ArraySpan';\nexport const MATH_TYPE_COLOR_SPAN = 'ColorSpan';\nexport const MATH_TYPE_BOX = 'Box';\nexport const MATH_TYPE_POLAR_3D = 'Polar3D';\nexport const MATH_TYPE_SPAN = 'Span';\nexport const MATH_TYPE_VECTOR_3D = 'Vector3D';\n","import MathUtils from './MathUtils';\nimport Util from '../utils/Util';\nimport { MATH_TYPE_SPAN as type } from './types';\n\nexport default class Span {\n /**\n * Span Class. Get a random Number from a to b. Or from c-a to c+b\n * @param {Number|Array} a - min number\n * @param {Number} b - max number\n * @param {Number} center - the center's z value\n * @example\n * var span = new Span(0,30);\n * or\n * var span = new Span([\"#fff\",\"#ff0\",\"#000\"]);\n * or\n * var span = new Span(5,1,\"center\");\n * @extends {Zone}\n * @constructor\n */\n constructor(a, b, center) {\n this._isArray = false;\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n\n if (Util.isArray(a)) {\n this._isArray = true;\n this.a = a;\n } else {\n this.a = Util.initValue(a, 1);\n this.b = Util.initValue(b, this.a);\n this._center = Util.initValue(center, false);\n }\n }\n\n /**\n * Span.getValue function\n * @name get a random Number from a to b. Or get a random Number from c-a to c+b\n * @param {number} INT or int\n * @return {number} a random Number\n */\n getValue(INT) {\n if (this._isArray) {\n return this.a[(this.a.length * Math.random()) >> 0];\n } else {\n if (!this._center) return MathUtils.randomAToB(this.a, this.b, INT);\n else return MathUtils.randomFloating(this.a, this.b, INT);\n }\n }\n}\n\nexport const createSpan = (a, b, c) => {\n if (a instanceof Span) return a;\n\n if (b === undefined) {\n return new Span(a);\n } else {\n if (c === undefined) return new Span(a, b);\n else return new Span(a, b, c);\n }\n};\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor,\n nativeRandom = Math.random;\n\n/**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\nfunction baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n}\n\nmodule.exports = baseRandom;\n","var baseRandom = require('./_baseRandom');\n\n/**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\nfunction arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n}\n\nmodule.exports = arraySample;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var baseValues = require('./_baseValues'),\n keys = require('./keys');\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","var arraySample = require('./_arraySample'),\n values = require('./values');\n\n/**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\nfunction baseSample(collection) {\n return arraySample(values(collection));\n}\n\nmodule.exports = baseSample;\n","var arraySample = require('./_arraySample'),\n baseSample = require('./_baseSample'),\n isArray = require('./isArray');\n\n/**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\nfunction sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n}\n\nmodule.exports = sample;\n","import Span from './Span';\nimport sample from 'lodash/sample';\nimport { MATH_TYPE_ARRAY_SPAN as type } from './types';\n\n/**\n * Class for storing items of mixed type and fetching a randomised\n * value from these items.\n *\n */\nexport default class ArraySpan extends Span {\n /**\n * Constructs an ArraySpan instance.\n *\n * @param {mixed|array<mixed>} items - Items\n * @return void\n */\n constructor(items) {\n super();\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n\n /**\n * @desc An array of colors\n * @type {array}\n */\n this.items = Array.isArray(items) ? items : [items];\n }\n\n /**\n * Gets a random item.\n *\n * @return {mixed}\n */\n getValue() {\n return sample(this.items);\n }\n}\n\n/**\n * Attempts to create an ArraySpan from the items provided.\n *\n * @param {mixed} items - Items to try and create an ArraySpan from\n * @return {?ArraySpan}\n */\nexport const createArraySpan = items => {\n if (!items) {\n return null;\n }\n\n if (items instanceof ArraySpan) {\n return items;\n }\n\n return new ArraySpan(items);\n};\n","import MathUtils from './MathUtils';\nimport Span from './Span';\nimport sample from 'lodash/sample';\nimport { MATH_TYPE_COLOR_SPAN as type } from './types';\n\n/**\n * Class for storing and interacting with an array of colours.\n *\n */\nexport default class ColorSpan extends Span {\n /**\n * Constructs a ColorSpan instance.\n *\n * @param {string|array<string>} colors - A color or array of colors. If the\n * string 'random' is provided, a random color will be returned from getValue\n * @return void\n */\n constructor(colors) {\n super();\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n\n /**\n * @desc Determines if a random color should be returned from the getValue method.\n * @type {boolean}\n */\n this.shouldRandomize = colors === 'random' ? true : false;\n\n /**\n * @desc An array of colors to select from\n * @type {array<string>}\n */\n this.colors = Array.isArray(colors) ? colors : [colors];\n }\n\n /**\n * Gets a color from the color array\n * or a random color if this.shouldRandomize is true.\n *\n * @return {string} a hex color\n */\n getValue() {\n return this.shouldRandomize ? MathUtils.randomColor() : sample(this.colors);\n }\n}\n\n/**\n * Attempts to create an ArraySpan from the colors provided.\n *\n * @param {mixed} colors - colors to try and create an ArraySpan from\n * @return {?ColorSpan}\n */\nexport const createColorSpan = colors => {\n if (!colors) {\n console.warn(\n `Invalid colors argument ${colors} passed to createColorSpan. Defaulting to 'random'.`\n );\n\n colors = 'random';\n }\n\n if (colors instanceof ColorSpan) {\n return colors;\n }\n\n return new ColorSpan(colors);\n};\n","import { MATH_TYPE_BOX as type } from './types';\n\nexport default class Box {\n constructor(x, y, z, w, h, d) {\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n this.x = x;\n this.y = y;\n this.z = z;\n this.width = w;\n this.height = h;\n this.depth = d;\n this.bottom = this.y + this.height;\n this.right = this.x + this.width;\n this.right = this.x + this.width;\n }\n\n contains(x, y, z) {\n if (\n x <= this.right &&\n x >= this.x &&\n y <= this.bottom &&\n y >= this.y &&\n z <= this.depth &&\n z >= this.z\n )\n return true;\n else return false;\n }\n}\n","/**\n * @see https://en.wikipedia.org/wiki/Euler_method\n * @type {string}\n */\nexport const INTEGRATION_TYPE_EULER = 'EULER';\n\n/**\n * @see http://web.mit.edu/10.001/Web/Course_Notes/Differential_Equations_Notes/node5.html\n * @type {string}\n */\nexport const INTEGRATION_TYPE_RK2 = 'RUNGE_KUTTA_2';\n\n/**\n * @see http://web.mit.edu/10.001/Web/Course_Notes/Differential_Equations_Notes/node5.html\n * @type {string}\n */\nexport const INTEGRATION_TYPE_RK4 = 'RUNGE_KUTTA_4';\n\n/**\n * @see https://en.wikipedia.org/wiki/Verlet_integration\n * @type {string}\n */\nexport const INTEGRATION_TYPE_VERLET = 'VERLET';\n","import { INTEGRATION_TYPE_EULER } from './constants';\nimport { DEFAULT_SYSTEM_DELTA } from '../core/constants';\n\n/**\n * Performs euler integration on the particle.\n *\n * @param {Particle} particle - The particle to integrate\n * @param {number} time - The factor of time to use\n * @param {number} damping - The damping to use\n * @return void\n */\nconst eulerIntegration = (particle, time, damping) => {\n if (particle.sleep) {\n return;\n }\n\n particle.old.position.copy(particle.position);\n particle.old.velocity.copy(particle.velocity);\n particle.acceleration.scalar(1 / particle.mass);\n particle.velocity.add(particle.acceleration.scalar(time));\n particle.position.add(particle.old.velocity.scalar(time));\n damping &&\n particle.velocity.scalar(Math.pow(damping, time / DEFAULT_SYSTEM_DELTA));\n particle.acceleration.clear();\n};\n\n/**\n * Performs the chosen integration on the particle.\n * Defaults to euler integration.\n *\n * @param {Particle} particle - The particle to integrate\n * @param {number} time - The factor of time to use\n * @param {number} damping - The damping to use\n * @param {string} [type=INTEGRATION_TYPE_EULER] - The algorithm to use\n * @return void\n */\nexport const integrate = (\n particle,\n time,\n damping,\n type = INTEGRATION_TYPE_EULER\n) => {\n switch (type) {\n case INTEGRATION_TYPE_EULER:\n eulerIntegration(particle, time, damping);\n break;\n default:\n eulerIntegration(particle, time, damping);\n }\n};\n","import { Euler, Vector3 } from '../core/three/';\n\nexport default class Vector3D extends Vector3 {\n clear() {\n this.x = 0.0;\n this.y = 0.0;\n this.z = 0.0;\n\n return this;\n }\n\n scalar(s) {\n this.x *= s;\n this.y *= s;\n this.z *= s;\n\n return this;\n }\n\n addValue(a, b, c) {\n this.x += a;\n this.y += b;\n this.z += c;\n\n return this;\n }\n\n toString() {\n return 'x:' + this.x + 'y:' + this.y + 'z:' + this.z;\n }\n\n eulerFromDir(vector3D) {\n const euler = new Euler();\n\n return euler.setFromVector3(vector3D);\n }\n}\n","import Vector3D from './Vector3D';\nimport { MATH_TYPE_POLAR_3D as type } from './types';\n\nexport default class Polar3D {\n constructor(radius, theta, phi) {\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n this.radius = radius || 1;\n this.phi = phi || 0;\n this.theta = theta || 0;\n }\n\n set(radius, theta, phi) {\n this.radius = radius || 1;\n this.phi = phi || 0;\n this.theta = theta || 0;\n\n return this;\n }\n\n setRadius(radius) {\n this.radius = radius;\n\n return this;\n }\n\n setPhi(phi) {\n this.phi = phi;\n\n return this;\n }\n\n setTheta(theta) {\n this.theta = theta;\n\n return this;\n }\n\n copy(p) {\n this.radius = p.radius;\n this.phi = p.phi;\n this.theta = p.theta;\n\n return this;\n }\n\n toVector3D() {\n return new Vector3D(this.getX(), this.getY(), this.getZ());\n }\n\n getX() {\n return this.radius * Math.sin(this.theta) * Math.cos(this.phi);\n }\n\n getY() {\n return -this.radius * Math.sin(this.theta) * Math.sin(this.phi);\n }\n\n getZ() {\n return this.radius * Math.cos(this.theta);\n }\n\n normalize() {\n this.radius = 1;\n\n return this;\n }\n\n equals(v) {\n return (\n v.radius === this.radius && v.phi === this.phi && v.theta === this.theta\n );\n }\n\n clear() {\n this.radius = 0.0;\n this.phi = 0.0;\n this.theta = 0.0;\n\n return this;\n }\n\n clone() {\n return new Polar3D(this.radius, this.phi, this.theta);\n }\n}\n","export const CORE_TYPE_PARTICLE = 'Particle';\nexport const CORE_TYPE_POOL = 'Pool';\nexport const CORE_TYPE_SYSTEM = 'System';\n","import {\n DEFAULT_AGE,\n DEFAULT_ALPHA,\n DEFAULT_BODY,\n DEFAULT_DEAD,\n DEFAULT_EASING,\n DEFAULT_ENERGY,\n DEFAULT_LIFE,\n DEFAULT_MASS,\n DEFAULT_PARENT,\n DEFAULT_RADIUS,\n DEFAULT_SCALE,\n DEFAULT_SLEEP,\n DEFAULT_USE_ALPHA,\n DEFAULT_USE_COLOR,\n} from './constants';\nimport { Util, uid } from '../utils';\n\nimport { PI } from '../constants';\nimport { Vector3D } from '../math';\nimport { CORE_TYPE_PARTICLE as type } from './types';\n\n/**\n * A Particle is an object that is emitted by an emitter.\n *\n */\nexport default class Particle {\n /**\n * Constructs a Particle instance.\n *\n * @param {object} properties - The properties to instantiate the particle with\n * @property {number} properties.life - The particle's life\n * @property {number} properties.age - The particle's age\n * @property {number} properties.energy - The particle's energy loss\n * @property {boolean} properties.dead - Determines if the particle is dead or not\n * @property {boolean} properties.sleep - Determines if the particle is sleeping or not\n * @property {object} properties.target - The particle's target\n * @property {object} properties.body - The particle's body\n * @property {number} properties.mass - The particle's mass\n * @property {number} properties.radius - The particle's radius\n * @property {number} properties.alpha - The particle's alpha\n * @property {number} properties.scale - The particle's scale\n * @property {number} properties.rotation - The particle's rotation\n * @property {string|number} properties.color - The particle's color\n * @property {function} properties.easing - The particle's easing\n * @property {Vector3D} properties.position - The particle's position\n * @property {Vector3D} properties.velocity - The particle's velocity\n * @property {Vector3D} properties.acceleration - The particle's acceleration\n * @property {array} properties.behaviours - The particle's behaviours array\n * @property {object} properties.transform - The particle's transform collection\n * @return void\n */\n constructor(properties) {\n /**\n * @desc The particle's unique id\n * @type {number}\n */\n this.id = `particle-${uid()}`;\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n /**\n * @desc The particle's life\n * @type {number}\n */\n this.life = DEFAULT_LIFE;\n /**\n * @desc The particle's age\n * @type {number}\n */\n this.age = DEFAULT_AGE;\n /**\n * @desc The particle's energy loss\n * @type {number}\n */\n this.energy = DEFAULT_ENERGY;\n /**\n * @desc Determines if the particle is dead or not\n * @type {number}\n */\n this.dead = DEFAULT_DEAD;\n /**\n * @desc Determines if the particle is sleeping or not\n * @type {number}\n */\n this.sleep = DEFAULT_SLEEP;\n /**\n * @desc The particle's body\n * @type {object}\n */\n this.body = DEFAULT_BODY;\n /**\n * @desc The particle's parent\n * @type {?Emitter}\n */\n this.parent = DEFAULT_PARENT;\n /**\n * @desc The particle's mass\n * @type {number}\n */\n this.mass = DEFAULT_MASS;\n /**\n * @desc The particle's radius\n * @type {number}\n */\n this.radius = DEFAULT_RADIUS;\n /**\n * @desc The particle's alpha\n * @type {number}\n */\n this.alpha = DEFAULT_ALPHA;\n /**\n * @desc The particle's scale\n * @type {number}\n */\n this.scale = DEFAULT_SCALE;\n /**\n * @desc Determines whether to use color or not\n * @type {boolean}\n */\n this.useColor = DEFAULT_USE_COLOR;\n /**\n * @desc Determines whether to use alpha or not\n * @type {boolean}\n */\n this.useAlpha = DEFAULT_USE_ALPHA;\n /**\n * @desc The particle's easing\n * @type {string}\n */\n this.easing = DEFAULT_EASING;\n /**\n * @desc The particle's position\n * @type {Vector3D}\n */\n this.position = new Vector3D();\n /**\n * @desc The particle's velocity\n * @type {Vector3D}\n */\n this.velocity = new Vector3D();\n /**\n * @desc The particle's acceleration\n * @type {Vector3D}\n */\n this.acceleration = new Vector3D();\n /**\n * @desc The particle's last position, velocity and acceleration\n * @type {Vector3D}\n */\n this.old = {};\n /**\n * @desc The particle's old position\n * @type {Vector3D}\n */\n this.old.position = this.position.clone();\n /**\n * @desc The particle's old velocity\n * @type {Vector3D}\n */\n this.old.velocity = this.velocity.clone();\n /**\n * @desc The particle's old acceleration\n * @type {Vector3D}\n */\n this.old.acceleration = this.acceleration.clone();\n /**\n * @desc The particle's behaviours array\n * @type {array}\n */\n this.behaviours = [];\n /**\n * @desc The particle's transform collection\n * @type {object}\n */\n this.transform = {};\n /**\n * @desc The particle's color store\n * @type {object}\n */\n this.color = { r: 0, g: 0, b: 0 };\n /**\n * @desc The particle's rotation\n * @type {number}\n */\n this.rotation = new Vector3D();\n\n /**\n * @desc The particle's distance to the camera, only set by the GPURenderer for depth sorting purposes.\n * @type {number}\n */\n this.distanceToCamera = 0;\n\n // override constructor props with passed properties.\n Util.setPrototypeByObj(this, properties);\n }\n\n /**\n * Gets the particle's current direction.\n *\n * @return {number}\n */\n getDirection() {\n return Math.atan2(this.velocity.x, -this.velocity.y) * (180 / PI);\n }\n\n /**\n * Resets the particle's default properties and clear's its particle's position,\n * velocity, acceleration, color and rotation. Also destroy's the particle's\n * transform collection & removes all behaviours.\n *\n * @return {Particle}\n */\n reset() {\n this.life = DEFAULT_LIFE;\n this.age = DEFAULT_AGE;\n this.energy = DEFAULT_ENERGY;\n this.dead = DEFAULT_DEAD;\n this.sleep = DEFAULT_SLEEP;\n this.body = DEFAULT_BODY;\n this.parent = DEFAULT_PARENT;\n this.mass = DEFAULT_MASS;\n this.radius = DEFAULT_RADIUS;\n this.alpha = DEFAULT_ALPHA;\n this.scale = DEFAULT_SCALE;\n this.useColor = DEFAULT_USE_COLOR;\n this.useAlpha = DEFAULT_USE_ALPHA;\n this.easing = DEFAULT_EASING;\n this.position.set(0, 0, 0);\n this.velocity.set(0, 0, 0);\n this.acceleration.set(0, 0, 0);\n this.old.position.set(0, 0, 0);\n this.old.velocity.set(0, 0, 0);\n this.old.acceleration.set(0, 0, 0);\n this.color.r = 0;\n this.color.g = 0;\n this.color.b = 0;\n\n this.rotation.clear();\n Util.destroyObject(this.transform);\n this.removeAllBehaviours();\n\n return this;\n }\n\n /**\n * Updates the particle's properties by applying each behaviour to the particle.\n * Will also update the particle's energy, unless it's age is greater than it's life\n * in which case it will be destroyed.\n *\n * @param {number} time - Integration time\n * @param {integer} index - Particle index\n * @return void\n */\n update(time, index) {\n if (!this.sleep) {\n this.age += time;\n\n let i = this.behaviours.length;\n\n while (i--) {\n let behaviour = this.behaviours[i];\n\n //behaviour && \n behaviour.applyBehaviour(this, time, index);\n }\n }\n\n if (this.age >= this.life) {\n this.destroy();\n } else {\n const scale = this.easing(this.age / this.life);\n\n this.energy = Math.max(1 - scale, 0);\n }\n }\n\n /**\n * Adds a behaviour to the particle.\n *\n * @param {Behaviour} behaviour - The behaviour to add to the particle\n * @return void\n */\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n behaviour.initialize(this);\n }\n\n /**\n * Adds multiple behaviours to the particle.\n *\n * @param {array<Behaviour>} behaviours - An array of behaviours to add to the particle\n * @return void\n */\n addBehaviours(behaviours) {\n let i = behaviours.length;\n\n while (i--) {\n this.addBehaviour(behaviours[i]);\n }\n }\n\n /**\n * Removes the behaviour from the particle.\n *\n * @param {Behaviour} behaviour - The behaviour to remove from the particle\n * @return void\n */\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n this.behaviours.splice(index, 1);\n }\n }\n\n /**\n * Removes all behaviours from the particle.\n *\n * @return void\n */\n removeAllBehaviours() {\n Util.destroyArray(this.behaviours);\n }\n\n /**\n * Destroys the particle.\n *\n * @return void\n */\n destroy() {\n this.removeAllBehaviours();\n this.energy = 0;\n this.dead = true;\n this.parent = null;\n }\n}\n","import PUID from '../utils/PUID';\nimport { CORE_TYPE_POOL as type } from './types';\n/**\n * An object pool implementation. Used for pooling objects to avoid unnecessary\n * garbage collection.\n *\n */\nexport default class Pool {\n /**\n * Constructs a Pool instance.\n *\n * @return void\n */\n constructor() {\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n /**\n * @desc Incrementing id that keeps a count of the number of objects created\n * @type {integer}\n */\n this.cID = 0;\n\n /**\n * @desc Map of pools in the format of PUID<String>: pool<Array>\n * @type {object}\n */\n this.list = {};\n }\n\n /**\n * Attempts to create a new object either by creating a new instance or calling its\n * clone method.\n *\n * TODO COVERAGE - for the constructorArgs\n * @param {function|object} functionOrObject - The object to instantiate or clone\n * @return {object|undefined}\n */\n create(functionOrObject, ...constructorArgs) {\n if (!this.canCreateNewObject(functionOrObject)) {\n throw new Error(\n 'The pool is unable to create or clone the object supplied'\n );\n }\n\n this.cID++;\n\n if (this.canInstantiateObject(functionOrObject)) {\n return new functionOrObject(...constructorArgs);\n }\n\n if (this.canCloneObject(functionOrObject)) {\n return functionOrObject.clone();\n }\n }\n\n /**\n * Determines if the object is able to be instantiated or not.\n *\n * @param {object} object - The object to check\n * @return {boolean}\n */\n canInstantiateObject(object) {\n return typeof object === 'function';\n }\n\n /**\n * Determines if the object is able to be cloned or not.\n *\n * @param {object} object - The object to check\n * @return {boolean}\n */\n canCloneObject(object) {\n return object.clone && typeof object.clone === 'function';\n }\n\n /**\n * Determines if a new object is able to be created.\n *\n * @param {object} object - The object to check\n * @return {boolean}\n */\n canCreateNewObject(object) {\n return this.canInstantiateObject(object) || this.canCloneObject(object)\n ? true\n : false;\n }\n\n /**\n * Gets a count of all objects in the pool.\n *\n * @return {integer}\n */\n getCount() {\n var count = 0;\n\n for (var id in this.list) count += this.list[id].length;\n\n return count++;\n }\n\n /**\n * Gets an object either by creating a new one or retrieving it from the pool.\n *\n * @param {function|object} obj - The function or object to get\n * @param {array} args - The args to pass to the function on creation\n * @return {object}\n */\n get(obj, ...args) {\n var p,\n puid = obj.__puid || PUID.id(obj);\n\n if (this.list[puid] && this.list[puid].length > 0)\n p = this.list[puid].pop();\n else p = this.create(obj, ...args);\n\n p.__puid = obj.__puid || puid;\n\n return p;\n }\n\n /**\n * Pushes an object into the pool.\n *\n * @param {object} obj - The object to expire\n * @return {integer}\n */\n expire(obj) {\n return this._getList(obj.__puid).push(obj);\n }\n\n /**\n * Destroys all pools.\n *\n * @return void\n */\n destroy() {\n for (var id in this.list) {\n this.list[id].length = 0;\n delete this.list[id];\n }\n }\n\n /**\n * Gets the pool mapped to the UID.\n *\n * @param {string} uid - The pool uid\n * @return {array}\n */\n _getList(uid) {\n uid = uid || 'default';\n if (!this.list[uid]) this.list[uid] = [];\n\n return this.list[uid];\n }\n}\n","/*\n * EventDispatcher\n * Visit http://createjs.com/ for documentation, updates and examples.\n *\n **/\n\nexport default class EventDispatcher {\n constructor() {\n this.listeners = null;\n }\n\n set listeners(listeners) {\n this._listeners = listeners;\n }\n\n get listeners() {\n return this._listeners;\n }\n\n addEventListener(type, listener) {\n if (!this.listeners) {\n this.listeners = {};\n } else {\n this.removeEventListener(type, listener);\n }\n\n if (!this.listeners[type]) this.listeners[type] = [];\n this.listeners[type].push(listener);\n\n return listener;\n }\n\n removeEventListener(type, listener) {\n if (!this.listeners) return;\n if (!this.listeners[type]) return;\n\n var arr = this.listeners[type];\n\n for (var i = 0, l = arr.length; i < l; i++) {\n if (arr[i] == listener) {\n if (l == 1) {\n delete this.listeners[type];\n }\n // allows for faster checks.\n else {\n arr.splice(i, 1);\n }\n break;\n }\n }\n }\n\n removeAllEventListeners(type) {\n if (!type) this.listeners = null;\n else if (this.listeners) delete this.listeners[type];\n }\n\n dispatchEvent(eventName, eventTarget) {\n var ret = false,\n listeners = this.listeners;\n\n if (eventName && listeners) {\n var arr = listeners[eventName];\n\n if (!arr) return ret;\n\n arr = arr.slice(); //Should use a copy into a temporary here instead...\n // to avoid issues with items being removed or added during the dispatch\n\n var handler,\n i = arr.length;\n\n while (i--) {\n handler = arr[i];\n\n ret = ret || handler(eventTarget);\n }\n }\n\n return !!ret;\n }\n\n hasEventListener(type) {\n var listeners = this.listeners;\n\n return !!(listeners && listeners[type]);\n }\n}\n","export const SYSTEM_UPDATE = 'SYSTEM_UPDATE';\nexport const PARTICLE_CREATED = 'PARTICLE_CREATED';\nexport const PARTICLE_UPDATE = 'PARTICLE_UPDATE';\nexport const PARTICLE_DEAD = 'PARTICLE_DEAD';\nexport const EMITTER_ADDED = 'EMITTER_ADDED';\nexport const EMITTER_REMOVED = 'EMITTER_REMOVED';\nexport const EMITTER_DEAD = 'EMITTER_DEAD';\nexport const SYSTEM_UPDATE_AFTER = 'SYSTEM_UPDATE_AFTER';\n","import EventDispatcher from './EventDispatcher';\n\nexport default EventDispatcher;\nexport * from './constants';\n","import { INITIALIZER_TYPE_ABSTRACT } from './types';\n\n/**\n * The base Emitter / Particle property class.\n *\n * @abstract\n */\nexport default class Initializer {\n /**\n * Constructs an Initializer instance.\n *\n * @param {string} [type=INITIALIZER_TYPE_ABSTRACT] - The intiializer type\n * @param {boolean} [isEnabled=true] - Determines if the initializer should be enabled or not\n\n * @return void\n */\n constructor(type = INITIALIZER_TYPE_ABSTRACT, isEnabled = true) {\n this.type = type;\n this.isEnabled = isEnabled;\n }\n\n /**\n * Initializes the property on the emitter or particle.\n *\n * @see {@link '../emitter/emitter.js'} setupParticle\n * @param {Emitter} emitter - the emitter to initialize the property on\n * @param {Particle} particle - the particle to intiialize the property on\n * @return void\n */\n init(emitter, particle) {\n if (!this.isEnabled) {\n return;\n }\n\n if (particle) {\n this.initialize(particle);\n particle.hasBeenInitialized = true;\n } else {\n this.initialize(emitter);\n emitter.hasBeenInitialized = true;\n }\n }\n\n /**\n * @abstract\n */\n reset() {}\n\n /**\n * Place custom property initialization code in this method in the subclass.\n *\n * @param {object} target - either an Emitter or a Particle\n * @abstract\n */\n initialize(target) {} // eslint-disable-line\n\n /**\n * Determines if the initializer requires a Web GL API to be provided to its constructor.\n * If true, the WebGL API will need to be provided as the first argument to the constructor\n * and fromJSON methods.\n *\n * @return {boolean}\n */\n static requiresWebGlApi() {\n return false;\n }\n\n /**\n * Returns a new instance of the initializer from the JSON object passed.\n *\n * @abstract\n * @param {object} json - JSON object containing the required constructor properties\n * @return {Behaviour}\n */\n static fromJSON(json) {} // eslint-disable-line\n}\n","import Initializer from './Initializer';\nimport { createArraySpan } from '../math';\nimport { INITIALIZER_TYPE_BODY as type } from './types';\n/**\n * Sets the body property on initialized particles.\n *\n */\nexport default class Body extends Initializer {\n /**\n * Constructs a Body initalizer instance.\n *\n * @param {string|number|object} body - The content for the particle body, can\n * be a color or an object (mesh)\n * @param {?number} w - The width of the particle body\n * @param {?number} h - The height of the particle body\n * @return void\n */\n constructor(body, w, h, isEnabled = true) {\n super(type, isEnabled);\n\n /**\n * @desc The content for the particle body\n * @type {ArraySpan}\n */\n this.body = createArraySpan(body);\n\n /**\n * @desc The width of the particle Body\n * @type {number}\n */\n this.w = w;\n\n /**\n * @desc The height of the particle Body\n * @type {number}\n */\n this.h = h || w;\n }\n\n /**\n * Sets the particle's initial body.\n *\n * @param {Particle} particle - the particle to initialize the property on\n * @return void\n */\n initialize(particle) {\n var body = this.body.getValue();\n\n if (this.w) {\n particle.body = {\n width: this.w,\n height: this.h,\n body: body,\n };\n } else {\n particle.body = body;\n }\n }\n\n /**\n * Creates a Body initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @property {number} json.body - The color for the particle body\n * @property {number} json.width - The width of the particle body\n * @property {number} json.height - The height of the particle body\n * @return {Body}\n */\n static fromJSON(json) {\n const { body, width, height, isEnabled = true } = json;\n\n return new Body(body, width, height, isEnabled);\n }\n}\n","import {\n AdditiveBlending,\n CustomBlending,\n MultiplyBlending,\n NoBlending,\n NormalBlending,\n SubtractiveBlending,\n} from '../core/three/';\n\nexport const SUPPORTED_MATERIAL_BLENDING_MODES = {\n AdditiveBlending,\n CustomBlending,\n MultiplyBlending,\n NoBlending,\n NormalBlending,\n SubtractiveBlending,\n};\n\nexport const DEFAULT_MATERIAL_PROPERTIES = {\n color: 0xff0000,\n blending: AdditiveBlending,\n fog: true,\n};\nexport const DEFAULT_JSON_MATERIAL_PROPERTIES = {\n ...DEFAULT_MATERIAL_PROPERTIES,\n blending: 'AdditiveBlending',\n};\nexport const DEFAULT_RATE_NUM_PAN = 1;\nexport const DEFAULT_RATE_TIME_PAN = 1;\n","import {\n DEFAULT_JSON_MATERIAL_PROPERTIES,\n DEFAULT_MATERIAL_PROPERTIES,\n SUPPORTED_MATERIAL_BLENDING_MODES,\n} from './constants';\n\nimport Initializer from './Initializer';\nimport { INITIALIZER_TYPE_BODY_SPRITE as type } from './types';\nimport { withDefaults } from '../utils';\n\n/**\n * Sets the body property to be a THREE.Sprite on initialized particles.\n *\n * NOTE The texture map MUST be set on the SpriteMaterial in the TextureLoader.load\n * callback. Not doing so will cause WebGL buffer errors.\n */\nexport default class BodySprite extends Initializer {\n /**\n * Constructs a BodySprite initializer.\n *\n * @param {object} THREE - The Web GL API we are using eg., THREE\n * @param {string} texture - The sprite texture\n * @param {object} materialProperties - The sprite material properties\n * @throws {Error} If the TextureLoader fails to load the supplied texture\n * @return void\n */\n constructor(\n THREE,\n texture,\n materialProperties = DEFAULT_MATERIAL_PROPERTIES,\n isEnabled = true\n ) {\n super(type, isEnabled);\n\n const { Sprite, SpriteMaterial, TextureLoader } = THREE;\n\n /**\n * @desc The material properties for this object's SpriteMaterial\n * NOTE This is required for testing purposes\n * @type {object}\n */\n this.materialProperties = withDefaults(\n DEFAULT_MATERIAL_PROPERTIES,\n materialProperties\n );\n\n new TextureLoader().load(\n texture,\n map => {\n /**\n * @desc The texture for the THREE.SpriteMaterial map.\n * @type {Texture}\n */\n this.texture = map;\n\n /**\n * @desc THREE.SpriteMaterial instance.\n * @type {SpriteMaterial}\n */\n this.material = new SpriteMaterial({\n ...{ map },\n ...this.materialProperties,\n });\n\n /**\n * @desc THREE.Sprite instance.\n * @type {Sprite}\n */\n this.sprite = new Sprite(this.material);\n },\n undefined,\n error => {\n throw new Error(error);\n }\n );\n }\n\n /**\n * Sets the particle body to the sprite.\n *\n * @param {Particle} particle - The particle to set the body of\n * @return void\n */\n initialize(particle) {\n particle.body = this.sprite;\n }\n\n /**\n * Creates a BodySprite initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from\n * @param {object} THREE - The Web GL API we are using eg., THREE\n * @param {string} json.texture - The sprite texture\n * @param {object} json.materialProperties - The sprite material properties\n * @return {BodySprite}\n */\n static fromJSON(json, THREE) {\n const {\n texture,\n materialProperties = DEFAULT_JSON_MATERIAL_PROPERTIES,\n isEnabled = true,\n } = json;\n\n const ensureMappedBlendingMode = properties => {\n const { blending } = properties;\n\n return {\n ...properties,\n blending: blending\n ? SUPPORTED_MATERIAL_BLENDING_MODES[blending]\n : SUPPORTED_MATERIAL_BLENDING_MODES[\n DEFAULT_JSON_MATERIAL_PROPERTIES.blending\n ],\n };\n };\n\n return new BodySprite(\n THREE,\n texture,\n withDefaults(\n DEFAULT_JSON_MATERIAL_PROPERTIES,\n ensureMappedBlendingMode(materialProperties)\n ),\n isEnabled\n );\n }\n}\n","import { Euler } from '../core/three/';\n\nconst particleEuler = new Euler();\n\nexport default {\n particleEuler: null,\n /**\n * Loops through the initializers array and calls each initializer's initialize method\n * on the supplied particle. This sets the particle's initial properties.\n *\n * @see {@link '../emitter/Emitter'} setupParticle\n * @param {Emitter} emitter - The emitter that has called this method\n * @param {Particle} particle - The particle that has just been created\n * @param {array<Initializer>} initializers - All of the emitter's initializers\n * @return void\n */\n initialize: function(emitter, particle, initializers) {\n let i = initializers.length;\n\n while (i--) {\n initializers[i].init(emitter, particle);\n }\n\n emitter.bindEmitter && this.bindEmitter(emitter, particle);\n },\n\n /**\n * Ensures that the emitter's position, velocity and accleration are added\n * to each created particle.\n *\n * @param {Emitter} emitter - The emitter that is emitting the particles\n * @param {Particle} particle - The newly created particle\n * @return void\n */\n bindEmitter: function(emitter, particle) {\n const {\n rotation: { x, y, z },\n } = emitter;\n\n particle.position.add(emitter.position);\n particle.velocity.add(emitter.velocity);\n particle.acceleration.add(emitter.acceleration);\n particle.velocity.applyEuler(particleEuler.set(x, y, z));\n },\n};\n","import Initializer from './Initializer';\nimport { createSpan } from '../math';\nimport { INITIALIZER_TYPE_LIFE as type } from './types';\n\n/**\n * Sets the life property on initialized particles.\n *\n */\nexport default class Life extends Initializer {\n /**\n * Constructs a Life property instance.\n *\n * @param {number} min - The minimum life\n * @param {number} max - The maximum life\n * @param {boolean} [center] - Determines whether to average the life value\n * @param {boolean} [isEnabled=true] - Determines if the initializer should be enabled or not\n * @return void\n */\n constructor(min, max, center, isEnabled = true) {\n super(type, isEnabled);\n\n /**\n * @desc The life span of the particle.\n * @type {Span}\n */\n this.lifePan = createSpan(min, max, center);\n }\n\n /**\n * Sets the particle's initial life.\n *\n * @param {Particle} particle - the particle to initialize the property on\n * @return void\n */\n initialize(particle) {\n if (this.lifePan.a == Infinity || this.lifePan.a == 'infi') {\n particle.life = Infinity;\n } else {\n particle.life = this.lifePan.getValue();\n }\n }\n\n /**\n * Creates a Life initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @param {number} json.min - The minimum life time\n * @param {number} json.max - The maximum life time\n * @param {number} json.center - The center of the life time\n * @param {boolean} [json.isEnabled=true] - Determines if the initializer should be enabled or not\n * @return {Life}\n */\n static fromJSON(json) {\n const { min, max, center = false, isEnabled = true } = json;\n\n return new Life(min, max, center, isEnabled);\n }\n}\n","import Initializer from './Initializer';\nimport { createSpan } from '../math';\nimport { INITIALIZER_TYPE_MASS as type } from './types';\n\n/**\n * Sets the mass property on initialized particles.\n *\n */\nexport default class Mass extends Initializer {\n /**\n * Constructs a Mass initializer instance.\n *\n * @param {number} min - The minumum mass for the particle\n * @param {number} max - The maximum mass for the particle\n * @param {boolean} [center] - Determines whether to average the mass value\n * @return void\n */\n constructor(min, max, center = false, isEnabled = true) {\n super(type, isEnabled);\n\n /**\n * @desc The mass span which is used to set the particle mass value.\n * @type {Span}\n */\n this.massPan = createSpan(min, max, center);\n }\n\n /**\n * Sets the particle's initial mass.\n *\n * @param {Particle} particle - the particle to initialize the property on\n * @return void\n */\n initialize(particle) {\n particle.mass = this.massPan.getValue();\n }\n\n /**\n * Creates a Mass initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @property {number} json.min - The minimum mass\n * @property {number} json.max - The maximum mass\n * @property {number} json.center - The center of the mass\n * @return {Mass}\n */\n static fromJSON(json) {\n const { min, max, center = false, isEnabled = true } = json;\n\n return new Mass(min, max, center, isEnabled);\n }\n}\n","import Vector3D from '../math/Vector3D';\nimport { ZONE_TYPE_ABSTRACT } from './types';\n\n/**\n * A Zone determines the area in 3D space where an emitter's particles can position\n * themselves. They are supplied to both the Position initializer\n * and the CrossZone behaviour.\n *\n * @see {@link '../initialize/Position.js'}\n * @see {@link '../behaviour/CrossZone.js'}\n * @abstract\n */\nexport default class Zone {\n /**\n * Constructs a Zone instance.\n *\n * @param {string} type - The zone type\n * @return void\n */\n constructor(type = ZONE_TYPE_ABSTRACT) {\n this.type = type;\n this.vector = new Vector3D(0, 0, 0);\n this.random = 0;\n this.crossType = 'dead';\n this.log = true;\n this.supportsCrossing = true;\n }\n\n getPosition() {\n return null;\n }\n\n crossing(particle) {\n if (!this.supportsCrossing) {\n return console.warn(\n `${this.constructor.name} does not support the crossing method`\n );\n }\n\n switch (this.crossType) {\n case 'bound':\n this._bound(particle);\n break;\n\n case 'cross':\n this._cross(particle);\n break;\n\n case 'dead':\n this._dead(particle);\n break;\n }\n }\n\n /**\n * Determines if this zone is a BoxZone.\n *\n * @return {boolean}\n */\n isBoxZone() {\n return false;\n }\n\n /**\n * Determines if this zone is a LineZone.\n *\n * @return {boolean}\n */\n isLineZone() {\n return false;\n }\n\n /**\n * Determines if this zone is a MeshZone.\n *\n * @return {boolean}\n */\n isMeshZone() {\n return false;\n }\n\n /**\n * Determines if this zone is a PointZone.\n *\n * @return {boolean}\n */\n isPointZone() {\n return false;\n }\n\n /**\n * Determines if this zone is a ScreenZone.\n *\n * @return {boolean}\n */\n isScreenZone() {\n return false;\n }\n\n /**\n * Determines if this zone is a SphereZone.\n *\n * @return {boolean}\n */\n isSphereZone() {\n return false;\n }\n\n /**\n * Sets the particle's dead property to true if required.\n *\n * @param {Particle} particle\n * @abstract\n */\n _dead(particle) {} //eslint-disable-line\n\n /**\n * @abstract\n */\n _bound(particle) {} //eslint-disable-line\n\n /**\n * @abstract\n */\n _cross(particle) {} //eslint-disable-line\n}\n","import MathUtils from '../math/MathUtils';\nimport Util from '../utils/Util';\nimport Zone from './Zone';\nimport { ZONE_TYPE_BOX as type } from './types';\n\nexport default class BoxZone extends Zone {\n /**\n * BoxZone is a box zone\n * @param {Number|Vector3D} x - the position's x value or a Vector3D Object\n * @param {Number} y - the position's y value\n * @param {Number} z - the position's z value\n * @param {Number} w - the Box's width\n * @param {Number} h - the Box's height\n * @param {Number} d - the Box's depth\n * @example\n * var boxZone = new BoxZone(0,0,0,50,50,50);\n * or\n * var boxZone = new BoxZone(new Vector3D(0,0,0), 50, 50, 50);\n * @extends {Zone}\n * @constructor\n */\n constructor(a, b, c, d, e, f) {\n super(type);\n\n // TODO this reassigning of arguments is pretty dangerous, need to fix it.\n // eslint-disable-next-line\n var x, y, z, w, h, d;\n\n if (Util.isUndefined(b, c, d, e, f)) {\n x = y = z = 0;\n w = h = d = a || 100;\n } else if (Util.isUndefined(d, e, f)) {\n x = y = z = 0;\n w = a;\n h = b;\n d = c;\n } else {\n x = a;\n y = b;\n z = c;\n w = d;\n h = e;\n d = f;\n }\n\n this.x = x;\n this.y = y;\n this.z = z;\n this.width = w;\n this.height = h;\n this.depth = d;\n // TODO Set this via an argument to the constructor\n this.friction = 0.85;\n // TODO Set this via an argument to the constructor\n this.max = 6;\n }\n\n /**\n * Returns true to indicate this is a BoxZone.\n *\n * @return {boolean}\n */\n isBoxZone() {\n return true;\n }\n\n getPosition() {\n this.vector.x = this.x + MathUtils.randomAToB(-0.5, 0.5) * this.width;\n this.vector.y = this.y + MathUtils.randomAToB(-0.5, 0.5) * this.height;\n this.vector.z = this.z + MathUtils.randomAToB(-0.5, 0.5) * this.depth;\n\n return this.vector;\n }\n\n _dead(particle) {\n if (particle.position.x + particle.radius < this.x - this.width / 2)\n particle.dead = true;\n else if (particle.position.x - particle.radius > this.x + this.width / 2)\n particle.dead = true;\n\n if (particle.position.y + particle.radius < this.y - this.height / 2)\n particle.dead = true;\n else if (particle.position.y - particle.radius > this.y + this.height / 2)\n particle.dead = true;\n\n if (particle.position.z + particle.radius < this.z - this.depth / 2)\n particle.dead = true;\n else if (particle.position.z - particle.radius > this.z + this.depth / 2)\n particle.dead = true;\n }\n\n _bound(particle) {\n if (particle.position.x - particle.radius < this.x - this.width / 2) {\n particle.position.x = this.x - this.width / 2 + particle.radius;\n particle.velocity.x *= -this.friction;\n this._static(particle, 'x');\n } else if (particle.position.x + particle.radius > this.x + this.width / 2) {\n particle.position.x = this.x + this.width / 2 - particle.radius;\n particle.velocity.x *= -this.friction;\n this._static(particle, 'x');\n }\n\n if (particle.position.y - particle.radius < this.y - this.height / 2) {\n particle.position.y = this.y - this.height / 2 + particle.radius;\n particle.velocity.y *= -this.friction;\n this._static(particle, 'y');\n } else if (particle.position.y + particle.radius > this.y + this.height / 2) {\n particle.position.y = this.y + this.height / 2 - particle.radius;\n particle.velocity.y *= -this.friction;\n this._static(particle, 'y');\n }\n\n if (particle.position.z - particle.radius < this.z - this.depth / 2) {\n particle.position.z = this.z - this.depth / 2 + particle.radius;\n particle.velocity.z *= -this.friction;\n this._static(particle, 'z');\n } else if (particle.position.z + particle.radius > this.z + this.depth / 2) {\n particle.position.z = this.z + this.depth / 2 - particle.radius;\n particle.velocity.z *= -this.friction;\n this._static(particle, 'z');\n }\n }\n\n _static(particle, axis) {\n if (particle.velocity[axis] * particle.acceleration[axis] > 0) return;\n if (\n Math.abs(particle.velocity[axis]) <\n Math.abs(particle.acceleration[axis]) * 0.0167 * this.max\n ) {\n particle.velocity[axis] = 0;\n particle.acceleration[axis] = 0;\n }\n }\n\n _cross(particle) {\n if (\n particle.position.x + particle.radius < this.x - this.width / 2 &&\n particle.velocity.x <= 0\n )\n particle.position.x = this.x + this.width / 2 + particle.radius;\n else if (\n particle.position.x - particle.radius > this.x + this.width / 2 &&\n particle.velocity.x >= 0\n )\n particle.position.x = this.x - this.width / 2 - particle.radius;\n\n if (\n particle.position.y + particle.radius < this.y - this.height / 2 &&\n particle.velocity.y <= 0\n )\n particle.position.y = this.y + this.height / 2 + particle.radius;\n else if (\n particle.position.y - particle.radius > this.y + this.height / 2 &&\n particle.velocity.y >= 0\n )\n particle.position.y = this.y - this.height / 2 - particle.radius;\n\n if (\n particle.position.z + particle.radius < this.z - this.depth / 2 &&\n particle.velocity.z <= 0\n )\n particle.position.z = this.z + this.depth / 2 + particle.radius;\n else if (\n particle.position.z - particle.radius > this.z + this.depth / 2 &&\n particle.velocity.z >= 0\n )\n particle.position.z = this.z - this.depth / 2 - particle.radius;\n }\n}\n","import Vector3D from '../math/Vector3D';\nimport Zone from './Zone';\nimport { ZONE_TYPE_LINE as type } from './types';\n\nexport default class LineZone extends Zone {\n /**\n * LineZone is a 3d line zone\n * @param {Number|Vector3D} x1 - the line's start point of x value or a Vector3D Object\n * @param {Number|Vector3D} y1 - the line's start point of y value or a Vector3D Object\n * @param {Number} z1 - the line's start point of z value\n * @param {Number} x2 - the line's end point of x value\n * @param {Number} y2 - the line's end point of y value\n * @param {Number} z2 - the line's end point of z value\n * @example\n * var lineZone = new System.LineZone(0,0,0,100,100,0);\n * or\n * var lineZone = new System.LineZone(new System.Vector3D(0,0,0),new System.Vector3D(100,100,0));\n * @extends {Zone}\n * @constructor\n */\n constructor(x1, y1, z1, x2, y2, z2) {\n super(type);\n\n if (x1 instanceof Vector3D) {\n this.x1 = x1.x;\n this.y1 = x1.y;\n this.z1 = x1.z;\n\n this.x2 = x2.x;\n this.y2 = x2.y;\n this.z2 = x2.z;\n } else {\n this.x1 = x1;\n this.y1 = y1;\n this.z1 = z1;\n\n this.x2 = x2;\n this.y2 = y2;\n this.z2 = z2;\n }\n\n this.supportsCrossing = false;\n }\n\n /**\n * Returns true to indicate this is a LineZone.\n *\n * @return {boolean}\n */\n isLineZone() {\n return true;\n }\n\n getPosition() {\n this.random = Math.random();\n this.vector.x = this.x1 + this.random * (this.x2 - this.x1);\n this.vector.y = this.y1 + this.random * (this.y2 - this.y1);\n this.vector.z = this.z1 + this.random * (this.z2 - this.z1);\n\n return this.vector;\n }\n}\n","import Zone from './Zone';\nimport { ZONE_TYPE_MESH as type } from './types';\n\n/**\n * Uses a three THREE.Geometry to determine the zone parameters.\n *\n */\nexport default class MeshZone extends Zone {\n /**\n * @constructs {MeshZone}\n *\n * @param {THREE.Geometry|Mesh} bounds - the geometry or mesh that will determine the zone bounds\n * @param {number} scale - the zone scale\n * @param {THREE.Geometry} ThreeGeometry - the three geometry class\n * @return void\n */\n constructor(bounds, scale = 1, ThreeGeometry) {\n super(type);\n\n this.geometry = null;\n this.scale = scale;\n this.supportsCrossing = false;\n\n if (bounds.type && bounds.type === 'Geometry') {\n this.geometry = bounds;\n }\n\n if (bounds.geometry) {\n this.geometry = bounds.geometry;\n }\n\n if (!this.geometry) {\n throw new Error(\n 'MeshZone unable to set geometry from the supplied bounds'\n );\n }\n\n if (this.geometry.isBufferGeometry) {\n this.geometry = new ThreeGeometry().fromBufferGeometry(this.geometry);\n }\n }\n\n /**\n * Returns true to indicate this is a MeshZone.\n *\n * @return {boolean}\n */\n isMeshZone() {\n return true;\n }\n\n getPosition() {\n const vertices = this.geometry.vertices;\n const rVector = vertices[(vertices.length * Math.random()) >> 0];\n\n this.vector.x = rVector.x * this.scale;\n this.vector.y = rVector.y * this.scale;\n this.vector.z = rVector.z * this.scale;\n\n return this.vector;\n }\n}\n","import Util from '../utils/Util';\nimport Zone from './Zone';\nimport { ZONE_TYPE_POINT as type } from './types';\n\nexport default class PointZone extends Zone {\n /**\n * PointZone is a point zone\n * @param {Number|Vector3D} x - the center's x value or a Vector3D Object\n * @param {Number} y - the center's y value\n * @param {Number} z - the center's z value\n * @example\n * var pointZone = new System.PointZone(0,30,10);\n * or\n * var pointZone = new System.PointZone(new System.Vector3D(0,30,10));\n * @extends {Zone}\n * @constructor\n */\n constructor(a, b, c) {\n super(type);\n\n // TODO see below, these should probably be assigned properly\n // eslint-disable-next-line\n var x, y, z;\n\n if (Util.isUndefined(a, b, c)) {\n x = y = z = 0;\n } else {\n x = a;\n // eslint-disable-next-line\n y = b;\n // eslint-disable-next-line\n z = c;\n }\n\n this.x = x;\n\n // TODO shouldn't this be set to y?\n this.y = x;\n\n // TODO shouldn't this be set to z?\n this.z = x;\n this.supportsCrossing = false;\n }\n\n /**\n * Returns true to indicate this is a PointZone.\n *\n * @return {boolean}\n */\n isPointZone() {\n return true;\n }\n\n getPosition() {\n this.vector.x = this.x;\n this.vector.y = this.y;\n this.vector.z = this.z;\n\n return this.vector;\n }\n}\n","import THREEUtil from '../utils/THREEUtil';\nimport Vector3D from '../math/Vector3D';\nimport Zone from './Zone';\nimport { ZONE_TYPE_SCREEN as type } from './types';\n\nexport default class ScreenZone extends Zone {\n /**\n * ScreenZone is a 3d line zone\n * @param {Number|Vector3D} x1 - the line's start point of x value or a Vector3D Object\n * @param {Number|Vector3D} y1 - the line's start point of y value or a Vector3D Object\n * @param {Number} z1 - the line's start point of z value\n * @param {Number} x2 - the line's end point of x value\n * @param {Number} y2 - the line's end point of y value\n * @param {Number} z2 - the line's end point of z value\n * @example\n * var lineZone = new ScreenZone(0,0,0,100,100,0);\n * or\n * var lineZone = new ScreenZone(new Vector3D(0,0,0),new Vector3D(100,100,0));\n * @extends {Zone}\n * @constructor\n */\n constructor(camera, renderer, dis, dir) {\n super(type);\n\n this.camera = camera;\n this.renderer = renderer;\n this.dis = dis || 20;\n dir = dir || '1234';\n\n for (var i = 1; i < 5; i++) this['d' + i] = dir.indexOf(i + '') >= 0;\n }\n\n /**\n * Returns true to indicate this is a ScreenZone.\n *\n * @return {boolean}\n */\n isScreenZone() {\n return true;\n }\n\n _dead(particle) {\n var pos = THREEUtil.toScreenPos(\n particle.position,\n this.camera,\n this.renderer.domElement\n );\n var canvas = this.renderer.domElement;\n\n if (pos.y + particle.radius < -this.dis && this.d1) {\n particle.dead = true;\n } else if (pos.y - particle.radius > canvas.height + this.dis && this.d3) {\n particle.dead = true;\n }\n\n if (pos.x + particle.radius < -this.dis && this.d4) {\n particle.dead = true;\n } else if (pos.x - particle.radius > canvas.width + this.dis && this.d2) {\n particle.dead = true;\n }\n }\n\n _bound(particle) {\n var pos = THREEUtil.toScreenPos(\n particle.position,\n this.camera,\n this.renderer.domElement\n );\n var canvas = this.renderer.domElement;\n\n if (pos.y + particle.radius < -this.dis) {\n particle.velocity.y *= -1;\n } else if (pos.y - particle.radius > canvas.height + this.dis) {\n particle.velocity.y *= -1;\n }\n\n if (pos.x + particle.radius < -this.dis) {\n particle.velocity.y *= -1;\n } else if (pos.x - particle.radius > canvas.width + this.dis) {\n particle.velocity.y *= -1;\n }\n }\n}\n\nScreenZone.prototype.getPosition = (function() {\n var vec2 = new Vector3D(),\n canvas;\n\n return function() {\n canvas = this.renderer.domElement;\n vec2.x = Math.random() * canvas.width;\n vec2.y = Math.random() * canvas.height;\n this.vector.copy(THREEUtil.toSpacePos(vec2, this.camera, canvas));\n\n return this.vector;\n };\n})();\n\nScreenZone.prototype._cross = (function() {\n var vec2 = new Vector3D();\n\n return function(particle) {\n var pos = THREEUtil.toScreenPos(\n particle.position,\n this.camera,\n this.renderer.domElement\n );\n var canvas = this.renderer.domElement;\n\n if (pos.y + particle.radius < -this.dis) {\n vec2.x = pos.x;\n vec2.y = canvas.height + this.dis + particle.radius;\n particle.position.y = THREEUtil.toSpacePos(vec2, this.camera, canvas).y;\n } else if (pos.y - particle.radius > canvas.height + this.dis) {\n vec2.x = pos.x;\n vec2.y = -this.dis - particle.radius;\n particle.position.y = THREEUtil.toSpacePos(vec2, this.camera, canvas).y;\n }\n\n if (pos.x + particle.radius < -this.dis) {\n vec2.y = pos.y;\n vec2.x = canvas.width + this.dis + particle.radius;\n particle.position.x = THREEUtil.toSpacePos(vec2, this.camera, canvas).x;\n } else if (pos.x - particle.radius > canvas.width + this.dis) {\n vec2.y = pos.y;\n vec2.x = -this.dis - particle.radius;\n particle.position.x = THREEUtil.toSpacePos(vec2, this.camera, canvas).x;\n }\n };\n})();\n","import { PI } from '../constants';\nimport Util from '../utils/Util';\nimport Vector3D from '../math/Vector3D';\nimport Zone from './Zone';\nimport { ZONE_TYPE_SPHERE as type } from './types';\n\n/**\n * A spherical zone for particles to be emitted within.\n *\n */\nexport default class SphereZone extends Zone {\n /**\n * @constructs {SphereZone}\n *\n * @param {number} centerX - the sphere's center x coordinate\n * @param {number} centerY - the sphere's center y coordinate\n * @param {number} centerZ - the sphere's center z coordinate\n * @param {number} radius - the sphere's radius value\n * @return void\n */\n constructor(centerX, centerY, centerZ, radius) {\n super(type);\n\n // TODO see below, these should probably be assigned properly\n // eslint-disable-next-line\n let x, y, z, r;\n\n if (Util.isUndefined(centerY, centerZ, radius)) {\n x = y = z = 0;\n r = centerX || 100;\n } else {\n x = centerX;\n // eslint-disable-next-line\n y = centerY;\n // eslint-disable-next-line\n z = centerZ;\n r = radius;\n }\n\n this.x = x;\n\n // TODO shouldn't this be set to y?\n this.y = x;\n\n // TODO shouldn't this be set to z?\n this.z = x;\n this.radius = r;\n this.the = this.phi = 0;\n }\n\n /**\n * Returns true to indicate this is a SphereZone.\n *\n * @return {boolean}\n */\n isSphereZone() {\n return true;\n }\n\n /**\n * Sets the particle to dead if the particle collides with the sphere.\n *\n * @param {object} particle\n * @return void\n */\n _dead(particle) {\n var d = particle.position.distanceTo(this);\n\n if (d - particle.radius > this.radius) particle.dead = true;\n }\n\n /**\n * Warns that this zone does not support the _cross method.\n *\n * @return void\n */\n _cross() {\n console.warn(`${this.constructor.name} does not support the _cross method`);\n }\n}\n\nSphereZone.prototype.getPosition = (function() {\n var tha, phi, r;\n\n return function() {\n this.random = Math.random();\n\n r = this.random * this.radius;\n tha = PI * Math.random(); //[0-pi]\n phi = PI * 2 * Math.random(); //[0-2pi]\n\n this.vector.x = this.x + r * Math.sin(tha) * Math.cos(phi);\n this.vector.y = this.y + r * Math.sin(phi) * Math.sin(tha);\n this.vector.z = this.z + r * Math.cos(tha);\n\n return this.vector;\n };\n})();\n\nSphereZone.prototype._bound = (function() {\n var normal = new Vector3D(),\n v = new Vector3D(),\n k;\n\n return function(particle) {\n var d = particle.position.distanceTo(this);\n\n if (d + particle.radius >= this.radius) {\n normal\n .copy(particle.position)\n .sub(this)\n .normalize();\n v.copy(particle.velocity);\n k = 2 * v.dot(normal);\n particle.velocity.sub(normal.scalar(k));\n }\n };\n})();\n","export { default as BoxZone } from './BoxZone';\nexport { default as LineZone } from './LineZone';\nexport { default as MeshZone } from './MeshZone';\nexport { default as PointZone } from './PointZone';\nexport { default as ScreenZone } from './ScreenZone';\nexport { default as SphereZone } from './SphereZone';\n","import * as Zone from '../zone';\n\nimport Initializer from './Initializer';\nimport { SUPPORTED_JSON_ZONE_TYPES } from '../core/constants';\nimport { INITIALIZER_TYPE_POSITION as type } from './types';\n\n/**\n * Sets the starting position property for initialized particles.\n * This is derived from a zone randomly chosen from those supplied to the constructor.\n *\n */\nexport default class Position extends Initializer {\n /**\n * Constructs a Position initializer instance.\n *\n * @param {Zone|array<Zone>}\n * @return void\n */\n constructor() {\n super(type);\n\n this.reset.apply(this, arguments);\n }\n\n /**\n * Resets the initializer properties.\n * Clears all previously set zones and resets the zones according to args passed.\n *\n * @param {Zone|array<Zone>}\n * @return void\n */\n reset() {\n if (!this.zones) {\n this.zones = [];\n } else {\n this.zones.length = 0;\n }\n\n /**\n * @desc The zones to use as bounds for calculating the particle's starting position.\n * @type {array<Zone>}\n */\n this.zones = this.zones.concat(Array.prototype.slice.call(arguments));\n }\n\n /**\n * Adds a zone or zones to this.zones.\n *\n * @param {Zone|array<Zone>}\n * @return void\n */\n addZone() {\n this.zones = this.zones.concat(Array.prototype.slice.call(arguments));\n }\n\n /**\n * Creates a Position initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @param {string} json.zoneType - The type of zone to use for initial position\n * @return {Position}\n */\n static fromJSON(json) {\n const { zoneType, ...params } = json;\n\n if (!SUPPORTED_JSON_ZONE_TYPES.includes(zoneType)) {\n throw new Error(\n `The zone type ${zoneType} is invalid or not yet supported`\n );\n }\n\n return new Position(new Zone[zoneType](...Object.values(params)));\n }\n}\n\n/**\n * Sets the particle's initial position.\n *\n * @param {Particle} particle - the particle to initialize the property on\n * @return void\n */\nPosition.prototype.initialize = (function() {\n let zone;\n\n return function(target) {\n zone = this.zones[(Math.random() * this.zones.length) >> 0];\n\n zone.getPosition();\n\n target.position.x = zone.vector.x;\n target.position.y = zone.vector.y;\n target.position.z = zone.vector.z;\n };\n})();\n","import { Vector3 } from '../core/three';\nimport Initializer from './Initializer';\nimport { INITIALIZER_TYPE_ROTATION as type } from './types';\n\n/**\n * Sets the rotation property on initialized particles.\n *\n */\nexport default class Rotation extends Initializer {\n /**\n * Constructs a Rotation property instance.\n *\n * @param {number} x - X axis rotation\n * @param {number} y - Y axis rotation\n * @param {number} z - Z axis rotation\n * @param {boolean} [useEmitterRotation=true] - Determines if we should use the emitter's rotation as the starting rotation\n * @param {boolean} [isEnabled=true] - Determines if the initializer should be enabled or not\n * @return void\n */\n constructor(x, y, z, useEmitterRotation=true, isEnabled = true) {\n super(type, isEnabled);\n this.rotation = new Vector3(x,y,z);\n this.useEmitterRotation = useEmitterRotation;\n }\n\n /**\n * Sets the particle's initial rotation.\n *\n * @param {Particle} particle - the particle to initialize the property on\n * @return void\n */\n initialize(particle) {\n if(this.useEmitterRotation)\n {\n // set initial particle rotation to that of the particle's emitter then add our set rotation\n particle.rotation.copy(particle.parent.rotation).add(this.rotation);\n }\n else\n {\n particle.rotation.copy(this.rotation);\n }\n }\n\n static fromJSON(json) {\n const { x, y, z, useEmitterRotation = true, isEnabled = true } = json;\n\n return new Rotation(x, y, z, useEmitterRotation, isEnabled);\n }\n}","import Initializer from './Initializer';\nimport { createSpan } from '../math';\nimport { INITIALIZER_TYPE_RADIUS as type } from './types';\n/**\n * Sets the radius property on initialized particles.\n *\n */\nexport default class Radius extends Initializer {\n /**\n * Constructs a Radius initializer instance.\n *\n * @param {number} width - The width of the particle radius\n * @param {number} height - The height of the particle radius\n * @param {boolean} [center=false] - Determines whether to average the radius value\n * @return void\n */\n constructor(width, height, center = false, isEnabled = true) {\n super(type, isEnabled);\n\n /**\n * @desc The radius span which is used to set the particle radius value.\n * @type {Span}\n */\n this.radius = createSpan(width, height, center);\n }\n\n /**\n * Resets the initializer properties.\n * Clears all previously set zones and resets the zones according to args passed.\n *\n * @param {number} width - The width of the particle radius\n * @param {number} height - The height of the particle radius\n * @param {boolean} [center=false] - Determines whether to average the radius value\n * @return void\n */\n reset(width, height, center = false) {\n this.radius = createSpan(width, height, center);\n }\n\n /**\n * Sets the particle's initial radius.\n *\n * @param {Particle} particle - the particle to initialize the property on\n * @return void\n */\n initialize(particle) {\n particle.radius = this.radius.getValue();\n particle.transform.oldRadius = particle.radius;\n }\n\n /**\n * Creates a Radius initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @property {number} json.width - The width of the particle radius\n * @property {number} json.height - The height of the particle radius\n * @property {number} json.center - The center of the particle radius\n * @return {Radius}\n */\n static fromJSON(json) {\n const { width, height, center = false, isEnabled = true } = json;\n\n return new Radius(width, height, center, isEnabled);\n }\n}\n","import { DEFAULT_RATE_NUM_PAN, DEFAULT_RATE_TIME_PAN } from './constants';\nimport { Span, createSpan } from '../math';\n\nimport Initializer from './Initializer';\nimport { INITIALIZER_TYPE_RATE as type } from './types';\n\n/**\n * Calculates the rate of particle emission.\n *\n * NOTE This doesn't need to be an initializer, it doesn't have an initialize\n * method, it overrides the base init method and it is only relevent to the Emitter class.\n * It would be better to move this to the Emitter module itself as a standalone class.\n *\n */\nexport default class Rate extends Initializer {\n /**\n * Constructs a Rate instance.\n *\n * @param {number|array|Span} numPan - The number of particles to emit\n * @param {number|array|Span} timePan - The time between each particle emission\n * @return void\n */\n constructor(numPan = DEFAULT_RATE_NUM_PAN, timePan = DEFAULT_RATE_TIME_PAN) {\n super(type);\n\n /**\n * @desc Sets the number of particles to emit.\n * @type {Span}\n */\n this.numPan = createSpan(numPan);\n\n /**\n * @desc Sets the time between each particle emission.\n * @type {Span}\n */\n this.timePan = createSpan(timePan);\n\n /**\n * @desc The rate's start time.\n * @type {number}\n */\n this.startTime = 0;\n\n /**\n * @desc The rate's next time.\n * @type {number}\n */\n this.nextTime = 0;\n\n this.init();\n }\n\n /**\n * Sets the startTime and nextTime properties.\n *\n * @return void\n */\n init() {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n }\n\n /**\n * Gets the number of particles to emit.\n *\n * @param {number} time - Current particle engine time\n * @return {number}\n */\n getValue(time) {\n this.startTime += time;\n\n if (this.startTime >= this.nextTime) {\n this.init();\n\n if (this.numPan.b == 1) {\n if (this.numPan.getValue('Float') > 0.5) return 1;\n else return 0;\n } else {\n return this.numPan.getValue('Int');\n }\n }\n\n return 0;\n }\n\n /**\n * Creates a Rate initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @property {number} json.particlesMin - The minimum number of particles to emit\n * @property {number} json.particlesMax - The maximum number of particles to emit\n * @property {number} json.perSecondMin - The minimum per second emit rate\n * @property {number} json.perSecondMax - The maximum per second emit rate\n * @return {Rate}\n */\n static fromJSON(json) {\n const { particlesMin, particlesMax, perSecondMin, perSecondMax } = json;\n\n return new Rate(\n new Span(particlesMin, particlesMax),\n new Span(perSecondMin, perSecondMax)\n );\n }\n}\n","import {\n DEFAULT_JSON_MATERIAL_PROPERTIES,\n DEFAULT_MATERIAL_PROPERTIES,\n SUPPORTED_MATERIAL_BLENDING_MODES,\n} from './constants';\n\nimport Initializer from './Initializer';\nimport { INITIALIZER_TYPE_TEXTURE as type } from './types';\nimport { withDefaults } from '../utils';\n\n/**\n * Sets the body property to be a THREE.Sprite with a texture map on initialized particles.\n *\n */\nexport default class Texture extends Initializer {\n /**\n * Constructs an Texture initializer.\n *\n * @param {object} THREE - The Web GL API we are using eg., THREE\n * @param {string} texture - The sprite texture\n * @param {object|undefined} materialProperties - The sprite material properties\n * @param {?Texture} loadedTexture - Preloaded THREE.Texture instance\n */\n constructor(\n THREE,\n loadedTexture,\n materialProperties = DEFAULT_MATERIAL_PROPERTIES,\n isEnabled = true\n ) {\n super(type, isEnabled);\n\n const { Sprite, SpriteMaterial } = THREE;\n\n /**\n * @desc The material properties for this object's SpriteMaterial\n * NOTE This is required for testing purposes\n * @type {object}\n */\n this.materialProperties = withDefaults(\n DEFAULT_MATERIAL_PROPERTIES,\n materialProperties\n );\n\n /**\n * @desc The texture for the THREE.SpriteMaterial map.\n * @type {Texture}\n */\n this.texture = loadedTexture;\n\n /**\n * @desc THREE.SpriteMaterial instance.\n * @type {SpriteMaterial}\n */\n this.material = new SpriteMaterial({\n ...{ map: loadedTexture },\n ...this.materialProperties,\n });\n\n /**\n * @desc THREE.Sprite instance.\n * @type {Sprite}\n */\n this.sprite = new Sprite(this.material);\n }\n\n /**\n * Sets the particle body to the sprite.\n *\n * @param {Particle} particle - The particle to set the body of\n * @return void\n */\n initialize(particle) {\n particle.body = this.sprite;\n }\n\n /**\n * Creates a Texture initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from\n * @param {object} THREE - The Web GL API we are using eg., THREE\n * @param {Texture} json.loadedTexture - The loaded sprite texture\n * @param {object} json.materialProperties - The sprite material properties\n * @return {BodySprite}\n */\n static fromJSON(json, THREE) {\n const {\n loadedTexture,\n materialProperties = DEFAULT_JSON_MATERIAL_PROPERTIES,\n isEnabled = true,\n } = json;\n\n const ensureMappedBlendingMode = properties => {\n const { blending } = properties;\n\n return {\n ...properties,\n blending: blending\n ? SUPPORTED_MATERIAL_BLENDING_MODES[blending]\n : SUPPORTED_MATERIAL_BLENDING_MODES[\n DEFAULT_JSON_MATERIAL_PROPERTIES.blending\n ],\n };\n };\n\n return new Texture(\n THREE,\n loadedTexture,\n withDefaults(\n DEFAULT_JSON_MATERIAL_PROPERTIES,\n ensureMappedBlendingMode(materialProperties)\n ),\n isEnabled\n );\n }\n}\n","import { MEASURE, PI } from '../../constants';\nimport { MathUtils, Vector3D } from '../../math';\n\nimport Initializer from '../Initializer';\n\n/**\n * Abstract class for Velocity initializers.\n *\n */\nexport default class Velocity extends Initializer {\n /**\n * Constructs a Velocity intitializer instance.\n *\n * @return void\n */\n constructor(type, isEnabled = true) {\n super(type, isEnabled);\n\n /**\n * @desc Directional vector\n * @type {Vector3D}\n */\n this.dirVec = new Vector3D(0, 0, 0);\n }\n\n normalize(vr) {\n return vr * MEASURE;\n }\n}\n\n/**\n * Sets the particle's initial velocity.\n *\n * @singleton\n * @param {Particle} particle - the particle to initialize the property on\n * @return void\n */\nVelocity.prototype.initialize = (function() {\n var tha;\n var normal = new Vector3D(0, 0, 1);\n var v = new Vector3D(0, 0, 0);\n\n return function initialize(particle) {\n tha = this.tha * Math.random();\n this._useV && this.dirVec.copy(this.dir).scalar(this.radiusPan.getValue());\n\n MathUtils.getNormal(this.dirVec, normal);\n v.copy(this.dirVec).applyAxisAngle(normal, tha);\n v.applyAxisAngle(this.dirVec.normalize(), Math.random() * PI * 2);\n\n particle.velocity.copy(v);\n\n return this;\n };\n})();\n","import { DR } from '../../constants';\nimport { Polar3D } from '../../math';\nimport Velocity from './Velocity';\nimport { INITIALIZER_TYPE_POLAR_VELOCITY as type } from '../types';\n\n/**\n * Sets the velocity property on initialized particles.\n *\n */\nexport default class PolarVelocity extends Velocity {\n /**\n * Constructs a PolarVelocity initializer.\n *\n * @param {Polar3D} polar3d - The polar vector for the velocity\n * @param {number} theta - The theta angle to use\n * @return void\n */\n constructor(polar3d, theta, isEnabled = true) {\n super(type, isEnabled);\n\n /**\n * @desc Theta.\n * @type {number}\n */\n this.tha = theta * DR;\n\n /**\n * @desc Directional vector\n * @type {Vector3D}\n */\n this.dirVec = polar3d.toVector3D();\n\n /**\n * @desc Determines whether to use the directional vector or not.\n * @type {boolean}\n */\n this._useV = false;\n }\n\n /**\n * Creates a PolarVelocity initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @param {number} json.polarRadius - The Polar3D radius\n * @param {number} json.polarTheta - The Polar3D theta\n * @param {number} json.polarPhi - The Polar3D phi\n * @param {number} json.velocityTheta - The velocity theta\n * @return {PolarVelocity}\n */\n static fromJSON(json) {\n const {\n polarRadius,\n polarTheta,\n polarPhi,\n velocityTheta,\n isEnabled = true,\n } = json;\n\n return new PolarVelocity(\n new Polar3D(polarRadius, polarTheta, polarPhi),\n velocityTheta,\n isEnabled\n );\n }\n}\n","import { Vector3D, createSpan } from '../../math';\n\nimport { DR } from '../../constants';\nimport Velocity from './Velocity';\nimport { INITIALIZER_TYPE_RADIAL_VELOCITY as type } from '../types';\n\n/**\n * Sets the velocity property on initialized particles.\n *\n */\nexport default class RadialVelocity extends Velocity {\n /**\n * Constructs a RadialVelocity initializer.\n *\n * @param {number|Span} radius - The velocity radius\n * @param {Vector3D} vector3d - The directional vector for the velocity\n * @param {number} theta - The theta angle to use\n * @return void\n */\n constructor(radius, vector3d, theta, isEnabled = true) {\n super(type, isEnabled);\n\n /**\n * @desc Velocity radius span.\n * @type {Span}\n */\n this.radiusPan = createSpan(radius);\n\n /**\n * @desc Direction vector.\n * @type {Vector3D}\n */\n this.dir = vector3d.clone().normalize();\n\n /**\n * @desc Theta.\n * @type {number}\n */\n this.tha = theta * DR;\n\n /**\n * @desc Determines whether to use the directional vector or not.\n * @type {boolean}\n */\n this._useV = true;\n }\n\n /**\n * Creates a RadialVelocity initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @param {number} json.radius - The velocity radius\n * @param {number} json.x - The velocity x axis direction\n * @param {number} json.y - The velocity y axis direction\n * @param {number} json.z - The velocity z axis direction\n * @param {number} json.theta - The velocity theta\n * @return {RadialVelocity}\n */\n static fromJSON(json) {\n const { radius, x, y, z, theta, isEnabled = true } = json;\n\n return new RadialVelocity(radius, new Vector3D(x, y, z), theta, isEnabled);\n }\n}\n","import { Vector3D, createSpan } from '../../math';\n\nimport { DR } from '../../constants';\nimport Velocity from './Velocity';\nimport { INITIALIZER_TYPE_VECTOR_VELOCITY as type } from '../types';\n\n/**\n * Sets the velocity property on initialized particles.\n *\n */\nexport default class VectorVelocity extends Velocity {\n /**\n * Constructs a VectorVelocity initializer.\n *\n * @param {Vector3D} vector3d - The directional vector for the velocity\n * @param {number} theta - The theta angle to use\n * @return void\n */\n constructor(vector3d, theta, isEnabled = true) {\n super(type, isEnabled);\n\n /**\n * @desc Velocity radius span.\n * @type {Span}\n */\n this.radiusPan = createSpan(1);\n\n /**\n * @desc Direction vector.\n * @type {Vector3D}\n */\n this.dir = vector3d.clone();\n\n /**\n * @desc Theta.\n * @type {number}\n */\n this.tha = theta * DR;\n\n /**\n * @desc Determines whether to use the directional vector or not.\n * @type {boolean}\n */\n this._useV = true;\n }\n\n /**\n * Creates a VectorVelocity initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @param {number} json.x - The velocity x axis direction\n * @param {number} json.y - The velocity y axis direction\n * @param {number} json.z - The velocity z axis direction\n * @param {number} json.theta - The velocity theta\n * @return {VectorVelocity}\n */\n static fromJSON(json) {\n const { x, y, z, theta, isEnabled = true } = json;\n\n return new VectorVelocity(new Vector3D(x, y, z), theta, isEnabled);\n }\n}\n","export { default as Body } from './Body';\nexport { default as BodySprite } from './BodySprite';\nexport { default as InitializerUtil } from './InitializerUtil';\nexport { default as Life } from './Life';\nexport { default as Mass } from './Mass';\nexport { default as Position } from './Position';\nexport { default as Rotation } from './Rotation';\nexport { default as Radius } from './Radius';\nexport { default as Rate } from './Rate';\nexport { default as Texture } from './Texture';\nexport { VectorVelocity, PolarVelocity, RadialVelocity } from './Velocity';\n","import { Rate } from '../initializer';\n\nexport const DEFAULT_DAMPING = 0.006;\nexport const DEFAULT_BIND_EMITTER = true;\nexport const DEFAULT_EMITTER_RATE = new Rate(1, 0.1);\nexport const DEFAULT_BIND_EMITTER_EVENT = false;\nexport const DEFAULT_EMITTER_INDEX = undefined;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","export const EMITTER_TYPE_EMITTER = 'Emitter';\nexport const EMITTER_TYPE_FOLLOW = 'FollowEmitter';\n","import {\n DEFAULT_BIND_EMITTER,\n DEFAULT_BIND_EMITTER_EVENT,\n DEFAULT_DAMPING,\n DEFAULT_EMITTER_INDEX,\n DEFAULT_EMITTER_RATE,\n} from './constants';\nimport EventDispatcher, {\n EMITTER_DEAD,\n PARTICLE_CREATED,\n PARTICLE_DEAD,\n PARTICLE_UPDATE,\n SYSTEM_UPDATE,\n} from '../events';\nimport { INTEGRATION_TYPE_EULER, integrate } from '../math';\nimport { Util, uid } from '../utils';\n\nimport { InitializerUtil } from '../initializer';\nimport Particle from '../core/Particle';\nimport isNumber from 'lodash/isNumber';\nimport { EMITTER_TYPE_EMITTER as type } from './types';\n\n/**\n * Emitters are the System engine's particle factories. They cause particles to\n * be rendered by emitting them, and store all particle initializers and behaviours.\n *\n */\nexport default class Emitter extends Particle {\n /**\n * Constructs an Emitter instance.\n *\n * @param {object} properties - The properties to instantiate the emitter with\n * @return void\n */\n constructor(properties) {\n super(properties);\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n\n /**\n * @desc The particles emitted by this emitter.\n * @type {array}\n */\n this.particles = [];\n\n /**\n * @desc The initializers for particles emitted by this emitter.\n * @type {array}\n */\n this.initializers = [];\n\n /**\n * @desc The behaviours for particles emitted by this emitter.\n * @type {array}\n */\n this.behaviours = [];\n\n /**\n * @desc The behaviours for the emitter.\n * @type {array}\n */\n this.emitterBehaviours = [];\n\n /**\n * @desc The current emit iteration.\n * @type {integer}\n */\n this.currentEmitTime = 0;\n\n /**\n * @desc The total number of times the emitter should emit particles.\n * @type {integer}\n */\n this.totalEmitTimes = -1;\n\n /**\n * @desc The friction coefficient for all particle to emit by.\n * @type {number}\n */\n this.damping = DEFAULT_DAMPING;\n\n /**\n * @desc Ensures that particles emitted by this emitter are positioned\n * according to the emitter's properties.\n * @type {boolean}\n */\n this.bindEmitter = DEFAULT_BIND_EMITTER;\n\n /**\n * @desc Determines if the emitter will dispatch internal events. Defaults\n * to false\n * @type {boolean}\n */\n this.bindEmitterEvent = DEFAULT_BIND_EMITTER_EVENT;\n\n /**\n * @desc The number of particles to emit per second (a [particle]/b [s])\n * @type {Rate}\n */\n this.rate = DEFAULT_EMITTER_RATE;\n\n /**\n * @desc Determines if the emitter is emitting particles or not.\n * @type {boolean}\n */\n this.isEmitting = false;\n\n /**\n * @desc The emitter's id.\n * @type {string}\n */\n this.id = `emitter-${uid()}`;\n this.cID = 0;\n this.name = 'Emitter';\n\n /**\n * @desc The index of the emitter as it is added to the system.\n * @type {number|undefined}\n */\n this.index = DEFAULT_EMITTER_INDEX;\n\n /**\n * @desc The emitter's internal event dispatcher.\n * @type {EventDispatcher}\n */\n this.eventDispatcher = new EventDispatcher();\n }\n\n /**\n * Proxy method for the internal event dispatcher's dispatchEvent method.\n *\n * @param {string} event - The event to dispatch\n * @param {object<Particle>} [target=this] - The event target\n */\n dispatch(event, target = this) {\n this.eventDispatcher.dispatchEvent(event, target);\n }\n\n /**\n * Sets the emitter rate.\n *\n * @param {Rate} rate - a rate initializer object\n * @return {Emitter}\n */\n setRate(rate) {\n this.rate = rate;\n\n return this;\n }\n\n /**\n * Sets the position of the emitter.\n *\n * @param {object} newPosition - an object the new x, y and z props\n * @return {Emitter}\n */\n setPosition(newPosition = {}) {\n const { position } = this;\n const { x = position.x, y = position.y, z = position.z } = newPosition;\n\n this.position.set(x, y, z);\n\n return this;\n }\n\n /**\n * Sets the rotation of the emitter.\n *\n * @param {object} newRotation - an object the new x, y and z props\n * @return {Emitter}\n */\n setRotation(newRotation = {}) {\n const { rotation } = this;\n const { x = rotation.x, y = rotation.y, z = rotation.z } = newRotation;\n\n this.rotation.set(x, y, z);\n\n return this;\n }\n\n /**\n * Sets the total number of times the emitter should emit particles as well as\n * the emitter's life. Also intializes the emitter rate.\n * This enables the emitter to emit particles.\n *\n * @param {number} [totalEmitTimes=Infinity] - the total number of times to emit particles\n * @param {number} [life=Infinity] - the life of this emitter in milliseconds\n * @return {Emitter}\n */\n emit(totalEmitTimes = Infinity, life = Infinity) {\n this.currentEmitTime = 0;\n this.totalEmitTimes = isNumber(totalEmitTimes) ? totalEmitTimes : Infinity;\n\n if (totalEmitTimes === 1) {\n this.life = totalEmitTimes;\n } else {\n this.life = isNumber(life) ? life : Infinity;\n }\n\n this.rate.init();\n this.isEmitting = true;\n\n return this;\n }\n\n /**\n * Experimental emit method that is designed to be called from the System.emit method.\n *\n * @return {Emitter}\n */\n experimental_emit() {\n const { isEmitting, totalEmitTimes, life } = this;\n\n if (!isEmitting) {\n this.currentEmitTime = 0;\n\n if (!totalEmitTimes) {\n this.setTotalEmitTimes(Infinity);\n }\n\n if (!life) {\n this.setLife(Infinity);\n }\n\n this.rate.init();\n this.isEmitting = true;\n }\n\n return this;\n }\n\n /**\n * Sets the total emit times for the emitter.\n *\n * @param {number} [totalEmitTimes=Infinity] - the total number of times to emit particles\n * @return {Emitter}\n */\n setTotalEmitTimes(totalEmitTimes = Infinity) {\n this.totalEmitTimes = isNumber(totalEmitTimes) ? totalEmitTimes : Infinity;\n\n return this;\n }\n\n /**\n * Sets the life of the emitter.\n *\n * @param {number} [life=Infinity] - the life of this emitter in milliseconds\n * @return {Emitter}\n */\n setLife(life = Infinity) {\n if (this.totalEmitTimes === 1) {\n this.life = this.totalEmitTimes;\n } else {\n this.life = isNumber(life) ? life : Infinity;\n }\n\n return this;\n }\n\n /**\n * Stops the emitter from emitting particles.\n *\n * @return void\n */\n stopEmit() {\n this.totalEmitTimes = -1;\n this.currentEmitTime = 0;\n this.isEmitting = false;\n }\n\n /**\n * Kills all of the emitter's particles.\n *\n * @return void\n */\n removeAllParticles() {\n let i = this.particles.length;\n\n while (i--) {\n this.particles[i].dead = true;\n }\n }\n\n /**\n * Adds a particle initializer to the emitter.\n * Each initializer is run on each particle when they are created.\n *\n * @param {Initializer} initializer - The initializer to add\n * @return {Emitter}\n */\n addInitializer(initializer) {\n this.initializers.push(initializer);\n\n return this;\n }\n\n /**\n * Adds multiple particle initializers to the emitter.\n *\n * @param {array<Initializer>} initializers - an array of particle initializers\n * @return {Emitter}\n */\n addInitializers(initializers) {\n let i = initializers.length;\n\n while (i--) {\n this.addInitializer(initializers[i]);\n }\n\n return this;\n }\n\n /**\n * Sets the emitter's particle initializers.\n *\n * @param {array<Initializer>} initializers - an array of particle initializers\n * @return {Emitter}\n */\n setInitializers(initializers) {\n this.initializers = initializers;\n\n return this;\n }\n\n /**\n * Removes an initializer from the emitter's initializers array.\n *\n * @param {Initializer} initializer - The initializer to remove\n * @return {Emitter}\n */\n removeInitializer(initializer) {\n const index = this.initializers.indexOf(initializer);\n\n if (index > -1) {\n this.initializers.splice(index, 1);\n }\n\n return this;\n }\n\n /**\n * Removes all initializers.\n *\n * @return {Emitter}\n */\n removeAllInitializers() {\n Util.destroyArray(this.initializers);\n\n return this;\n }\n\n /**\n * Adds a behaviour to the emitter. All emitter behaviours are added to each particle when\n * they are emitted.\n *\n * @param {Behaviour} behaviour - The behaviour to add to the emitter\n * @return {Emitter}\n */\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n\n return this;\n }\n\n /**\n * Adds multiple behaviours to the emitter.\n *\n * @param {array<Behaviour>} behaviours - an array of emitter behaviours\n * @return {Emitter}\n */\n addBehaviours(behaviours) {\n let i = behaviours.length;\n\n while (i--) {\n this.addBehaviour(behaviours[i]);\n }\n\n return this;\n }\n\n /**\n * Sets the emitter's behaviours.\n *\n * @param {array<Behaviour>} behaviours - an array of emitter behaviours\n * @return {Emitter}\n */\n setBehaviours(behaviours) {\n this.behaviours = behaviours;\n\n return this;\n }\n\n /**\n * Removes the behaviour from the emitter's behaviours array.\n *\n * @param {Behaviour} behaviour - The behaviour to remove\n * @return {Emitter}\n */\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n this.behaviours.splice(index, 1);\n }\n\n return this;\n }\n\n /**\n * Removes all behaviours from the emitter.\n *\n * @return {Emitter}\n */\n removeAllBehaviours() {\n Util.destroyArray(this.behaviours);\n\n return this;\n }\n\n /**\n * Adds an emitter behaviour to the emitter.\n *\n * @param {Behaviour} behaviour - The behaviour to add to the emitter\n * @return {Emitter}\n */\n addEmitterBehaviour(behaviour) {\n this.emitterBehaviours.push(behaviour);\n\n behaviour.initialize(this);\n\n return this;\n }\n\n /**\n * Adds multiple behaviours to the emitter.\n *\n * @param {array<Behaviour>} behaviours - an array of emitter behaviours\n * @return {Emitter}\n */\n addEmitterBehaviours(behaviours) {\n let i = behaviours.length;\n\n while (i--) {\n this.addEmitterBehaviour(behaviours[i]);\n }\n\n return this;\n }\n\n /**\n * Sets the emitter's behaviours.\n *\n * @param {array<Behaviour>} behaviours - an array of emitter behaviours\n * @return {Emitter}\n */\n setEmitterBehaviours(behaviours) {\n const length = behaviours.length;\n\n this.emitterBehaviours = behaviours;\n\n for (let i = 0; i < length; i++) {\n this.emitterBehaviours[i].initialize(this);\n }\n\n return this;\n }\n\n /**\n * Removes the behaviour from the emitter's behaviours array.\n *\n * @param {Behaviour} behaviour - The behaviour to remove\n * @return {Emitter}\n */\n removeEmitterBehaviour(behaviour) {\n const index = this.emitterBehaviours.indexOf(behaviour);\n\n if (index > -1) {\n this.emitterBehaviours.splice(index, 1);\n }\n\n return this;\n }\n\n /**\n * Removes all behaviours from the emitter.\n *\n * @return {Emitter}\n */\n removeAllEmitterBehaviours() {\n Util.destroyArray(this.emitterBehaviours);\n\n return this;\n }\n\n /**\n * Adds the event listener for the EMITTER_DEAD event.\n *\n * @param {onEmitterDead} - The function to call when the EMITTER_DEAD is dispatched.\n * @return {Emitter}\n */\n addOnEmitterDeadEventListener(onEmitterDead) {\n this.eventDispatcher.addEventListener(`${this.id}_${EMITTER_DEAD}`, () =>\n onEmitterDead()\n );\n\n return this;\n }\n\n /**\n * Creates a particle by retreiving one from the pool and setting it up with\n * the supplied initializer and behaviour.\n *\n * @return {Emitter}\n */\n createParticle() {\n const particle = this.parent.pool.get(Particle);\n const index = this.particles.length;\n\n this.setupParticle(particle, index);\n this.parent && this.parent.dispatch(PARTICLE_CREATED, particle);\n this.bindEmitterEvent && this.dispatch(PARTICLE_CREATED, particle);\n\n return particle;\n }\n\n /**\n * Sets up a particle by running all initializers on it and setting its behaviours.\n * Also adds the particle to this.particles.\n *\n * @param {Particle} particle - The particle to setup\n * @return void\n */\n setupParticle(particle, index) {\n const { initializers, behaviours } = this;\n\n InitializerUtil.initialize(this, particle, initializers);\n\n particle.addBehaviours(behaviours);\n particle.parent = this;\n particle.index = index;\n\n this.particles.push(particle);\n }\n\n /**\n * Updates the emitter according to the time passed by calling the generate\n * and integrate methods. The generate method creates particles, the integrate\n * method updates existing particles.\n *\n * If the emitter age is greater than time, the emitter is killed.\n *\n * This method also indexes/deindexes particles.\n *\n * @param {number} time - System engine time\n * @return void\n */\n update(time) {\n if (!this.isEmitting && this.particles.length === 0) {\n return;\n }\n\n this.age += time;\n\n if (this.dead || this.age >= this.life) {\n this.destroy();\n }\n\n if (this.isEmitting)\n {\n this.generate(time);\n }\n\n this.integrate(time);\n\n let i = this.particles.length;\n\n while (i--) {\n const particle = this.particles[i];\n\n if (particle.dead) {\n this.parent && this.parent.dispatch(PARTICLE_DEAD, particle);\n this.bindEmitterEvent && this.dispatch(PARTICLE_DEAD, particle);\n this.parent.pool.expire(particle.reset());\n this.particles.splice(i, 1);\n if(this.particles.length === 0)\n {\n this.parent && this.parent.dispatch(SYSTEM_UPDATE);\n }\n }\n }\n\n this.updateEmitterBehaviours(time);\n }\n\n /**\n * Updates the emitter's emitter behaviours.\n *\n * @param {number} time - System engine time\n * @return void\n */\n updateEmitterBehaviours(time) {\n if (this.sleep) {\n return;\n }\n\n const length = this.emitterBehaviours.length;\n\n for (let i = 0; i < length; i++) {\n this.emitterBehaviours[i].applyBehaviour(this, time, i);\n }\n }\n\n /**\n * Runs the integration algorithm on the emitter and all particles.\n * Updates the particles with the timstamp passed.\n *\n * @param {number} time - System engine time\n * @return void\n */\n integrate(time) {\n const integrationType = this.parent\n ? this.parent.integrationType\n : INTEGRATION_TYPE_EULER;\n const damping = 1 - this.damping;\n\n integrate(this, time, damping, integrationType);\n\n let index = this.particles.length;\n\n while (index--) {\n const particle = this.particles[index];\n\n particle.update(time, index);\n integrate(particle, time, damping, integrationType);\n\n this.parent && this.parent.dispatch(PARTICLE_UPDATE, particle);\n this.bindEmitterEvent && this.dispatch(PARTICLE_UPDATE, particle);\n }\n }\n\n /**\n * Generates new particles.\n *\n * @param {number} time - System engine time\n * @return void\n */\n generate(time) {\n if (this.totalEmitTimes === 1) {\n let i = this.rate.getValue(99999);\n\n if (i > 0) {\n this.cID = i;\n }\n\n while (i--) {\n this.createParticle();\n }\n\n this.totalEmitTimes = 0;\n\n return;\n }\n\n this.currentEmitTime += time;\n\n if (this.currentEmitTime < this.totalEmitTimes) {\n let i = this.rate.getValue(time);\n\n if (i > 0) {\n this.cID = i;\n }\n\n while (i--) {\n this.createParticle();\n }\n }\n }\n\n /**\n * Kills the emitter.\n *\n * @return void\n */\n destroy() {\n this.dead = true;\n this.energy = 0;\n this.totalEmitTimes = -1;\n\n if (this.particles.length == 0) {\n this.isEmitting = false;\n this.removeAllInitializers();\n this.removeAllBehaviours();\n this.dispatch(`${this.id}_${EMITTER_DEAD}`);\n\n this.parent && this.parent.removeEmitter(this);\n }\n }\n}\n","import { easeLinear } from '../ease';\n\nexport const DEFAULT_LIFE = Infinity;\nexport const DEFAULT_ATTRACITON_RADIUS = 1000;\nexport const DEFAULT_ATTRACTION_FORCE_SCALAR = 100;\nexport const DEFAULT_BEHAVIOUR_EASING = easeLinear;\nexport const DEFAULT_BEHAVIOUR_EASING_TYPE = 'easeLinear';\nexport const DEFAULT_RANDOM_DRIFT_DELAY = 0.03;\nexport const PARTICLE_ALPHA_THRESHOLD = 0.002;\nexport const PARTICLE_LENGTH_SQ_THRESHOLD = 0.000004;\nexport const DEFAULT_CROSS_TYPE = 'dead';\n","import { DEFAULT_BEHAVIOUR_EASING, DEFAULT_LIFE } from './constants';\n\nimport { BEHAVIOUR_TYPE_ABSTRACT } from './types';\nimport { MEASURE } from '../constants';\nimport isNumber from 'lodash/isNumber';\nimport { uid } from '../utils';\n\n/**\n * The base behaviour class.\n * Behaviours manage a particle's behaviour after they have been emitted.\n *\n */\nexport default class Behaviour {\n /**\n * Constructs a Behaviour instance.\n *\n * @param {number} [life=Infinity] - The life of the behaviour\n * @param {function} [easing=DEFAULT_BEHAVIOUR_EASING] - The behaviour's decaying trend\n * @param {string} [type=BEHAVIOUR_TYPE_ABSTRACT] - The behaviour type\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(\n life = Infinity,\n easing = DEFAULT_BEHAVIOUR_EASING,\n type = BEHAVIOUR_TYPE_ABSTRACT,\n isEnabled = true\n ) {\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n\n /**\n * @desc Determines if the behaviour will be applied or not\n * @type {boolean}\n */\n this.isEnabled = isEnabled;\n\n /**\n * @desc The behaviour's id\n * @type {string} id\n */\n this.id = `behaviour-${uid()}`;\n\n /**\n * @desc The life of the behaviour\n * @type {number}\n */\n this.life = life;\n\n /**\n * @desc The behaviour's decaying trend\n * @type {function}\n */\n this.easing = easing;\n\n /**\n * @desc The age of the behaviour\n * @type {number}\n */\n this.age = 0;\n\n /**\n * @desc The energy of the behaviour\n * @type {number}\n */\n this.energy = 1;\n\n /**\n * Determines if the behaviour is dead or not\n * @type {boolean}\n */\n this.dead = false;\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @param {number} [life=DEFAULT_LIFE] - The life of the behaviour\n * @param {function} [easing=DEFAULT_BEHAVIOUR_EASING] - The behaviour's decaying trend\n */\n reset(life = DEFAULT_LIFE, easing = DEFAULT_BEHAVIOUR_EASING) {\n this.life = life;\n this.easing = easing || DEFAULT_BEHAVIOUR_EASING;\n }\n\n /**\n * Ensures that life is infinity if an invalid value is supplied.\n *\n * @return void\n */\n set life(life) {\n this._life = isNumber(life) ? life : DEFAULT_LIFE;\n }\n\n /**\n * Gets the behaviour's life.\n *\n * @return {Number}\n */\n get life() {\n return this._life;\n }\n\n /**\n * Normalize a force by 1:100;\n *\n * @param {Vector3D} force - The force to normalize.\n * @return {Vector3D}\n */\n normalizeForce(force) {\n return force.scalar(MEASURE);\n }\n\n /**\n * Normalize a value by 1:100;\n *\n * @param {number} value - The value to normalize\n * @return {number}\n */\n normalizeValue(value) {\n return value * MEASURE;\n }\n\n /**\n * Set the behaviour's initial properties on the particle.\n *\n * @param {Particle} particle\n * @abstract\n */\n initialize(particle) {} // eslint-disable-line\n\n /**\n * Apply behaviour to the target as a factor of time.\n * Internally calls the mutate method to change properties on the target\n * Will not do so if the behaviour is disabled\n *\n * @abstract\n * @param {Particle|Emitter} target - The particle or emitter to apply the behaviour to\n * @param {Number} time - the system integration time\n * @param {integer} index - the target index\n * @return mixed\n */\n applyBehaviour(target, time, index) {\n if (!this.isEnabled) {\n return;\n }\n\n this.mutate(target, time, index);\n }\n\n /**\n * Change the target's properties according to specific behaviour logic.\n *\n * @abstract\n * @param {Particle|Emitter} target - The particle or emitter to apply the behaviour to\n * @param {Number} time - the system integration time\n * @return mixed\n */\n mutate(target, time, index) {} // eslint-disable-line\n\n /**\n * Compares the age of the behaviour vs integration time and determines\n * if the behaviour should be set to dead or not.\n * Sets the behaviour energy as a factor of particle age and life.\n *\n * @param {Particle} particle - The particle to apply the behaviour to\n * @param {Number} time - the system integration time\n * @return void\n */\n energize(particle, time) {\n if (this.dead) {\n return;\n }\n\n this.age += time;\n\n if (this.age >= this.life) {\n this.energy = 0;\n this.dead = true;\n\n return;\n }\n\n const scale = this.easing(particle.age / particle.life);\n\n this.energy = Math.max(1 - scale, 0);\n }\n\n /**\n * Destory this behaviour.\n *\n * @abstract\n */\n destroy() {}\n\n /**\n * Returns a new instance of the behaviour from the JSON object passed.\n *\n * @abstract\n * @param {object} json - JSON object containing the required constructor properties\n * @return {Behaviour}\n */\n fromJSON(json) {} // eslint-disable-line\n}\n","import { MathUtils, createSpan } from '../math';\n\nimport Behaviour from './Behaviour';\nimport { PARTICLE_ALPHA_THRESHOLD } from './constants';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_ALPHA as type } from './types';\n\n/**\n * Behaviour that applies an alpha transition effect to particles.\n *\n */\nexport default class Alpha extends Behaviour {\n /**\n * Constructs an Alpha behaviour instance.\n *\n * @param {number} alphaA - The starting alpha value\n * @param {?number} alphaB - The ending alpha value\n * @param {number} life - The life of the behaviour\n * @param {function} easing - The easing equation to use for transforms\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(alphaA = 1, alphaB = null, life, easing, isEnabled = true) {\n super(life, easing, type, isEnabled);\n\n /**\n * @desc The starting alpha value\n * @type {number|Span}\n */\n this.alphaA = alphaA;\n\n /**\n * @desc The ending alpha value\n * @type {number|Span}\n */\n this.alphaB = alphaB;\n\n this.reset(alphaA, alphaB);\n }\n\n /**\n * Gets the _same property which determines if the alpha are the same.\n *\n * @return {boolean}\n */\n get same() {\n return this._same;\n }\n\n /**\n * Sets the _same property which determines if the alpha are the same.\n *\n * @param {boolean} same\n * @return {boolean}\n */\n set same(same) {\n /**\n * @type {boolean}\n */\n this._same = same;\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {number} alphaA - the starting alpha value\n * @param {?number} alphaB - the ending alpha value\n * @param {number} life - the life of the behaviour\n * @param {function} easing - the easing equation to use for transforms\n * @return void\n */\n reset(alphaA = 1, alphaB = null, life, easing) {\n this.same = alphaB === null || alphaB === undefined ? true : false;\n this.alphaA = createSpan(alphaA);\n this.alphaB = createSpan(alphaB);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Initializes the behaviour on a particle.\n *\n * @param {object} particle - the particle to initialize the behaviour on\n * @return void\n */\n initialize(particle) {\n particle.useAlpha = true;\n particle.transform.alphaA = this.alphaA.getValue();\n\n particle.transform.alphaB = this.same\n ? particle.transform.alphaA\n : this.alphaB.getValue();\n }\n\n /**\n * Mutates the target's alpha/opacity property.\n *\n * @param {object} particle - the particle to apply the behaviour to\n * @param {number} time - engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n particle.alpha = MathUtils.lerp(\n particle.transform.alphaA,\n particle.transform.alphaB,\n this.energy\n );\n\n if (particle.alpha < PARTICLE_ALPHA_THRESHOLD) {\n particle.alpha = 0;\n }\n }\n\n /**\n * Creates a Body initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @property {number} json.alphaA - The starting alpha value\n * @property {number} json.alphaB - The ending alpha value\n * @property {number} json.life - The life of the behaviour\n * @property {string} json.easing - The easing equation to use for transforms\n * @return {Body}\n */\n static fromJSON(json) {\n const { alphaA, alphaB, life, easing, isEnabled = true } = json;\n\n return new Alpha(alphaA, alphaB, life, getEasingByName(easing), isEnabled);\n }\n}\n","import {\n DEFAULT_ATTRACITON_RADIUS,\n DEFAULT_ATTRACTION_FORCE_SCALAR,\n DEFAULT_BEHAVIOUR_EASING,\n DEFAULT_LIFE,\n PARTICLE_LENGTH_SQ_THRESHOLD,\n} from './constants';\n\nimport Behaviour from './Behaviour';\nimport { Vector3D } from '../math';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_ATTRACTION as type } from './types';\n\n/**\n * Behaviour that causes particles to be attracted to a target position.\n *\n */\nexport default class Attraction extends Behaviour {\n /**\n * Constructs an Attraction behaviour instance.\n *\n * @param {Vector3D} targetPosition - The position the particles will be attracted to\n * @param {number} force - The attraction force scalar multiplier\n * @param {number} radius - The attraction radius\n * @param {number} [life=DEFAULT_LIFE] - The life of the particle\n * @param {function} [easing=DEFAULT_BEHAVIOUR_EASING] - The behaviour's decaying trend\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(\n targetPosition = new Vector3D(),\n force = DEFAULT_ATTRACTION_FORCE_SCALAR,\n radius = DEFAULT_ATTRACITON_RADIUS,\n life = DEFAULT_LIFE,\n easing = DEFAULT_BEHAVIOUR_EASING,\n isEnabled = true\n ) {\n super(life, easing, type, isEnabled);\n\n /**\n * @desc The position the particles will be attracted to\n * @type {Vector3D}\n */\n this.targetPosition = targetPosition;\n\n /**\n * @desc The attraction radius\n * @type {number} - the attraction radius\n */\n this.radius = radius;\n\n /**\n * @desc The attraction force scalar multiplier\n * @type {number}\n */\n this.force = this.normalizeValue(force);\n\n /**\n * @desc The radius of the attraction squared\n * @type {number}\n */\n this.radiusSq = this.radius * this.radius;\n\n /**\n * @desc The attraction force in 3D space\n * @type {Vector3D}\n */\n this.attractionForce = new Vector3D();\n\n /**\n * @desc The linear attraction force\n * @type {number}\n */\n this.lengthSq = 0;\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {Vector3D} targetPosition - the position the particles will be attracted to\n * @param {number} force - the attraction force multiplier\n * @param {number} radius - the attraction radius\n * @param {number} life - the life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @return void\n */\n reset(\n targetPosition = new Vector3D(),\n force = DEFAULT_ATTRACTION_FORCE_SCALAR,\n radius = DEFAULT_ATTRACITON_RADIUS,\n life,\n easing\n ) {\n this.targetPosition = targetPosition;\n this.radius = radius;\n this.force = this.normalizeValue(force);\n this.radiusSq = this.radius * this.radius;\n this.attractionForce = new Vector3D();\n this.lengthSq = 0;\n\n life && super.reset(life, easing);\n }\n\n /**\n * Mutates particle acceleration.\n *\n * @param {Particle} particle - the particle to apply the behaviour to\n * @param {number} time - particle engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n this.attractionForce.copy(this.targetPosition);\n this.attractionForce.sub(particle.position);\n\n this.lengthSq = this.attractionForce.lengthSq();\n\n if (\n this.lengthSq > PARTICLE_LENGTH_SQ_THRESHOLD &&\n this.lengthSq < this.radiusSq\n ) {\n this.attractionForce.normalize();\n this.attractionForce.scalar(1 - this.lengthSq / this.radiusSq);\n this.attractionForce.scalar(this.force);\n\n particle.acceleration.add(this.attractionForce);\n }\n }\n\n /**\n * Creates a Body initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @property {number} json.x - The target position x value\n * @property {number} json.y - The target position y value\n * @property {number} json.z - The target position z value\n * @property {number} json.force - The attraction force scalar multiplier\n * @property {number} json.life - The life of the particle\n * @property {string} json.easing - The behaviour's decaying trend\n * @return {Body}\n */\n static fromJSON(json) {\n const { x, y, z, force, radius, life, easing, isEnabled = true } = json;\n\n return new Attraction(\n new Vector3D(x, y, z),\n force,\n radius,\n life,\n getEasingByName(easing),\n isEnabled\n );\n }\n}\n","import Behaviour from './Behaviour';\nimport { Vector3D } from '../math';\nimport { BEHAVIOUR_TYPE_COLLISION as type } from './types';\n\n/**\n * Behaviour that causes particles to move away from other particles they collide with.\n */\nexport default class Collision extends Behaviour {\n /**\n * Constructs a Collision behaviour instance.\n *\n * @param {Emitter} emitter - The emitter containing the particles to detect collisions against\n * @param {boolean} useMass - Determiens whether to use mass or not\n * @param {function} onCollide - Function to call when particles collide\n * @param {number} life - The life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(emitter, useMass, onCollide, life, easing, isEnabled = true) {\n super(life, easing, type, isEnabled);\n\n this.reset(emitter, useMass, onCollide);\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {Emitter} emitter - The emitter containing the particles to detect collisions against\n * @param {boolean} useMass - Determiens whether to use mass or not\n * @param {function} onCollide - Function to call when particles collide\n * @param {number} life - The life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @return void\n */\n reset(emitter, useMass, onCollide, life, easing) {\n this.emitter = emitter;\n this.useMass = useMass;\n this.onCollide = onCollide;\n this.particles = [];\n this.delta = new Vector3D();\n\n life && super.reset(life, easing);\n }\n\n /**\n * Detects collisions with other particles and calls the\n * onCollide function on colliding particles.\n *\n * @param {Particle} particle - the particle to apply the behaviour to\n * @param {number} time - particle engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n const particles = this.emitter\n ? this.emitter.particles.slice(index)\n : this.particles.slice(index);\n\n let otherParticle, lengthSq, overlap, distance, averageMass1, averageMass2;\n\n let i = particles.length;\n\n while (i--) {\n otherParticle = particles[i];\n\n if (otherParticle == particle) {\n continue;\n }\n\n this.delta.copy(otherParticle.position).sub(particle.position);\n\n lengthSq = this.delta.lengthSq();\n distance = particle.radius + otherParticle.radius;\n\n if (lengthSq <= distance * distance) {\n overlap = distance - Math.sqrt(lengthSq);\n overlap += 0.5;\n\n averageMass1 = this._getAverageMass(particle, otherParticle);\n averageMass2 = this._getAverageMass(otherParticle, particle);\n\n particle.position.add(\n this.delta\n .clone()\n .normalize()\n .scalar(overlap * -averageMass1)\n );\n\n otherParticle.position.add(\n this.delta.normalize().scalar(overlap * averageMass2)\n );\n\n this.onCollide && this.onCollide(particle, otherParticle);\n }\n }\n }\n\n /**\n * Gets the average mass of both particles.\n *\n * @param {Particle} particleA - The first particle\n * @param {Particle} particleB - The second particle\n * @return {number}\n */\n _getAverageMass(particleA, particleB) {\n return this.useMass\n ? particleB.mass / (particleA.mass + particleB.mass)\n : 0.5;\n }\n\n // TODO\n fromJSON(json) {} // eslint-disable-line\n}\n","import { MathUtils, createColorSpan } from '../math';\n\nimport Behaviour from './Behaviour';\nimport { ColorUtil } from '../utils';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_COLOR as type } from './types';\n\n/**\n * A behaviour which mutates the color of a particle over time.\n *\n */\nexport default class Color extends Behaviour {\n /**\n * Constructs a Color behaviour instance.\n *\n * @param {number|string} colorA - the starting color\n * @param {number|string} colorB - the ending color\n * @param {number} life - the life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(colorA, colorB, life, easing, isEnabled = true) {\n super(life, easing, type, isEnabled);\n\n this.reset(colorA, colorB);\n }\n\n /**\n * Gets the _same property which determines if the alpha are the same.\n *\n * @return {boolean}\n */\n get same() {\n return this._same;\n }\n\n /**\n * Sets the _same property which determines if the alpha are the same.\n *\n * @param {boolean} same\n * @return {boolean}\n */\n set same(same) {\n /**\n * @type {boolean}\n */\n this._same = same;\n }\n\n reset(colorA, colorB, life, easing) {\n this.same = colorB === null || colorB === undefined ? true : false;\n\n this.colorA = createColorSpan(colorA);\n this.colorB = createColorSpan(colorB);\n life && super.reset(life, easing);\n }\n\n initialize(particle) {\n particle.transform.colorA = ColorUtil.getRGB(this.colorA.getValue());\n\n particle.useColor = true;\n particle.transform.colorB = this.same\n ? particle.transform.colorA\n : ColorUtil.getRGB(this.colorB.getValue());\n }\n\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n if (!this._same) {\n particle.color.r = MathUtils.lerp(\n particle.transform.colorA.r,\n particle.transform.colorB.r,\n this.energy\n );\n particle.color.g = MathUtils.lerp(\n particle.transform.colorA.g,\n particle.transform.colorB.g,\n this.energy\n );\n particle.color.b = MathUtils.lerp(\n particle.transform.colorA.b,\n particle.transform.colorB.b,\n this.energy\n );\n } else {\n particle.color.r = particle.transform.colorA.r;\n particle.color.g = particle.transform.colorA.g;\n particle.color.b = particle.transform.colorA.b;\n }\n }\n\n /**\n * Creates a Color initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @property {number} json.colorA - The starting color\n * @property {number} json.colorB - The ending color\n * @property {number} json.life - The life of the particle\n * @property {string} json.easing - The behaviour's decaying trend\n * @return {Color}\n */\n static fromJSON(json) {\n const { colorA, colorB, life, easing, isEnabled = true } = json;\n\n return new Color(colorA, colorB, life, getEasingByName(easing), isEnabled);\n }\n}\n","import * as Zone from '../zone';\n\nimport Behaviour from './Behaviour';\nimport { DEFAULT_CROSS_TYPE } from './constants';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_CROSS_ZONE as type } from './types';\n\n/**\n * Behaviour that allows for specific functions to be called on particles when\n * they interact with a zone.\n *\n */\nexport default class CrossZone extends Behaviour {\n /**\n * Constructs a CrossZone behaviour instance.\n *\n * @param {Zone} zone - the zone used to apply to particles with this behaviour\n * @param {string} [crossType=DEFAULT_CROSS_TYPE] - enum of cross types, valid strings include 'dead', 'bound', 'cross'\n * @param {number} life - The life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n */\n constructor(zone, crossType, life, easing, isEnabled) {\n super(life, easing, type, isEnabled);\n\n this.reset(zone, crossType);\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {Zone} zone - the zone used to apply to particles with this behaviour\n * @param {string} [crossType=DEFAULT_CROSS_TYPE] - enum of cross types, valid strings include 'dead', 'bound', 'cross'\n * @param {number} life - The life of the particle\n * @param {function} easing - The behaviour's decaying trend\n */\n reset(zone, crossType = DEFAULT_CROSS_TYPE, life, easing) {\n /**\n * @desc The zone used to apply to particles with this behaviour\n * @type {Zone}\n */\n this.zone = zone;\n this.zone.crossType = crossType;\n\n life && super.reset(life, easing);\n }\n\n /**\n * Applies the behaviour to the particle.\n *\n * @see {@link '../zone/Zone.js'} crossing\n * @param {object} particle - the particle to apply the behaviour to\n * @param {number} time - engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n this.zone.crossing.call(this.zone, particle);\n }\n\n /**\n * Creates a CrossZone initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @return {CrossZone}\n */\n static fromJSON(json) {\n const {\n zoneType,\n zoneParams,\n crossType,\n life,\n easing,\n isEnabled = true,\n } = json;\n\n const zone = new Zone[zoneType](...Object.values(zoneParams));\n\n return new CrossZone(\n zone,\n crossType,\n life,\n getEasingByName(easing),\n isEnabled\n );\n }\n}\n","import Behaviour from './Behaviour';\nimport { Vector3D } from '../math';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_FORCE as type } from './types';\n/**\n * Behaviour that forces particles along a specific axis.\n *\n */\nexport default class Force extends Behaviour {\n /**\n * Constructs a Force behaviour instance.\n *\n * @param {number} fx - the x axis force\n * @param {number} fy - the y axis force\n * @param {number} fz - the z axis force\n * @param {number} life - the life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(fx, fy, fz, life, easing, isEnabled = true) {\n super(life, easing, type, isEnabled);\n\n this.reset(fx, fy, fz);\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {number} fx - the x axis force\n * @param {number} fy - the y axis force\n * @param {number} fz - the z axis force\n */\n reset(fx, fy, fz) {\n /**\n * @desc The normalized force to exert on the particle in\n * @type {Vector3D}\n */\n this.force = this.normalizeForce(new Vector3D(fx, fy, fz));\n\n /**\n * @desc The id of the force vector\n * @property {number} this.force.id\n */\n this.force.id = Math.random();\n }\n\n /**\n * Mutates the particle.acceleration property.\n *\n * @param {object} particle - the particle to apply the behaviour to\n * @param {number} time - engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n particle.acceleration.add(this.force);\n }\n\n /**\n * Creates a Force initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @return {Force}\n */\n static fromJSON(json) {\n const { fx, fy, fz, life, easing, isEnabled = true } = json;\n\n return new Force(fx, fy, fz, life, getEasingByName(easing), isEnabled);\n }\n}\n","import Force from './Force';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_GRAVITY as type } from './types';\n\n/**\n * Behaviour that forces particles down the y axis.\n *\n */\nexport default class Gravity extends Force {\n /**\n * Constructs a Gravity behaviour instance.\n *\n * @param {number} gravity - the force to pull the particle down the y axis\n * @param {number} life - the life of the particle\n * @param {string} easing - the easing equation to use\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(gravity, life, easing, isEnabled = true) {\n super(0, -gravity, 0, life, easing, isEnabled);\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n }\n\n static fromJSON(json) {\n const { gravity, life, easing, isEnabled = true } = json;\n\n return new Gravity(gravity, life, getEasingByName(easing), isEnabled);\n }\n}\n","import { MathUtils, Vector3D, createSpan } from '../math';\n\nimport Behaviour from './Behaviour';\nimport { DEFAULT_RANDOM_DRIFT_DELAY } from './constants';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_RANDOM_DRIFT as type } from './types';\n\n/**\n * Behaviour that causes particles to drift to random coordinates in 3D space.\n *\n */\nexport default class RandomDrift extends Behaviour {\n /**\n * Constructs a RandomDrift behaviour instance.\n *\n * @param {number} driftX - x axis drift\n * @param {number} driftY - y axis drift\n * @param {number} driftZ - z axis drift\n * @param {number} [delay=DEFAULT_RANDOM_DRIFT_DELAY] - drift delay\n * @param {number} life - The life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @return void\n */\n constructor(\n driftX,\n driftY,\n driftZ,\n delay = DEFAULT_RANDOM_DRIFT_DELAY,\n life,\n easing,\n isEnabled = true\n ) {\n super(life, easing, type, isEnabled);\n\n this.reset(driftX, driftY, driftZ, delay);\n\n /**\n * @desc Internal time used for calculating drift vs internal delay.\n * @type {number}\n */\n this.time = 0;\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {number} driftX - x axis drift\n * @param {number} driftY - y axis drift\n * @param {number} driftZ - z axis drift\n * @param {number} [delay=DEFAULT_RANDOM_DRIFT_DELAY] - drift delay\n * @param {number} life - The life of the particle\n * @param {function} easing - The behaviour's decaying trend\n */\n reset(\n driftX,\n driftY,\n driftZ,\n delay = DEFAULT_RANDOM_DRIFT_DELAY,\n life,\n easing\n ) {\n /**\n * @desc A Vector3D that stores the drift properties.\n * @type {Vector3D}\n */\n this.randomForce = this.normalizeForce(\n new Vector3D(driftX, driftY, driftZ)\n );\n /**\n * @desc A Span containing the delay supplied.\n * @type {Span}\n */\n this.delayPan = createSpan(delay);\n this.time = 0;\n\n life && super.reset(life, easing);\n }\n\n /**\n * Mutates the particle.acceleration property.\n *\n * @param {object} particle - the particle to apply the behaviour to\n * @param {number} time - engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n this.time += time;\n\n if (this.time >= this.delayPan.getValue()) {\n const ax = MathUtils.randomAToB(-this.randomForce.x, this.randomForce.x);\n const ay = MathUtils.randomAToB(-this.randomForce.y, this.randomForce.y);\n const az = MathUtils.randomAToB(-this.randomForce.z, this.randomForce.z);\n\n particle.acceleration.addValue(ax, ay, az);\n\n this.time = 0;\n }\n }\n\n static fromJSON(json) {\n const { x, y, z, delay, life, easing, isEnabled = true } = json;\n\n return new RandomDrift(\n x,\n y,\n z,\n delay,\n life,\n getEasingByName(easing),\n isEnabled\n );\n }\n}\n","import Attraction from './Attraction';\nimport { Vector3D } from '../math';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_REPULSION as type } from './types';\n/**\n * Behaviour that causes particles to be repelled from a target position.\n *\n */\nexport default class Repulsion extends Attraction {\n /**\n * Constructs an Repulsion behaviour instance.\n *\n * @param {Vector3D} targetPosition - The position the particles will be repelled from\n * @param {number} force - The repulsion force scalar multiplier\n * @param {number} radius - The repulsion radius\n * @param {number} life - The life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @return void\n */\n constructor(targetPosition, force, radius, life, easing, isEnabled = true) {\n super(targetPosition, force, radius, life, easing, isEnabled);\n\n /**\n * @desc Repulsion is attraction with negative force.\n * @type {number}\n */\n this.force *= -1;\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {Vector3D} targetPosition - the position the particles will be attracted to\n * @param {number} force - the attraction force multiplier\n * @param {number} radius - the attraction radius\n * @param {number} life - the life of the particle\n * @param {function} easing - The behaviour's decaying trend\n * @return void\n */\n reset(targetPosition, force, radius, life, easing) {\n super.reset(targetPosition, force, radius, life, easing);\n this.force *= -1;\n }\n\n /**\n * Creates a Body initializer from JSON.\n *\n * @param {object} json - The JSON to construct the instance from.\n * @property {number} json.x - The target position x value\n * @property {number} json.y - The target position y value\n * @property {number} json.z - The target position z value\n * @property {number} json.force - The attraction force scalar multiplier\n * @property {number} json.life - The life of the particle\n * @property {string} json.easing - The behaviour's decaying trend\n * @return {Body}\n */\n static fromJSON(json) {\n const { x, y, z, force, radius, life, easing, isEnabled = true } = json;\n\n return new Repulsion(\n new Vector3D(x, y, z),\n force,\n radius,\n life,\n getEasingByName(easing),\n isEnabled\n );\n }\n}\n","import { DR, PI } from '../constants';\nimport { MathUtils, Vector3D, createSpan } from '../math';\n\nimport Behaviour from './Behaviour';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_ROTATE as type } from './types';\n\n/**\n * Behaviour that rotates particles.\n */\nexport default class Rotate extends Behaviour {\n /**\n * Constructs a Rotate behaviour instance.\n *\n * @param {number} x - X axis rotation\n * @param {number} y - Y axis rotation\n * @param {number} z - Z axis rotation\n * @param {number} life - The life of the behaviour\n * @param {function} easing - The easing equation to use for transforms\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(x, y, z, life, easing, isEnabled = true) {\n super(life, easing, type, isEnabled);\n\n this.reset(x, y, z);\n }\n\n /**\n * Gets the rotation type.\n *\n * @return {string}\n */\n get rotationType() {\n return this._rotationType;\n }\n\n /**\n * Sets the rotation type.\n *\n * @param {string}\n * @return void\n */\n set rotationType(rotationType) {\n /**\n * @desc The rotation type. ENUM of ['same', 'set', 'to', 'add'].\n * @type {string}\n */\n this._rotationType = rotationType;\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {number} x - X axis rotation\n * @param {number} y - Y axis rotation\n * @param {number} z - Z axis rotation\n * @param {number} life - the life of the behaviour\n * @param {function} easing - the easing equation to use for transforms\n * @return void\n */\n reset(x, y, z, life, easing) {\n /**\n * @desc X axis rotation.\n * @type {number|Span}\n */\n this.x = x || 0;\n\n /**\n * @desc Y axis rotation.\n * @type {number|Span}\n */\n this.y = y || 0;\n\n /**\n * @desc Z axis rotation.\n * @type {number|Span}\n */\n this.z = z || 0;\n\n if (x === undefined || x == 'same') {\n this.rotationType = 'same';\n } else if (y == undefined) {\n this.rotationType = 'set';\n } else if (z === undefined) {\n this.rotationType = 'to';\n } else {\n this.rotationType = 'add';\n this.x = createSpan(this.x * DR);\n this.y = createSpan(this.y * DR);\n this.z = createSpan(this.z * DR);\n }\n\n life && super.reset(life, easing);\n }\n\n /**\n * Initializes the behaviour on a particle.\n *\n * @param {object} particle - the particle to initialize the behaviour on\n * @return void\n */\n initialize(particle) {\n switch (this.rotationType) {\n case 'same':\n break;\n\n case 'set':\n this._setRotation(particle.rotation, this.x);\n break;\n\n case 'to':\n particle.transform.fR = particle.transform.fR || new Vector3D();\n particle.transform.tR = particle.transform.tR || new Vector3D();\n this._setRotation(particle.transform.fR, this.x);\n this._setRotation(particle.transform.tR, this.y);\n break;\n\n case 'add':\n particle.transform.addR = new Vector3D(\n this.x.getValue(),\n this.y.getValue(),\n this.z.getValue()\n );\n break;\n }\n }\n\n /**\n * Sets the particle's rotation prior to the behaviour being applied.\n *\n * NOTE It's hard to see here, but this is mutating the particle's rotation\n * even though the particle is not being passed in directly.\n *\n * NOTE the else if below will never be reached because the value being passed in\n * will never be of type Vector3D.\n *\n * @param {Vector3D} particleRotation - the particle's rotation vector\n * @param {string|number} value - the value to set the rotation value to, if 'random'\n * rotation is randomised\n * @return void\n */\n _setRotation(particleRotation, value) {\n particleRotation = particleRotation || new Vector3D();\n if (value == 'random') {\n var x = MathUtils.randomAToB(-PI, PI);\n var y = MathUtils.randomAToB(-PI, PI);\n var z = MathUtils.randomAToB(-PI, PI);\n\n particleRotation.set(x, y, z);\n }\n // we can't ever get here because value will never be a Vector3D!\n // consider refactoring to\n // if (value instance of Span) { vec3.add(value.getValue()); }\n else if (value instanceof Vector3D) {\n particleRotation.copy(value);\n }\n }\n\n /**\n * Mutates the particle.rotation property.\n *\n * @see http://stackoverflow.com/questions/21622956/how-to-convert-direction-vector-to-euler-angles\n * @param {object} particle - the particle to apply the behaviour to\n * @param {number} time - engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n switch (this.rotationType) {\n // orients the particle in the direction it is moving\n case 'same':\n if (!particle.rotation) {\n particle.rotation = new Vector3D();\n }\n\n particle.rotation.copy(particle.velocity);\n break;\n\n case 'set':\n //\n break;\n\n case 'to':\n particle.rotation.x = MathUtils.lerp(\n particle.transform.fR.x,\n particle.transform.tR.x,\n this.energy\n );\n particle.rotation.y = MathUtils.lerp(\n particle.transform.fR.y,\n particle.transform.tR.y,\n this.energy\n );\n particle.rotation.z = MathUtils.lerp(\n particle.transform.fR.z,\n particle.transform.tR.z,\n this.energy\n );\n break;\n\n case 'add':\n particle.rotation.add(particle.transform.addR);\n break;\n }\n }\n\n static fromJSON(json) {\n const { x, y, z, life, easing, isEnabled = true } = json;\n\n return new Rotate(x, y, z, life, getEasingByName(easing), isEnabled);\n }\n}\n","import { MathUtils, createSpan } from '../math';\n\nimport Behaviour from './Behaviour';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_SCALE as type } from './types';\n\n/**\n * Behaviour that scales particles.\n *\n */\nexport default class Scale extends Behaviour {\n /**\n * Constructs a Scale behaviour instance.\n *\n * @param {number} scaleA - the starting scale value\n * @param {?number} scaleB - the ending scale value\n * @param {number} life - the life of the behaviour\n * @param {function} easing - the easing equation to use for transforms\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(scaleA, scaleB, life, easing, isEnabled = true) {\n super(life, easing, type, isEnabled);\n\n this.reset(scaleA, scaleB);\n }\n\n /**\n * Gets the _same property which determines if the scale props are the same.\n *\n * @return {boolean}\n */\n get same() {\n return this._same;\n }\n\n /**\n * Sets the _same property which determines if the scale props are the same.\n *\n * @param {boolean} same\n * @return {boolean}\n */\n set same(same) {\n /**\n * @type {boolean}\n */\n this._same = same;\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {number} scaleA - the starting scale value\n * @param {?number} scaleB - the ending scale value\n * @param {number} life - the life of the behaviour\n * @param {function} easing - the easing equation to use for transforms\n * @return void\n */\n reset(scaleA, scaleB, life, easing) {\n this.same = scaleB === null || scaleB === undefined ? true : false;\n\n /**\n * @desc The starting scale.\n * @type {Span}\n */\n this.scaleA = createSpan(scaleA || 1);\n\n /**\n * @desc The ending scale.\n * @type {Span}\n */\n this.scaleB = createSpan(scaleB);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Initializes the behaviour on a particle.\n * Stores initial values for comparison and mutation in the applyBehaviour method.\n *\n * @param {object} particle - the particle to initialize the behaviour on\n * @return void\n */\n initialize(particle) {\n particle.transform.scaleA = this.scaleA.getValue();\n particle.transform.oldRadius = particle.radius;\n\n particle.transform.scaleB = this.same\n ? particle.transform.scaleA\n : this.scaleB.getValue();\n }\n\n /**\n * Applies the behaviour to the particle.\n * Mutates the particle's scale and its radius according to this scale.\n *\n * @param {object} particle - the particle to apply the behaviour to\n * @param {number} time - engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n particle.scale = MathUtils.lerp(\n particle.transform.scaleA,\n particle.transform.scaleB,\n this.energy\n );\n\n if (particle.scale < 0.0005) {\n particle.scale = 0;\n }\n\n particle.radius = particle.transform.oldRadius * particle.scale;\n }\n\n /**\n * Returns a new instance of the behaviour from the JSON object passed.\n *\n * @param {object} json - JSON object containing the required constructor properties\n * @return {Spring}\n */\n static fromJSON(json) {\n const { scaleA, scaleB, life, easing, isEnabled = true } = json;\n\n return new Scale(scaleA, scaleB, life, getEasingByName(easing), isEnabled);\n }\n}\n","import Behaviour from './Behaviour';\nimport { Vector3D } from '../math';\nimport { getEasingByName } from '../ease';\nimport { BEHAVIOUR_TYPE_SPRING as type } from './types';\n\n/**\n * Behaviour that causes particles to spring.\n *\n */\nexport default class Spring extends Behaviour {\n /**\n * Constructs a Spring behaviour instance.\n *\n * @param {number} x - X axis spring\n * @param {number} y - Y axis spring\n * @param {number} z - Z axis spring\n * @param {number} spring - Spring factor\n * @param {number} friction - Spring friction\n * @param {number} life - The life of the behaviour\n * @param {function} easing - The easing equation to use for transforms\n * @param {boolean} [isEnabled=true] - Determines if the behaviour will be applied or not\n * @return void\n */\n constructor(x, y, z, spring, friction, life, easing, isEnabled = true) {\n super(life, easing, type, isEnabled);\n\n this.reset(x, y, z, spring, friction);\n }\n\n /**\n * Resets the behaviour properties.\n *\n * @param {number} x - X axis spring\n * @param {number} y - Y axis spring\n * @param {number} z - Z axis spring\n * @param {number} spring - Spring factor\n * @param {number} friction - Spring friction\n * @return void\n */\n reset(x, y, z, spring, friction) {\n if (!this.pos) {\n this.pos = new Vector3D(x, y, z);\n } else {\n this.pos.set(x, y, z);\n }\n\n this.spring = spring || 0.1;\n this.friction = friction || 0.98;\n }\n\n /**\n * Applies the behaviour to the particle.\n * Mutates the particle's velocity according to this.pos and this.spring.\n *\n * @param {object} particle - the particle to apply the behaviour to\n * @param {number} time - engine time\n * @param {integer} index - the particle index\n * @return void\n */\n mutate(particle, time, index) {\n this.energize(particle, time, index);\n\n particle.velocity.x += (this.pos.x - particle.position.x) * this.spring;\n particle.velocity.y += (this.pos.y - particle.position.y) * this.spring;\n particle.velocity.z += (this.pos.z - particle.position.z) * this.spring;\n }\n\n /**\n * Returns a new instance of the behaviour from the JSON object passed.\n *\n * @param {object} json - JSON object containing the required constructor properties\n * @return {Spring}\n */\n static fromJSON(json) {\n const { x, y, z, spring, friction, life, easing, isEnabled = true } = json;\n\n return new Spring(\n x,\n y,\n z,\n spring,\n friction,\n life,\n getEasingByName(easing),\n isEnabled\n );\n }\n}\n","export { default as Alpha } from './Alpha';\nexport { default as Attraction } from './Attraction';\nexport { default as Collision } from './Collision';\nexport { default as Color } from './Color';\nexport { default as CrossZone } from './CrossZone';\nexport { default as Force } from './Force';\nexport { default as Gravity } from './Gravity';\nexport { default as RandomDrift } from './RandomDrift';\nexport { default as Repulsion } from './Repulsion';\nexport { default as Rotate } from './Rotate';\nexport { default as Scale } from './Scale';\nexport { default as Spring } from './Spring';\nexport { default as Behaviour } from './Behaviour';\n","import * as Behaviour from '../behaviour';\nimport * as Initializer from '../initializer';\n\nimport { EULER, POOL_MAX } from '../constants';\nimport { DEFAULT_DAMPING } from '../emitter/constants';\nimport {\n INITIALIZER_TYPES_THAT_REQUIRE_THREE,\n SUPPORTED_JSON_BEHAVIOUR_TYPES,\n SUPPORTED_JSON_INITIALIZER_TYPES,\n} from './constants';\n\nimport Rate from '../initializer/Rate';\n\n/**\n * Makes a rate instance.\n *\n * @param {object} json - The data required to construct a Rate instance\n * @return {Rate}\n */\nconst makeRate = json => Rate.fromJSON(json);\n\n/**\n * Makes initializers from json items.\n *\n * @param {array<object>} items - An array of objects which provide initializer constructor params\n * @param {object} THREE - The Web GL Api to use\n * @return {array<Initializer>}\n */\nconst makeInitializers = (items, THREE) => {\n const initializers = [];\n\n items.forEach(data => {\n const { type, properties } = data;\n\n if (!SUPPORTED_JSON_INITIALIZER_TYPES.includes(type)) {\n throw new Error(\n `The initializer type ${type} is invalid or not yet supported`\n );\n }\n\n if (INITIALIZER_TYPES_THAT_REQUIRE_THREE.includes(type)) {\n initializers.push(Initializer[type].fromJSON(properties, THREE));\n } else {\n initializers.push(Initializer[type].fromJSON(properties));\n }\n });\n\n return initializers;\n};\n\n/**\n * Makes behaviours from json items.\n *\n * @param {array<object>} items - An array of objects which provide behaviour constructor params\n * @return {array<Behaviour>}\n */\nconst makeBehaviours = items => {\n const behaviours = [];\n\n items.forEach(data => {\n const { type, properties } = data;\n\n if (!SUPPORTED_JSON_BEHAVIOUR_TYPES.includes(type)) {\n throw new Error(\n `The behaviour type ${type} is invalid or not yet supported`\n );\n }\n\n behaviours.push(Behaviour[type].fromJSON(properties));\n });\n\n return behaviours;\n};\n\n/**\n * Creates a System instance from a JSON object.\n *\n * @deprecated Use fromJSONAsync instead.\n *\n * @param {object} json - The JSON to create the System instance from\n * @param {object} THREE - The Web GL Api to use\n * @param {function} System - The system class\n * @param {function} Emitter - The emitter class\n * @param {number} json.preParticles - The predetermined number of particles\n * @param {string} json.integrationType - The integration algorithm to use\n * @param {array<object>} json.emitters - The emitters for the system instance\n * @return {System}\n */\nexport default (json, THREE, System, Emitter) => {\n const {\n preParticles = POOL_MAX,\n integrationType = EULER,\n emitters = [],\n } = json;\n const system = new System(THREE, preParticles, integrationType);\n\n emitters.forEach(data => {\n const emitter = new Emitter();\n const {\n rate,\n rotation,\n initializers,\n behaviours,\n emitterBehaviours = [],\n position,\n totalEmitTimes = Infinity,\n life = Infinity,\n damping = DEFAULT_DAMPING,\n } = data;\n\n emitter.damping = damping;\n emitter\n .setRate(makeRate(rate))\n .setRotation(rotation)\n .setInitializers(makeInitializers(initializers, THREE))\n .setBehaviours(makeBehaviours(behaviours))\n .setEmitterBehaviours(makeBehaviours(emitterBehaviours))\n .setPosition(position)\n .emit(totalEmitTimes, life);\n\n system.addEmitter(emitter);\n });\n\n return system;\n};\n","import * as Behaviour from '../behaviour';\nimport * as Initializer from '../initializer';\n\nimport { EULER, POOL_MAX } from '../constants';\nimport { DEFAULT_DAMPING } from '../emitter/constants';\nimport {\n INITIALIZER_TYPES_THAT_REQUIRE_THREE,\n SUPPORTED_JSON_BEHAVIOUR_TYPES,\n SUPPORTED_JSON_INITIALIZER_TYPES,\n} from './constants';\n\nimport Rate from '../initializer/Rate';\nimport TextureInitializer from '../initializer/Texture';\n\nconst DEFAULT_OPTIONS = { shouldAutoEmit: true };\n\n/**\n * Makes a rate instance.\n *\n * @param {object} json - The data required to construct a Rate instance\n * @return {Rate}\n */\nconst makeRate = json => Rate.fromJSON(json);\n\n/**\n * Makes initializers from json items.\n *\n * @param {array<object>} items - An array of objects which provide initializer constructor params\n * @param {object} THREE - The Web GL Api to use\n * @return {array<Initializer>}\n */\nconst makeInitializers = (items, THREE) =>\n new Promise((resolve, reject) => {\n if (!items.length) {\n return resolve([]);\n }\n\n const numberOfInitializers = items.length;\n const madeInitializers = [];\n const doNotRequireTextureLoading = items.filter(\n ({ properties }) => !properties.texture\n );\n const doRequireTextureLoading = items.filter(\n ({ properties }) => properties.texture\n );\n\n doNotRequireTextureLoading.forEach(data => {\n const { type, properties } = data;\n\n if (!SUPPORTED_JSON_INITIALIZER_TYPES.includes(type)) {\n return reject(\n `The initializer type ${type} is invalid or not yet supported`\n );\n }\n\n if (INITIALIZER_TYPES_THAT_REQUIRE_THREE.includes(type)) {\n madeInitializers.push(Initializer[type].fromJSON(properties, THREE));\n } else {\n madeInitializers.push(Initializer[type].fromJSON(properties));\n }\n\n if (madeInitializers.length === numberOfInitializers) {\n return resolve(madeInitializers);\n }\n });\n\n doRequireTextureLoading.forEach(data => {\n const {\n type,\n properties,\n properties: { texture },\n } = data;\n const textureLoader = new THREE.TextureLoader();\n\n if (!SUPPORTED_JSON_INITIALIZER_TYPES.includes(type)) {\n return reject(\n `The initializer type ${type} is invalid or not yet supported`\n );\n }\n\n textureLoader.load(\n texture,\n loadedTexture => {\n madeInitializers.push(\n TextureInitializer.fromJSON(\n {\n ...properties,\n loadedTexture,\n },\n THREE\n )\n );\n\n if (madeInitializers.length === numberOfInitializers) {\n return resolve(madeInitializers);\n }\n },\n undefined,\n reject\n );\n });\n });\n\n/**\n * Makes behaviours from json items.\n *\n * @param {array<object>} items - An array of objects which provide behaviour constructor params\n * @return {Promise<array>}\n */\nconst makeBehaviours = items =>\n new Promise((resolve, reject) => {\n if (!items.length) {\n return resolve([]);\n }\n\n const numberOfBehaviours = items.length;\n const madeBehaviours = [];\n\n items.forEach(data => {\n const { type, properties } = data;\n\n if (!SUPPORTED_JSON_BEHAVIOUR_TYPES.includes(type)) {\n return reject(\n `The behaviour type ${type} is invalid or not yet supported`\n );\n }\n\n madeBehaviours.push(Behaviour[type].fromJSON(properties));\n\n if (madeBehaviours.length === numberOfBehaviours) {\n return resolve(madeBehaviours);\n }\n });\n });\n\nconst makeEmitters = (emitters, Emitter, THREE, shouldAutoEmit) =>\n new Promise((resolve, reject) => {\n if (!emitters.length) {\n return resolve([]);\n }\n\n const madeEmitters = [];\n const numberOfEmitters = emitters.length;\n\n if (!numberOfEmitters) {\n return resolve(madeEmitters);\n }\n\n emitters.forEach(data => {\n const emitter = new Emitter();\n const {\n rate,\n rotation,\n initializers,\n behaviours,\n emitterBehaviours = [],\n position,\n totalEmitTimes = Infinity,\n life = Infinity,\n damping = DEFAULT_DAMPING,\n } = data;\n\n emitter.damping = damping;\n emitter\n .setRate(makeRate(rate))\n .setRotation(rotation)\n .setPosition(position);\n\n makeInitializers(initializers, THREE)\n .then(madeInitializers => {\n emitter.setInitializers(madeInitializers);\n\n return makeBehaviours(behaviours);\n })\n .then(madeBehaviours => {\n emitter.setBehaviours(madeBehaviours);\n\n return makeBehaviours(emitterBehaviours);\n })\n .then(madeEmitterBehaviours => {\n emitter.setEmitterBehaviours(madeEmitterBehaviours);\n\n return Promise.resolve(emitter);\n })\n .then(emitter => {\n madeEmitters.push(\n shouldAutoEmit\n ? emitter.emit(totalEmitTimes, life)\n : emitter.setTotalEmitTimes(totalEmitTimes).setLife(life)\n );\n\n if (madeEmitters.length === numberOfEmitters) {\n return resolve(madeEmitters);\n }\n })\n .catch(reject);\n });\n });\n\n/**\n * Creates a System instance from a JSON object.\n *\n * @param {object} json - The JSON to create the System instance from\n * @param {number} json.preParticles - The predetermined number of particles\n * @param {string} json.integrationType - The integration algorithm to use\n * @param {array<object>} json.emitters - The emitters for the system instance\n * @param {object} THREE - The Web GL Api to use\n * @param {function} System - The system class\n * @param {function} Emitter - The emitter class\n * @param {object} [options={}] - Optional config options\n * @return {Promise<System>}\n */\nexport default (json, THREE, System, Emitter, options = {}) =>\n new Promise((resolve, reject) => {\n const {\n preParticles = POOL_MAX,\n integrationType = EULER,\n emitters = [],\n } = json;\n const system = new System(preParticles, integrationType);\n const { shouldAutoEmit } = { ...DEFAULT_OPTIONS, ...options };\n\n makeEmitters(emitters, Emitter, THREE, shouldAutoEmit)\n .then(madeEmitters => {\n const numberOfEmitters = madeEmitters.length;\n\n if (!numberOfEmitters) {\n return resolve(system);\n }\n\n madeEmitters.forEach(madeEmitter => {\n system.addEmitter(madeEmitter);\n\n if (system.emitters.length === numberOfEmitters) {\n resolve(system);\n }\n });\n })\n .catch(reject);\n });\n","import EventDispatcher, {\n EMITTER_ADDED,\n EMITTER_REMOVED,\n SYSTEM_UPDATE,\n SYSTEM_UPDATE_AFTER,\n} from '../events';\n\nimport { DEFAULT_SYSTEM_DELTA } from './constants';\nimport Emitter from '../emitter/Emitter';\nimport { INTEGRATION_TYPE_EULER } from '../math/constants';\nimport { POOL_MAX } from '../constants';\nimport Pool from './Pool';\nimport fromJSON from './fromJSON';\nimport fromJSONAsync from './fromJSONAsync';\nimport { CORE_TYPE_SYSTEM as type } from './types';\n\n/**\n * The core of the three-system particle engine.\n * A System instance can contain multiple emitters, each with their own initializers\n * and behaviours.\n *\n */\nexport default class System {\n /**\n * Constructs a System instance.\n *\n * @param {object} THREE - ThreeJs\n * @param {number} [preParticles=POOL_MAX] - The number of particles to start with\n * @param {string} [integrationType=INTEGRATION_TYPE_EULER] - The integration type to use\n * @return void\n */\n constructor(\n preParticles = POOL_MAX,\n integrationType = INTEGRATION_TYPE_EULER\n ) {\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n\n /**\n * @desc Determines if the system can update or not. Set to false when destroying\n * to ensure that external calls to update do not throw errors.\n * @type {boolean}\n */\n this.canUpdate = true;\n\n /**\n * @desc The number of particles to start with.\n * @type {number}\n */\n this.preParticles = preParticles;\n\n /**\n * @desc The integration algorithm type to use.\n * @param {string}\n */\n this.integrationType = integrationType;\n\n /**\n * @desc The emitters in the particle system.\n * @type {array<Emitter>}\n */\n this.emitters = [];\n\n /**\n * @desc The renderers for the system.\n * @type {array<Renderer>}\n */\n this.renderers = [];\n\n /**\n * @desc A pool used to manage the internal system cache of objects\n * @type {Pool}\n */\n this.pool = new Pool();\n\n /**\n * @desc Internal event dispatcher\n * @type {EventDispatcher}\n */\n this.eventDispatcher = new EventDispatcher();\n }\n\n /**\n * Creates a System instance from a JSON object.\n *\n * @param {object} json - The JSON to create the System instance from\n * @param {object} THREE - The Web GL Api to use eg., THREE\n * @return {System}\n *\n * @deprecated use fromJSONAsync instead\n */\n static fromJSON(json, THREE) {\n return fromJSON(json, THREE, System, Emitter);\n }\n\n /**\n * Loads a System instance from JSON asynchronously. Ensures all textures are\n * fully loaded before resolving with the instantiated System instance.\n *\n * @param {object} json - The JSON to create the System instance from\n * @param {object} THREE - The Web GL Api to use eg., THREE\n * @param {?object} options - Optional config options\n * @return {Promise<System>}\n */\n static fromJSONAsync(json, THREE, options) {\n return fromJSONAsync(json, THREE, System, Emitter, options);\n }\n\n /**\n * Proxy method for the internal event dispatcher's dispatchEvent method.\n *\n * @param {string} event - The event to dispatch\n * @param {object<System|Emitter|Particle>} [target=this] - The event target\n */\n dispatch(event, target = this) {\n this.eventDispatcher.dispatchEvent(event, target);\n }\n\n /**\n * Adds a renderer to the System instance and initializes it.\n *\n * @param {Renderer} renderer - The renderer to add\n * @return {System}\n */\n addRenderer(renderer) {\n this.renderers.push(renderer);\n renderer.init(this);\n\n return this;\n }\n\n /**\n * Removes a renderer from the System instance.\n *\n * @param {Renderer} renderer\n * @return {System}\n */\n removeRenderer(renderer) {\n this.renderers.splice(this.renderers.indexOf(renderer), 1);\n renderer.remove(this);\n\n return this;\n }\n\n /**\n * Adds an emitter to the System instance.\n * Dispatches the EMITTER_ADDED event.\n *\n * @param {Emitter} emitter - The emitter to add\n * @return {System}\n */\n addEmitter(emitter) {\n const index = this.emitters.length;\n\n emitter.parent = this;\n emitter.index = index;\n\n this.emitters.push(emitter);\n this.dispatch(EMITTER_ADDED, emitter);\n\n return this;\n }\n\n /**\n * Removes an emitter from the System instance.\n * Dispatches the EMITTER_REMOVED event.\n *\n * @param {Emitter} emitter - The emitter to remove\n * @return {System}\n */\n removeEmitter(emitter) {\n if (emitter.parent !== this) {\n return this;\n }\n\n emitter.parent = null;\n emitter.index = undefined;\n\n this.emitters.splice(this.emitters.indexOf(emitter), 1);\n this.dispatch(EMITTER_REMOVED, emitter);\n\n return this;\n }\n\n /**\n * Wires up life cycle methods and causes a system's emitters to emit particles.\n * Expects emitters to have their totalEmitTimes and life set already.\n * Inifnite systems will resolve immediately.\n *\n * @param {object} hooks - Functions to hook into the life cycle API\n * @param {function} hooks.onStart - Called when the system starts to emit particles\n * @param {function} hooks.onUpdate - Called each time the system updates\n * @param {function} hooks.onEnd - Called when the system's emitters have all died\n * @return {Promise}\n */\n emit({ onStart, onUpdate, onEnd }) {\n if (onStart) {\n onStart();\n }\n\n if (onUpdate) {\n this.eventDispatcher.addEventListener(SYSTEM_UPDATE, onUpdate);\n }\n\n const emitters = this.emitters.map(emitter => {\n const { life } = emitter;\n\n if (life === Infinity) {\n if (onEnd) {\n onEnd();\n }\n\n emitter.experimental_emit();\n\n return Promise.resolve();\n }\n\n return new Promise(resolve => {\n emitter.addOnEmitterDeadEventListener(() => {\n if (onEnd) {\n onEnd();\n }\n\n resolve();\n });\n\n emitter.experimental_emit();\n });\n });\n\n try {\n return Promise.all(emitters);\n } catch (e) {\n console.warn(e);\n }\n }\n\n /**\n * Updates the particle system based on the delta passed.\n *\n * @example\n * animate = () => {\n * threeRenderer.render(threeScene, threeCamera);\n * system.update();\n * requestAnimationFrame(animate);\n * }\n * animate();\n *\n * @param {number} delta - Delta time\n * @return {Promise}\n */\n update(delta = DEFAULT_SYSTEM_DELTA) {\n const d = delta || DEFAULT_SYSTEM_DELTA;\n\n if (this.canUpdate) {\n if (d > 0) {\n let i = this.emitters.length;\n\n while (i--) {\n const emitter = this.emitters[i];\n\n emitter.update(d);\n emitter.particles.length && this.dispatch(SYSTEM_UPDATE);\n }\n }\n\n this.dispatch(SYSTEM_UPDATE_AFTER);\n }\n\n return Promise.resolve();\n }\n\n /**\n * Gets a count of the total number of particles in the system.\n *\n * @return {integer}\n */\n getCount() {\n const length = this.emitters.length;\n\n let total = 0;\n\n let i;\n\n for (i = 0; i < length; i++) {\n total += this.emitters[i].particles.length;\n }\n\n return total;\n }\n\n /**\n * Destroys all emitters, renderers and the Nebula pool.\n * Ensures that this.update will not perform any operations while the system\n * is being destroyed.\n *\n * @return void\n */\n destroy() {\n const length = this.emitters.length;\n\n this.canUpdate = false;\n\n for (let e = 0; e < length; e++) {\n this.emitters[e] && this.emitters[e].destroy();\n delete this.emitters[e];\n }\n\n for (let r = 0; r < length; r++) {\n if (this.renderers[r] && this.renderers[r].destroy) {\n this.renderers[r].destroy();\n delete this.renderers[r];\n }\n }\n\n this.emitters.length = 0;\n this.pool.destroy();\n this.canUpdate = true;\n }\n}\n","import { DEFAULT_POSITION, DEFAULT_SIZE as size } from './constants';\n\n/**\n * @exports Debug - methods and helpers for debugging System emitters, zones and particles.\n * @requires THREE - { SphereGeometry, BoxGeometry, MeshBasicMaterial, OctahedronGeometry, Mesh }\n */\nexport default {\n /**\n * Adds an event listener to the system instance's SYSTEM_UPDATE event.\n *\n * @param {System} system - the system instance\n * @param {function} onSystemUpdated - the function to call when system has been updated\n * @return {Debug}\n */\n addEventListener: function(system, onSystemUpdated) {\n system.eventDispatcher.addEventListener('SYSTEM_UPDATE', onSystemUpdated);\n\n return this;\n },\n\n /**\n * Draws a wireframe mesh around the zone for debugging purposes.\n *\n * @param {System} system - the system instance\n * @param {object} container - a three Object3D (usually the scene)\n * @param {Zone} zone - a Zone instance\n * @return void\n */\n drawZone: function(THREE, system, container, zone = {}) {\n const color = '#2194ce';\n const wireframe = true;\n const {\n width = size,\n height = size,\n depth = size,\n radius = size,\n x = DEFAULT_POSITION,\n y = DEFAULT_POSITION,\n z = DEFAULT_POSITION,\n } = zone;\n\n let geometry;\n\n if (zone.isPointZone()) {\n geometry = new THREE.SphereGeometry(15);\n }\n\n if (zone.isLineZone()) {\n // TODO\n }\n\n if (zone.isBoxZone()) {\n geometry = new THREE.BoxGeometry(width, height, depth);\n }\n\n if (zone.isSphereZone()) {\n geometry = new THREE.SphereGeometry(radius, size, size);\n }\n\n if (zone.isMeshZone()) {\n geometry = zone.geometry.geometry\n ? zone.geometry.geometry.clone()\n : zone.geometry.clone();\n }\n\n if (!geometry) {\n geometry = new THREE.BoxGeometry(width, height, depth);\n }\n\n const material = new THREE.MeshBasicMaterial({ color, wireframe });\n // NOTE! geometry.clone is required for UNKNOWN reasons,\n // three does not render the mesh correctly without doing this since r88\n const mesh = new THREE.Mesh(geometry.clone(), material);\n\n container.add(mesh);\n\n this.addEventListener(system, function() {\n mesh.position.set(x, y, z);\n });\n },\n\n /**\n * Draws a mesh for each particle emitted in order to help debug particles.\n *\n * @param {object} system - the system instance\n * @param {object} container - a three Object3D (usually the scene)\n * @param {object} emitter - the emitter to debug\n * @param {string} color - the color for the debug mesh material\n * @return void\n */\n drawEmitter: function(THREE, system, container, emitter, color) {\n const geometry = new THREE.OctahedronGeometry(size);\n const material = new THREE.MeshBasicMaterial({\n color: color || '#aaa',\n wireframe: true,\n });\n // NOTE! geometry.clone is required for UNKNOWN reasons,\n // three does not render the mesh correctly without doing this since r88\n const mesh = new THREE.Mesh(geometry.clone(), material);\n\n container.add(mesh);\n\n this.addEventListener(system, function() {\n mesh.position.copy(emitter.position);\n mesh.rotation.set(\n emitter.rotation.x,\n emitter.rotation.y,\n emitter.rotation.z\n );\n });\n },\n\n /**\n * Renders emitter / particle information into the info element.\n *\n * @param {object} system - the system instance\n * @param {integer} style - style to apply (see the addInfo method's switch statement)\n * @return void\n */\n renderInfo: (function() {\n function getCreatedNumber(type, system) {\n var pool = type == 'material' ? '_materialPool' : '_targetPool';\n var renderer = system.renderers[0];\n\n return renderer[pool].cID;\n }\n\n function getEmitterPos(system) {\n var e = system.emitters[0];\n\n return (\n Math.round(e.p.x) + ',' + Math.round(e.p.y) + ',' + Math.round(e.p.z)\n );\n }\n\n return function(system, style) {\n this.addInfo(style);\n var str = '';\n\n switch (this._infoType) {\n case 2:\n str += 'emitter:' + system.emitters.length + '<br>';\n str += 'em speed:' + system.emitters[0].cID + '<br>';\n str += 'pos:' + getEmitterPos(system);\n break;\n\n case 3:\n str += system.renderers[0].name + '<br>';\n str += 'target:' + getCreatedNumber('target') + '<br>';\n str += 'material:' + getCreatedNumber('material');\n break;\n\n default:\n str += 'particles:' + system.getCount() + '<br>';\n str += 'pool:' + system.pool.getCount() + '<br>';\n str += 'total:' + (system.getCount() + system.pool.getCount());\n }\n this._infoCon.innerHTML = str;\n };\n })(),\n\n /**\n * Appends the info element into the dom.\n *\n * @param {integer} style - the style type to apply\n * @return void\n */\n addInfo: (function() {\n return function(style) {\n var self = this;\n\n if (!this._infoCon) {\n this._infoCon = document.createElement('div');\n this._infoCon.style.cssText = [\n 'position:fixed;bottom:0px;left:0;cursor:pointer;',\n 'opacity:0.9;z-index:10000;padding:10px;font-size:12px;',\n 'width:120px;height:50px;background-color:#002;color:#0ff;',\n ].join('');\n\n this._infoType = 1;\n this._infoCon.addEventListener(\n 'click',\n function() {\n self._infoType++;\n if (self._infoType > 3) self._infoType = 1;\n },\n false\n );\n\n var bg, color;\n\n switch (style) {\n case 2:\n bg = '#201';\n color = '#f08';\n break;\n\n case 3:\n bg = '#020';\n color = '#0f0';\n break;\n\n default:\n bg = '#002';\n color = '#0ff';\n }\n\n this._infoCon.style['background-color'] = bg;\n this._infoCon.style['color'] = color;\n }\n\n if (!this._infoCon.parentNode) document.body.appendChild(this._infoCon);\n };\n })(),\n};\n","/**\n * You can use this emit particles.\n *\n * This method will console.log the fixed number of your info in updata or requestAnimationFrame\n *\n * use like this log('+12',mc); log 12 times\n *\n * @return void\n */\nexport default function() {\n let once = 0;\n\n if (window.console && window.console.trace) {\n var arg = Array.prototype.slice.call(arguments);\n var s1 = arguments[0] + '';\n\n if (s1.indexOf('+') == 0) {\n var n = parseInt(arguments[0]);\n\n if (once < n) {\n arg.shift();\n console.trace.apply(console, arg);\n once++;\n }\n } else {\n arg.unshift('+15');\n this.apply(console, arg);\n }\n }\n}\n","import Emitter from './Emitter';\nimport THREEUtil from '../utils/THREEUtil';\nimport Util from '../utils/Util';\nimport { EMITTER_TYPE_FOLLOW as type } from './types';\n\nexport default class FollowEmitter extends Emitter {\n /**\n * The FollowEmitter class inherits from System.Emitter\n *\n * use the FollowEmitter will emit particle when mousemoving\n *\n * @class System.FollowEmitter\n * @constructor\n * @param {Element} mouseTarget mouseevent's target;\n * @param {Number} ease the easing of following speed;\n * @default 0.7\n * @param {Object} pObj the parameters object;\n */\n constructor(mouseTarget, ease, pObj) {\n super(pObj);\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n this.mouseTarget = Util.initValue(mouseTarget, window);\n this.ease = Util.initValue(ease, 0.7);\n this._allowEmitting = false;\n this.initEventHandler();\n }\n\n initEventHandler() {\n var self = this;\n\n this.mousemoveHandler = function(e) {\n self.mousemove.call(self, e);\n };\n\n this.mousedownHandler = function(e) {\n self.mousedown.call(self, e);\n };\n\n this.mouseupHandler = function(e) {\n self.mouseup.call(self, e);\n };\n\n this.mouseTarget.addEventListener(\n 'mousemove',\n this.mousemoveHandler,\n false\n );\n }\n\n /**\n * start emit particle\n * @method emit\n */\n emit() {\n this._allowEmitting = true;\n }\n\n /**\n * stop emiting\n * @method stopEmit\n */\n stopEmit() {\n this._allowEmitting = false;\n }\n\n setCameraAndCanvas(camera, canvas) {\n this.camera = camera;\n this.canvas = canvas;\n }\n\n mousemove(e) {\n if (e.layerX || e.layerX == 0) {\n this.position.x += (e.layerX - this.position.x) * this.ease;\n this.position.y += (e.layerY - this.position.y) * this.ease;\n } else if (e.offsetX || e.offsetX == 0) {\n this.position.x += (e.offsetX - this.position.x) * this.ease;\n this.position.y += (e.offsetY - this.position.y) * this.ease;\n }\n\n this.position.copy(\n THREEUtil.toSpacePos(this.position, this.camera, this.canvas)\n );\n\n if (this._allowEmitting) super.emit('once');\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.mouseTarget.removeEventListener(\n 'mousemove',\n this.mousemoveHandler,\n false\n );\n }\n}\n","import {\n PARTICLE_CREATED,\n PARTICLE_DEAD,\n PARTICLE_UPDATE,\n SYSTEM_UPDATE,\n} from '../events/constants';\n\nimport { RENDERER_TYPE_BASE } from './types';\nimport { __DEV__ } from '../constants';\n\nexport default class BaseRenderer {\n constructor(type = RENDERER_TYPE_BASE) {\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n }\n\n init(system) {\n var self = this;\n\n this.system = system;\n\n this.system.eventDispatcher.addEventListener(SYSTEM_UPDATE, function(\n system\n ) {\n self.onSystemUpdate.call(self, system);\n });\n\n this.system.eventDispatcher.addEventListener(PARTICLE_CREATED, function(\n particle\n ) {\n self.onParticleCreated.call(self, particle);\n });\n\n this.system.eventDispatcher.addEventListener(PARTICLE_UPDATE, function(\n particle\n ) {\n self.onParticleUpdate.call(self, particle);\n });\n\n this.system.eventDispatcher.addEventListener(PARTICLE_DEAD, function(\n particle\n ) {\n self.onParticleDead.call(self, particle);\n });\n\n this.logRendererType();\n }\n\n remove() {\n this.system = null;\n }\n\n /**\n * @abstract\n */\n onParticleCreated(particle) {} // eslint-disable-line\n\n /**\n * @abstract\n */\n onParticleUpdate(particle) {} // eslint-disable-line\n\n /**\n * @abstract\n */\n onParticleDead(particle) {} // eslint-disable-line\n\n /**\n * @abstract\n */\n onSystemUpdate(system) {} // eslint-disable-line\n\n /**\n * Logs the renderer type being used when in development mode.\n *\n * @return void\n */\n logRendererType() {\n if (!__DEV__) {\n return;\n }\n\n console.log(`${this.type}`);\n }\n}\n","import BaseRenderer from './BaseRenderer';\nimport { Pool } from '../core';\nimport { RENDERER_TYPE_CUSTOM as type } from './types';\n\nexport default class CustomRenderer extends BaseRenderer {\n constructor() {\n super(type);\n\n this.targetPool = new Pool();\n this.materialPool = new Pool();\n }\n\n onSystemUpdate() {}\n\n onParticleCreated(particle) {} // eslint-disable-line\n\n onParticleUpdate(particle) {} // eslint-disable-line\n\n onParticleDead(particle) {} // eslint-disable-line\n}\n","import BaseRenderer from './BaseRenderer';\nimport { PUID } from '../utils';\nimport { Pool } from '../core';\nimport { RENDERER_TYPE_MESH as type } from './types';\n\n/**\n * @requires THREE - { Mesh, BoxGeometry, MeshLambertMaterial }\n */\nexport default class MeshRenderer extends BaseRenderer {\n /**\n * @param {object} container - An Object3D container, usually a THREE.Scene\n * @param {object} THREE - THREE Api\n */\n constructor(container, THREE) {\n super(type);\n\n this.container = container;\n this._targetPool = new Pool();\n this._materialPool = new Pool();\n this._body = new THREE.Mesh(\n new THREE.BoxGeometry(50, 50, 50),\n new THREE.MeshLambertMaterial({ color: '#ff0000' })\n );\n }\n\n isThreeSprite(particle) {\n return particle.target.isSprite;\n }\n\n onSystemUpdate() {}\n\n onParticleCreated(particle) {\n if (!particle.target) {\n //set target\n if (!particle.body) particle.body = this._body;\n particle.target = this._targetPool.get(particle.body);\n\n //set material\n if (particle.useAlpha || particle.useColor) {\n particle.target.material.__puid = PUID.id(particle.body.material);\n particle.target.material = this._materialPool.get(\n particle.target.material\n );\n }\n }\n\n if (particle.target) {\n particle.target.position.copy(particle.position);\n this.container.add(particle.target);\n }\n }\n\n onParticleUpdate(particle) {\n const { target, useAlpha, useColor } = particle;\n\n if (!target) {\n return;\n }\n\n target.position.copy(particle.position);\n\n this.rotate(particle);\n\n this.scale(particle);\n\n if (useAlpha) {\n target.material.opacity = particle.alpha;\n target.material.transparent = true;\n }\n\n if (useColor) {\n target.material.color.copy(particle.color);\n }\n }\n\n rotate(particle) {\n particle.target.rotation.set(particle.rotation.x, particle.rotation.y, particle.rotation.z);\n }\n\n scale(particle) {\n particle.target.scale.set(particle.scale, particle.scale, particle.scale);\n }\n\n onParticleDead(particle) {\n if (particle.target) {\n if (particle.useAlpha || particle.useColor)\n this._materialPool.expire(particle.target.material);\n\n this._targetPool.expire(particle.target);\n this.container.remove(particle.target);\n particle.target = null;\n }\n }\n}\n","import MeshRenderer from './MeshRenderer';\nimport { RENDERER_TYPE_SPRITE as type } from './types';\n\n/**\n * @requires THREE - { Mesh, BoxGeometry, MeshLambertMaterial, Sprite, SpriteMaterial }\n */\nexport default class SpriteRenderer extends MeshRenderer {\n constructor(container, THREE) {\n super(container, THREE);\n\n /**\n * @desc The class type.\n * @type {string}\n */\n this.type = type;\n this._body = new THREE.Sprite(\n new THREE.SpriteMaterial({ color: 0xffffff })\n );\n }\n\n rotate(particle) {\n particle.target.material.rotation = particle.rotation.z;\n }\n\n scale(particle) {\n particle.target.scale.set(\n particle.scale * particle.radius,\n particle.scale * particle.radius,\n 1\n );\n }\n}\n","// Primitives\nexport const DEFAULT_MAX_PARTICLES = 10000;\nexport const VECTOR_3_SIZE = ['x', 'y', 'z'].length;\nexport const RGBA_SIZE = ['r', 'g', 'b', 'a'].length;\nexport const FLOAT_BYTE_SIZE = 4;\n\n// Byte sizes\nexport const POSITION_BYTE_SIZE = VECTOR_3_SIZE * FLOAT_BYTE_SIZE;\nexport const ROTATION_BYTE_SIZE = FLOAT_BYTE_SIZE;\nexport const SIZE_BYTE_SIZE = FLOAT_BYTE_SIZE;\nexport const RGBA_BYTE_SIZE = RGBA_SIZE * FLOAT_BYTE_SIZE;\nexport const ALL_BYTE_SIZES = [\n POSITION_BYTE_SIZE,\n ROTATION_BYTE_SIZE,\n SIZE_BYTE_SIZE,\n RGBA_BYTE_SIZE,\n];\nexport const PARTICLE_BYTE_SIZE = ALL_BYTE_SIZES.reduce(\n (cur, acc) => cur + acc\n);\n\n// Attributes\nexport const POSITION_ATTRIBUTE_BUFFER_SIZE = VECTOR_3_SIZE;\nexport const ROTATION_ATTRIBUTE_BUFFER_SIZE = 1;\nexport const SIZE_ATTRIBUTE_BUFFER_SIZE = 1;\nexport const RGBA_ATTRIBUTE_BUFFER_SIZE = RGBA_SIZE;\nexport const ALPHA_ATTRIBUTE_BUFFER_SIZE = 1;\nexport const TEXID_ATTRIBUTE_BUFFER_SIZE = 2;\n\nexport const ATTRIBUTE_TO_SIZE_MAP = {\n position: POSITION_ATTRIBUTE_BUFFER_SIZE,\n rotation: ROTATION_ATTRIBUTE_BUFFER_SIZE,\n size: SIZE_ATTRIBUTE_BUFFER_SIZE,\n // THREE.Color does not contain alpha, so we will have separate attributes for these\n color: RGBA_ATTRIBUTE_BUFFER_SIZE,\n alpha: ALPHA_ATTRIBUTE_BUFFER_SIZE,\n texID: TEXID_ATTRIBUTE_BUFFER_SIZE,\n};\n\nexport const PARTICLE_STRIDE = [\n POSITION_ATTRIBUTE_BUFFER_SIZE,\n ROTATION_ATTRIBUTE_BUFFER_SIZE,\n SIZE_ATTRIBUTE_BUFFER_SIZE,\n RGBA_ATTRIBUTE_BUFFER_SIZE,\n ALPHA_ATTRIBUTE_BUFFER_SIZE,\n TEXID_ATTRIBUTE_BUFFER_SIZE,\n].reduce((cur, acc) => cur + acc);\n","import { DEFAULT_MAX_PARTICLES } from './ParticleBuffer/constants';\n\nexport const DEFAULT_RENDERER_OPTIONS = {\n blending: 'AdditiveBlending',\n baseColor: 0xffffff,\n depthTest: true,\n depthWrite: false,\n transparent: true,\n maxParticles: DEFAULT_MAX_PARTICLES,\n shouldDebugTextureAtlas: false,\n shouldForceDesktopRenderer: false,\n shouldForceMobileRenderer: false,\n};\n","/**\n * Simple class that stores the particle's \"target\" or \"next\" state.\n *\n */\nexport class Target {\n constructor(THREE) {\n this.position = new THREE.Vector3();\n this.rotation = new THREE.Vector3();\n this.size = 0;\n this.color = new THREE.Color();\n this.alpha = 0;\n this.texture = null;\n this.index = 0;\n }\n\n reset() {\n this.position.set(0, 0, 0);\n this.rotation.set(0, 0, 0);\n this.size = 0;\n this.color.setRGB(0, 0, 0);\n this.alpha = 0;\n this.texture = null;\n }\n}\n","/**\n * Map of particle IDs to integer ids\n */\nexport class UniqueList {\n constructor(max = Infinity) {\n this.max = max;\n this.count = 0;\n this._items = {};\n }\n\n add(item) {\n if (this._items[item] !== undefined) {\n return;\n }\n\n this._items[item] = this.count++;\n }\n\n find(item) {\n return this._items[item];\n }\n\n destroy() {\n this._items = {};\n this.count = 0;\n }\n}\n","import {\n ATTRIBUTE_TO_SIZE_MAP,\n DEFAULT_MAX_PARTICLES,\n PARTICLE_BYTE_SIZE,\n} from './constants';\n\nlet THREE;\n\n/**\n * Creates and provides performant buffers for mapping particle properties to geometry vertices.\n *\n * @author thrax <manthrax@gmail.com>\n * @author rohan-deshpande <rohan@creativelifeform.com>\n * @see https://threejs.org/examples/?q=buffe#webgl_buffergeometry_points_interleaved\n * @see https://threejs.org/examples/?q=points#webgl_custom_attributes_points\n */\nexport default class ParticleBuffer {\n constructor(maxParticles = DEFAULT_MAX_PARTICLES, three) {\n THREE = three;\n this.maxParticles = maxParticles;\n\n this.createInterleavedBuffer().createBufferGeometry();\n }\n\n /**\n * Creates the interleaved buffer that will be used to write data to the GPU.\n *\n * @return {ParticleBuffer}\n */\n createInterleavedBuffer() {\n const arrayBuffer = new ArrayBuffer(this.maxParticles * PARTICLE_BYTE_SIZE);\n\n this.interleavedBuffer = new THREE.InterleavedBuffer(\n new Float32Array(arrayBuffer),\n PARTICLE_BYTE_SIZE\n );\n // this.interleavedBuffer.usage = THREE.DynamicDrawUsage;\n \n return this;\n }\n\n /**\n * Sets the geometry's buffer attributes.\n *\n * NOTE Each attribute needs to be set at the right index in the buffer right after the previous\n * attribute that occupies a set amount of size in the buffer.\n *\n * @return {ParticleBufferGeometry}\n */\n createBufferGeometry() {\n this.geometry = new THREE.BufferGeometry();\n\n const { interleavedBuffer, geometry } = this;\n\n Object.keys(ATTRIBUTE_TO_SIZE_MAP).reduce((offset, attribute) => {\n const size = ATTRIBUTE_TO_SIZE_MAP[attribute];\n\n geometry.setAttribute(\n attribute,\n new THREE.InterleavedBufferAttribute(interleavedBuffer, size, offset)\n );\n\n return (offset += size);\n }, 0);\n\n return this;\n }\n\n /**\n * Gets the publicly accessible interleaved buffer.\n *\n * @return {THREE.InterleavedBuffer} buffers - The interleaved buffer\n */\n get buffer() {\n return this.interleavedBuffer;\n }\n\n get stride() {\n return PARTICLE_BYTE_SIZE;\n }\n}\n","\nexport default function potpack(boxes) {\n\n // calculate total box area and maximum box width\n let area = 0;\n let maxWidth = 0;\n\n for (const box of boxes) {\n area += box.w * box.h;\n maxWidth = Math.max(maxWidth, box.w);\n }\n\n // sort the boxes for insertion by height, descending\n boxes.sort((a, b) => b.h - a.h);\n\n // aim for a squarish resulting container,\n // slightly adjusted for sub-100% space utilization\n const startWidth = Math.max(Math.ceil(Math.sqrt(area / 0.95)), maxWidth);\n\n // start with a single empty space, unbounded at the bottom\n const spaces = [{x: 0, y: 0, w: startWidth, h: Infinity}];\n\n let width = 0;\n let height = 0;\n\n for (const box of boxes) {\n // look through spaces backwards so that we check smaller spaces first\n for (let i = spaces.length - 1; i >= 0; i--) {\n const space = spaces[i];\n\n // look for empty spaces that can accommodate the current box\n if (box.w > space.w || box.h > space.h) continue;\n\n // found the space; add the box to its top-left corner\n // |-------|-------|\n // | box | |\n // |_______| |\n // | space |\n // |_______________|\n box.x = space.x;\n box.y = space.y;\n\n height = Math.max(height, box.y + box.h);\n width = Math.max(width, box.x + box.w);\n\n if (box.w === space.w && box.h === space.h) {\n // space matches the box exactly; remove it\n const last = spaces.pop();\n if (i < spaces.length) spaces[i] = last;\n\n } else if (box.h === space.h) {\n // space matches the box height; update it accordingly\n // |-------|---------------|\n // | box | updated space |\n // |_______|_______________|\n space.x += box.w;\n space.w -= box.w;\n\n } else if (box.w === space.w) {\n // space matches the box width; update it accordingly\n // |---------------|\n // | box |\n // |_______________|\n // | updated space |\n // |_______________|\n space.y += box.h;\n space.h -= box.h;\n\n } else {\n // otherwise the box splits the space into two spaces\n // |-------|-----------|\n // | box | new space |\n // |_______|___________|\n // | updated space |\n // |___________________|\n spaces.push({\n x: space.x + box.w,\n y: space.y,\n w: space.w - box.w,\n h: box.h\n });\n space.y += box.h;\n space.h -= box.h;\n }\n break;\n }\n }\n\n return {\n w: width, // container width\n h: height, // container height\n fill: (area / (width * height)) || 0 // space utilization\n };\n}\n","import {\n RENDERER_TYPE_GPU_DESKTOP,\n RENDERER_TYPE_GPU_MOBILE,\n} from '../../../types';\n\nimport { DATA_TEXTURE_SIZE } from './constants';\nimport { __DEV__ } from '../../../../constants';\nimport potpack from 'potpack';\n\n/**\n * Dynamic texture atlas for performant support of systems with multiple emitters and textures.\n *\n */\nexport default class TextureAtlas {\n constructor(renderer, shouldDebug) {\n const { three: THREE, type: rendererType } = renderer;\n const data = new Float32Array(DATA_TEXTURE_SIZE * 4);\n const ctx = (this.ctx = document.createElement('canvas').getContext('2d'));\n const { canvas } = ctx;\n\n this.shouldDebug = shouldDebug;\n this.rendererType = rendererType;\n this.indexData = data;\n this.canvas = canvas;\n this.entries = [];\n\n if (rendererType === RENDERER_TYPE_GPU_DESKTOP) {\n this.atlasIndex = new THREE.DataTexture(\n data,\n DATA_TEXTURE_SIZE,\n 1,\n THREE.RGBAFormat,\n THREE.FloatType\n );\n }\n\n canvas.width = canvas.height = DATA_TEXTURE_SIZE;\n\n if (shouldDebug) {\n this.debug(canvas, ctx);\n }\n\n this.atlasTexture = new THREE.CanvasTexture(canvas);\n this.atlasTexture.flipY = false;\n\n renderer.material.uniforms.uTexture.value = this.atlasTexture;\n\n if (rendererType === RENDERER_TYPE_GPU_DESKTOP) {\n renderer.material.uniforms.atlasIndex.value = this.atlasIndex;\n }\n\n renderer.material.uniformsNeedUpdate = true;\n }\n\n /**\n * Logs to the console when in dev mode.\n *\n */\n log(...args) {\n if (!__DEV__) {\n return;\n }\n\n console.log(...args);\n }\n\n /**\n * Debugs the texture atlas by rendering it to a canvas in the DOM.\n *\n */\n debug() {\n const { canvas, ctx } = this;\n const halfmax = canvas.width;\n\n ctx.fillStyle = 'purple';\n ctx.fillRect(0, 0, halfmax, halfmax);\n ctx.fillStyle = 'green';\n ctx.fillRect(0, halfmax, halfmax, halfmax);\n ctx.fillStyle = 'blue';\n ctx.fillRect(halfmax, 0, halfmax, halfmax);\n ctx.fillStyle = 'orange';\n ctx.fillRect(halfmax, halfmax, halfmax, halfmax);\n ctx.fillStyle = 'yellow';\n ctx.font = canvas.width + 'px Verdana';\n ctx.fillText('top row', 100, 500);\n ctx.fillStyle = 'pink';\n ctx.fillText('bottom row', 100, 1500);\n\n canvas.style.position = 'absolute';\n canvas.style.width = canvas.style.height = '300px';\n canvas.style.left = canvas.style.top = '0px';\n canvas.style.zIndex = 100;\n\n document.body.appendChild(canvas);\n }\n\n /**\n * Adds a texture to the texture atlas and flags that the atlas needs to be updated.\n *\n */\n addTexture(texture) {\n this.log('Adding texture to atlas:', texture.uuid);\n\n texture.textureIndex = this.entries.length;\n this.entries.push({ texture: texture });\n this.needsUpdate = true;\n }\n\n /**\n * Updates the texture atlas. Will only rebuild the atlas if all images are loaded.\n *\n */\n update() {\n if (!this.needsUpdate) {\n return;\n }\n\n const {\n entries,\n canvas,\n indexData,\n ctx,\n atlasIndex,\n atlasTexture,\n rendererType,\n } = this;\n\n for (let i = 0; i < entries.length; i++) {\n if (!entries[i].texture.image) {\n return;\n }\n }\n\n this.needsUpdate = false;\n\n for (let i = 0; i < entries.length; i++) {\n const e = entries[i];\n const { texture } = e;\n const { width, height } = texture.image;\n\n e.w = width;\n e.h = height;\n }\n\n const stats = potpack(entries);\n\n this.log('Rebuilt atlas:', stats);\n\n if (canvas.width != stats.w || canvas.height != stats.h) {\n canvas.width = stats.w;\n canvas.height = stats.h;\n }\n\n for (let i = 0; i < entries.length; i++) {\n const e = this.entries[i];\n const ii = e.texture.textureIndex * 4;\n\n if (rendererType === RENDERER_TYPE_GPU_DESKTOP) {\n indexData[ii + 0] = e.x / canvas.width;\n indexData[ii + 1] = e.y / canvas.height;\n indexData[ii + 2] = (e.x + e.w) / canvas.width;\n indexData[ii + 3] = (e.y + e.h) / canvas.height;\n }\n\n if (rendererType === RENDERER_TYPE_GPU_MOBILE) {\n indexData[ii + 0] = e.x / (canvas.width + 1);\n indexData[ii + 1] = e.y / (canvas.height + 1);\n indexData[ii + 2] = (e.x + e.w) / (canvas.width + 1);\n indexData[ii + 3] = (e.y + e.h) / (canvas.height + 1);\n }\n\n ctx.drawImage(e.texture.image, e.x, e.y, e.w, e.h);\n }\n\n if (rendererType === RENDERER_TYPE_GPU_DESKTOP) {\n atlasIndex.needsUpdate = true;\n }\n\n atlasTexture.needsUpdate = true;\n }\n\n /**\n * Disposes of the textures used by the texture atlas.\n *\n * @return void\n */\n destroy() {\n const { atlasIndex, atlasTexture, canvas } = this;\n\n atlasTexture.dispose();\n atlasIndex && atlasIndex.dispose();\n\n if (this.shouldDebug) {\n canvas.remove();\n }\n\n this.entries = [];\n }\n}\n","export const fragmentShader = () => {\n return `\n uniform vec3 baseColor;\n uniform sampler2D uTexture;\n uniform sampler2D atlasIndex;\n\n varying float vRotation;\n varying vec3 targetColor;\n varying float targetAlpha;\n varying vec4 tileRect;\n varying float tileID;\n\n void main() {\n gl_FragColor = vec4(baseColor * targetColor, targetAlpha);\n\n vec2 uv = gl_PointCoord;\n uv = mix(tileRect.xy, tileRect.zw, gl_PointCoord);\n\n float mid = 0.5;\n uv = vec2(\n cos(vRotation) * (uv.x - mid) - sin(vRotation) * (uv.y - mid) + mid,\n cos(vRotation) * (uv.y - mid) + sin(vRotation) * (uv.x - mid) + mid\n );\n\n gl_FragColor = gl_FragColor * texture2D(uTexture, uv);\n\n }\n`;\n};\n","export const SIZE_ATTENUATION_FACTOR = '600.0';\n","import { DATA_TEXTURE_SIZE } from '../../common/TextureAtlas/constants';\nimport { SIZE_ATTENUATION_FACTOR } from '../../common/shaders/constants';\n\nexport const vertexShader = () => {\n return `\n uniform sampler2D uTexture;\n //atlasIndex is a 256x1 float texture of tile rectangles as r=minx g=miny b=maxx a=maxy\n uniform sampler2D atlasIndex;\n\n attribute float size;\n attribute vec3 color;\n attribute float alpha;\n attribute float texID;\n attribute float rotation;\n\n varying float vRotation;\n varying vec3 targetColor;\n varying float targetAlpha;\n varying vec4 tileRect;\n varying float tileID;\n\n void main() {\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n targetColor = color;\n targetAlpha = alpha;\n vRotation = rotation;\n\n tileID = texID;\n //get the tile rectangle from the atlasIndex texture..\n tileRect = texture2D(atlasIndex, vec2((tileID + 0.5) / ${DATA_TEXTURE_SIZE}.0, 0.5));\n\n gl_PointSize = ((size * ${SIZE_ATTENUATION_FACTOR}) / -mvPosition.z);\n gl_Position = projectionMatrix * mvPosition;\n }\n`;\n};\n","import { ParticleBuffer, Target, TextureAtlas, UniqueList } from '../common';\nimport { fragmentShader, vertexShader } from './shaders';\n\nimport BaseRenderer from '../../BaseRenderer';\nimport { DEFAULT_RENDERER_OPTIONS } from '../common/constants';\nimport { Pool } from '../../../core';\nimport { RENDERER_TYPE_GPU_DESKTOP } from '../../types';\n\nlet THREE;\n\n/**\n * GPURenderer for devices that support floating point textures.\n *\n * @author thrax <manthrax@gmail.com>\n * @author rohan-deshpande <rohan@creativelifeform.com>\n */\nexport default class DesktopGPURenderer extends BaseRenderer {\n constructor(container, three, options = DEFAULT_RENDERER_OPTIONS) {\n super(RENDERER_TYPE_GPU_DESKTOP);\n\n THREE = this.three = three;\n const props = { ...DEFAULT_RENDERER_OPTIONS, ...options };\n const {\n camera,\n maxParticles,\n baseColor,\n blending,\n depthTest,\n depthWrite,\n transparent,\n shouldDebugTextureAtlas,\n } = props;\n const particleBuffer = new ParticleBuffer(maxParticles, THREE);\n const material = new THREE.ShaderMaterial({\n uniforms: {\n baseColor: { value: new THREE.Color(baseColor) },\n uTexture: { value: null },\n atlasIndex: { value: null },\n },\n vertexShader: vertexShader(),\n fragmentShader: fragmentShader(),\n blending: THREE[blending],\n depthTest,\n depthWrite,\n transparent,\n });\n\n this.container = container;\n this.camera = camera;\n this.targetPool = new Pool();\n this.uniqueList = new UniqueList(maxParticles);\n this.particleBuffer = particleBuffer;\n this.buffer = particleBuffer.buffer;\n this.stride = particleBuffer.stride;\n this.geometry = particleBuffer.geometry;\n this.material = material;\n this.points = new THREE.Points(this.geometry, this.material);\n this.points.frustumCulled = false;\n this.shouldDebugTextureAtlas = shouldDebugTextureAtlas;\n\n this.container.add(this.points);\n }\n\n onSystemUpdate(system) {\n super.onSystemUpdate(system);\n\n this.buffer.needsUpdate = true;\n\n this.textureAtlas && this.textureAtlas.update();\n }\n\n /**\n * Pools the particle target if it does not exist.\n * Updates the target and maps particle properties to the point.\n *\n * @param {Particle}\n */\n onParticleCreated(particle) {\n if (!particle.target) {\n particle.target = this.targetPool.get(Target, THREE);\n this.uniqueList.add(particle.id);\n }\n\n this.updateTarget(particle).mapParticleTargetPropsToPoint(particle);\n }\n\n /**\n * Maps particle properties to the point if the particle has a target.\n *\n * @param {Particle}\n */\n onParticleUpdate(particle) {\n if (!particle.target) {\n return;\n }\n\n this.updateTarget(particle).mapParticleTargetPropsToPoint(particle);\n }\n\n /**\n * Resets and clears the particle target.\n *\n * @param {Particle}\n */\n onParticleDead(particle) {\n if (!particle.target) {\n return;\n }\n\n particle.target.reset();\n this.mapParticleTargetPropsToPoint(particle);\n\n particle.target = null;\n }\n\n /**\n * Maps all mutable properties from the particle to the target.\n *\n * @param {Particle}\n * @return {DesktopGPURenderer}\n */\n updateTarget(particle) {\n const { position, rotation, scale, radius, color, alpha, body, id } = particle;\n const { r, g, b } = color;\n\n particle.target.position.copy(position);\n particle.target.rotation.copy(rotation);\n particle.target.size = scale * radius;\n particle.target.color.setRGB(r, g, b);\n particle.target.alpha = alpha;\n particle.target.index = this.uniqueList.find(id);\n\n if (body && body instanceof THREE.Sprite) {\n const { map } = body.material;\n\n particle.target.texture = map;\n particle.target.textureIndex = this.getTextureID(\n map,\n this.shouldDebugTextureAtlas\n );\n }\n\n return this;\n }\n\n /**\n * Entry point for mapping particle properties to buffer geometry points.\n *\n * @param {Particle} particle - The particle containing the properties to map\n * @return {DesktopGPURenderer}\n */\n mapParticleTargetPropsToPoint(particle) {\n this.updatePointPosition(particle)\n .updatePointSize(particle)\n .updatePointRotation(particle)\n .updatePointColor(particle)\n .updatePointAlpha(particle)\n .updatePointTextureIndex(particle);\n\n return this;\n }\n\n /**\n * Updates the point's position according to the particle's target position.\n *\n * @param {Particle} particle - The particle containing the target position.\n * @return {DesktopGPURenderer}\n */\n updatePointPosition(particle) {\n const attribute = 'position';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.position.x;\n buffer.array[target.index * stride + offset + 1] = target.position.y;\n buffer.array[target.index * stride + offset + 2] = target.position.z;\n\n return this;\n }\n\n /**\n * Updates the point's size relative to the particle's target scale and radius.\n *\n * @param {Particle} particle - The particle containing the target scale.\n * @return {DesktopGPURenderer}\n */\n updatePointSize(particle) {\n const attribute = 'size';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.size;\n\n return this;\n }\n\n /**\n * Updates the point's rotation.\n *\n * @param {Particle} particle - The particle containing the target rotation.\n * @return {DesktopGPURenderer}\n */\n updatePointRotation(particle) {\n const attribute = 'rotation';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.rotation.z;\n\n return this;\n }\n\n /**\n * Updates the point's color attribute according with the particle's target color.\n *\n * @param {Particle} particle - The particle containing the target color and alpha.\n * @return {DesktopGPURenderer}\n */\n updatePointColor(particle) {\n const attribute = 'color';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.color.r;\n buffer.array[target.index * stride + offset + 1] = target.color.g;\n buffer.array[target.index * stride + offset + 2] = target.color.b;\n\n return this;\n }\n\n /**\n * Updates the point alpha attribute with the particle's target alpha.\n *\n * @param {Particle} particle - The particle containing the target alpha.\n * @return {DesktopGPURenderer}\n */\n updatePointAlpha(particle) {\n const attribute = 'alpha';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.alpha;\n\n return this;\n }\n\n /**\n * Updates the point texture attribute with the particle's target texture.\n *\n * @param {Particle} particle - The particle containing the target texture.\n * @return {DesktopGPURenderer}\n */\n updatePointTextureIndex(particle) {\n const attribute = 'texID';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.textureIndex;\n\n return this;\n }\n\n getTextureID(texture, debug) {\n if (texture.textureIndex === undefined) {\n if (!this.textureAtlas) {\n this.textureAtlas = new TextureAtlas(this, debug);\n }\n\n this.textureAtlas.addTexture(texture);\n }\n\n return texture.textureIndex;\n }\n\n /**\n * Tears down the GPURenderer.\n *\n * @return void\n */\n destroy() {\n const { container, points, textureAtlas, uniqueList } = this;\n\n container.remove(points);\n uniqueList.destroy();\n textureAtlas && textureAtlas.destroy();\n }\n}\n","export const fragmentShader = () => {\n return `\n uniform vec3 baseColor;\n uniform sampler2D uTexture;\n\n varying float vRotation;\n varying vec3 targetColor;\n varying float targetAlpha;\n varying vec4 tileRect;\n\n void main() {\n gl_FragColor = vec4(baseColor * targetColor, targetAlpha);\n\n vec2 uv = gl_PointCoord;\n uv = mix(tileRect.xy, tileRect.zw, gl_PointCoord);\n\n float mid = 0.5;\n uv = vec2(\n cos(vRotation) * (uv.x - mid) - sin(vRotation) * (uv.y - mid) + mid,\n cos(vRotation) * (uv.y - mid) + sin(vRotation) * (uv.x - mid) + mid\n );\n \n gl_FragColor = gl_FragColor * texture2D(uTexture, uv);\n }\n`;\n};\n","import { SIZE_ATTENUATION_FACTOR } from '../../common/shaders/constants';\n\nexport const vertexShader = () => {\n return `\n uniform sampler2D uTexture;\n uniform vec2 atlasDim;\n\n attribute float size;\n attribute vec3 color;\n attribute float alpha;\n attribute vec2 texID;\n attribute float rotation;\n\n varying float vRotation;\n varying vec3 targetColor;\n varying float targetAlpha;\n varying vec4 tileRect;\n\n void main() {\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n targetColor = color;\n targetAlpha = alpha;\n vRotation = rotation;\n\n vec2 tmin = floor(texID) / atlasDim;\n vec2 tmax = fract(texID);\n tileRect = vec4(tmin,tmax);\n\n gl_PointSize = ((size * ${SIZE_ATTENUATION_FACTOR}) / -mvPosition.z);\n gl_Position = projectionMatrix * mvPosition;\n }\n`;\n};\n","import { ParticleBuffer, Target, TextureAtlas, UniqueList } from '../common';\nimport { fragmentShader, vertexShader } from './shaders';\n\nimport BaseRenderer from '../../BaseRenderer';\nimport { DEFAULT_RENDERER_OPTIONS } from '../common/constants';\nimport { Pool } from '../../../core';\nimport { RENDERER_TYPE_GPU_MOBILE } from '../../types';\n\nlet THREE;\n\n/**\n * GPURenderer for mobile devices that do not support floating point textures.\n *\n * @author thrax <manthrax@gmail.com>\n * @author rohan-deshpande <rohan@creativelifeform.com>\n */\nexport default class MobileGPURenderer extends BaseRenderer {\n constructor(container, three, options = DEFAULT_RENDERER_OPTIONS) {\n super(RENDERER_TYPE_GPU_MOBILE);\n\n THREE = this.three = three;\n const props = { ...DEFAULT_RENDERER_OPTIONS, ...options };\n const {\n camera,\n maxParticles,\n baseColor,\n blending,\n depthTest,\n depthWrite,\n transparent,\n shouldDebugTextureAtlas,\n } = props;\n const particleBuffer = new ParticleBuffer(maxParticles, THREE);\n const material = new THREE.ShaderMaterial({\n uniforms: {\n baseColor: { value: new THREE.Color(baseColor) },\n uTexture: { value: null },\n FFatlasIndex: { value: null },\n atlasDim: { value: new THREE.Vector2() },\n },\n vertexShader: vertexShader(),\n fragmentShader: fragmentShader(),\n blending: THREE[blending],\n depthTest,\n depthWrite,\n transparent,\n });\n\n this.camera = camera;\n this.targetPool = new Pool();\n this.uniqueList = new UniqueList(maxParticles);\n this.particleBuffer = particleBuffer;\n this.buffer = particleBuffer.buffer;\n this.stride = particleBuffer.stride;\n this.geometry = particleBuffer.geometry;\n this.material = material;\n this.points = new THREE.Points(this.geometry, this.material);\n this.points.frustumCulled = false;\n this.shouldDebugTextureAtlas = shouldDebugTextureAtlas;\n\n container.add(this.points);\n }\n\n onSystemUpdate(system) {\n super.onSystemUpdate(system);\n\n this.buffer.needsUpdate = true;\n\n const { textureAtlas } = this;\n\n if (textureAtlas) {\n textureAtlas.update();\n this.material.uniforms.atlasDim.value.set(\n textureAtlas.atlasTexture.image.width,\n textureAtlas.atlasTexture.image.height\n );\n }\n }\n\n /**\n * Pools the particle target if it does not exist.\n * Updates the target and maps particle properties to the point.\n *\n * @param {Particle}\n */\n onParticleCreated(particle) {\n if (!particle.target) {\n particle.target = this.targetPool.get(Target, THREE);\n this.uniqueList.add(particle.id);\n }\n\n this.updateTarget(particle).mapParticleTargetPropsToPoint(particle);\n }\n\n /**\n * Maps particle properties to the point if the particle has a target.\n *\n * @param {Particle}\n */\n onParticleUpdate(particle) {\n if (!particle.target) {\n return;\n }\n\n this.updateTarget(particle).mapParticleTargetPropsToPoint(particle);\n }\n\n /**\n * Resets and clears the particle target.\n *\n * @param {Particle}\n */\n onParticleDead(particle) {\n if (!particle.target) {\n return;\n }\n\n particle.target.reset();\n this.mapParticleTargetPropsToPoint(particle);\n\n particle.target = null;\n }\n\n /**\n * Maps all mutable properties from the particle to the target.\n *\n * @param {Particle}\n * @return {GPURenderer}\n */\n updateTarget(particle) {\n const { position, rotation, scale, radius, color, alpha, body, id } = particle;\n const { r, g, b } = color;\n\n particle.target.position.copy(position);\n particle.target.rotation.copy(rotation);\n particle.target.size = scale * radius;\n particle.target.color.setRGB(r, g, b);\n particle.target.alpha = alpha;\n particle.target.index = this.uniqueList.find(id);\n\n if (body && body instanceof THREE.Sprite) {\n const { map } = body.material;\n\n particle.target.texture = map;\n particle.target.textureIndex = this.getTextureID(\n map,\n this.shouldDebugTextureAtlas\n );\n }\n\n return this;\n }\n\n /**\n * Entry point for mapping particle properties to buffer geometry points.\n *\n * @param {Particle} particle - The particle containing the properties to map\n * @return {GPURenderer}\n */\n mapParticleTargetPropsToPoint(particle) {\n this.updatePointPosition(particle)\n .updatePointSize(particle)\n .updatePointRotation(particle)\n .updatePointColor(particle)\n .updatePointAlpha(particle)\n .updatePointTextureIndex(particle);\n\n return this;\n }\n\n /**\n * Updates the point's position according to the particle's target position.\n *\n * @param {Particle} particle - The particle containing the target position.\n * @return {GPURenderer}\n */\n updatePointPosition(particle) {\n const attribute = 'position';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.position.x;\n buffer.array[target.index * stride + offset + 1] = target.position.y;\n buffer.array[target.index * stride + offset + 2] = target.position.z;\n\n return this;\n }\n\n /**\n * Updates the point's size relative to the particle's target scale and radius.\n *\n * @param {Particle} particle - The particle containing the target scale.\n * @return {GPURenderer}\n */\n updatePointSize(particle) {\n const attribute = 'size';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.size;\n\n return this;\n }\n\n /**\n * Updates the point's rotation.\n *\n * @param {Particle} particle - The particle containing the target rotation.\n * @return {GPURenderer}\n */\n updatePointRotation(particle) {\n const attribute = 'rotation';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.rotation.z;\n\n return this;\n }\n\n /**\n * Updates the point's color attribute according with the particle's target color.\n *\n * @param {Particle} particle - The particle containing the target color and alpha.\n * @return {GPURenderer}\n */\n updatePointColor(particle) {\n const attribute = 'color';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.color.r;\n buffer.array[target.index * stride + offset + 1] = target.color.g;\n buffer.array[target.index * stride + offset + 2] = target.color.b;\n\n return this;\n }\n\n /**\n * Updates the point alpha attribute with the particle's target alpha.\n *\n * @param {Particle} particle - The particle containing the target alpha.\n * @return {GPURenderer}\n */\n updatePointAlpha(particle) {\n const attribute = 'alpha';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n\n buffer.array[target.index * stride + offset + 0] = target.alpha;\n\n return this;\n }\n\n /**\n * Updates the point texture attribute with the particle's target texture.\n *\n * @param {Particle} particle - The particle containing the target texture.\n * @return {GPURenderer}\n */\n updatePointTextureIndex(particle) {\n const attribute = 'texID';\n const { geometry, stride, buffer } = this;\n const { target } = particle;\n const { offset } = geometry.attributes[attribute];\n const id = target.index * stride + offset + 0;\n\n // eslint-disable-next-line\n if (false) {\n buffer.array[id] = target.textureIndex;\n } else {\n let ti = target.textureIndex * 4;\n const ta = this.textureAtlas;\n const ida = ta.indexData;\n const nx = ida[ti++];\n const ny = ida[ti++];\n const px = ida[ti++];\n const py = ida[ti++];\n\n buffer.array[id] = ((nx * ta.atlasTexture.image.width) | 0) + px;\n buffer.array[id + 1] = ((ny * ta.atlasTexture.image.height) | 0) + py;\n }\n\n return this;\n }\n\n getTextureID(texture, debug) {\n if (texture.textureIndex === undefined) {\n if (!this.textureAtlas) {\n this.textureAtlas = new TextureAtlas(this, debug);\n }\n\n this.textureAtlas.addTexture(texture);\n }\n\n return texture.textureIndex;\n }\n\n destroy() {\n const { container, points, textureAtlas, uniqueList } = this;\n\n container.remove(points);\n uniqueList.destroy();\n textureAtlas && textureAtlas.destroy();\n }\n}\n","import BaseRenderer from '../BaseRenderer';\nimport { DEFAULT_RENDERER_OPTIONS } from './common/constants';\nimport DesktopGPURenderer from './Desktop';\nimport MobileGPURenderer from './Mobile';\nimport { RENDERER_TYPE_GPU } from '../types';\n\n/**\n * Performant particle renderer that uses THREE.Points to propagate particle (postiion, rgba etc.,) properties to\n * vertices in a ParticleBufferGeometry.\n * Uses a dynamic texture atlas to support systems with mutliple sprites in a performant way.\n *\n * NOTE! This is an experimental renderer and is currently not covered by tests, coverage will be added when the API\n * is more stable. Currently only compatible with sprite/texture based systems. Meshes are not yet supported.\n *\n * @author thrax <manthrax@gmail.com>\n * @author rohan-deshpande <rohan@creativelifeform.com>\n */\nexport default class GPURenderer extends BaseRenderer {\n constructor(container, THREE, options = DEFAULT_RENDERER_OPTIONS) {\n super(RENDERER_TYPE_GPU);\n\n const { shouldForceDesktopRenderer, shouldForceMobileRenderer } = options;\n const args = [container, THREE, options];\n\n if (shouldForceDesktopRenderer) {\n return new DesktopGPURenderer(...args);\n }\n\n if (shouldForceMobileRenderer) {\n return new MobileGPURenderer(...args);\n }\n\n if (!this.isFloatingPointTextureSupported()) {\n return new MobileGPURenderer(...args);\n }\n\n return new DesktopGPURenderer(...args);\n }\n\n isFloatingPointTextureSupported() {\n const canvas = document.createElement('canvas');\n\n if (window.WebGL2RenderingContext && canvas.getContext('webgl2')) {\n // return false here to test the mobile renderer on desktop\n return true;\n }\n\n const gl = canvas.getContext('webgl');\n const support = !!gl.getExtension('OES_texture_float');\n\n canvas.remove();\n\n return support;\n }\n}\n","import { System } from './core';\n\nexport * from './behaviour';\nexport * from './debug';\nexport * from './ease';\nexport * from './emitter';\nexport * from './initializer';\nexport * from './math';\nexport * from './renderer';\nexport * from './utils';\nexport * from './zone';\nexport { System, Particle, Pool } from './core';\nexport default System;\n"],"x_google_ignoreList":[16,17,18,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,98,131],"mappings":";;;;;;;;;;;;;;;;;aAAa,IAA0B,aAC1B,IAAuB,SACvB,IAA4B,cAC5B,IAA2B,aAC3B,IAAuB,SACvB,IAA4B,aAC5B,IAAuB,SACvB,IAAyB,WACzB,IAA8B,eAC9B,IAA2B,aAC3B,IAAwB,UACxB,IAAuB,SACvB,IAAwB,UCZxB,IAA4B,eAC5B,IAAwB,QACxB,IAA+B,cAC/B,IAA2B,WAC3B,IAAwB,QACxB,IAAwB,QACxB,IAA4B,YAC5B,IAA4B,YAC5B,IAA0B,UAE1B,IAAmC,kBACnC,IAAkC,iBAClC,IAAmC,kBACnC,KAAwB,QACxB,IAAuC,CAClD,GACA,CACF,GCjBa,KAAqB,QACrB,KAAgB,WAChB,KAAiB,YACjB,KAAiB,YACjB,KAAkB,aAClB,KAAmB,cACnB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