p5 2.0.0 → 2.0.1
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/{src → dist}/accessibility/color_namer.js +48 -3
- package/{src → dist}/accessibility/describe.js +2 -2
- package/{src → dist}/accessibility/gridOutput.js +2 -2
- package/dist/accessibility/index.js +60 -0
- package/{src → dist}/accessibility/outputs.js +2 -2
- package/{src → dist}/accessibility/textOutput.js +2 -2
- package/dist/app.js +120 -0
- package/{src → dist}/color/color_conversion.js +48 -10
- package/{src → dist}/color/color_spaces/hsb.js +3 -1
- package/dist/color/creating_reading.js +3 -0
- package/dist/color/index.js +13 -0
- package/dist/color/p5.Color.culori.js +1 -0
- package/dist/color/p5.Color.js +3 -0
- package/{src → dist}/color/setting.js +9 -6
- package/{src/core/constants.js → dist/constants-C-g_eAdC.js} +266 -130
- package/{src → dist}/core/States.js +3 -1
- package/dist/core/constants.js +1 -0
- package/{src → dist}/core/environment.js +7 -6
- package/{src → dist}/core/friendly_errors/browser_errors.js +1 -1
- package/{src → dist}/core/friendly_errors/fes_core.js +14 -44
- package/{src → dist}/core/friendly_errors/file_errors.js +6 -3
- package/dist/core/friendly_errors/index.js +23 -0
- package/dist/core/friendly_errors/param_validator.js +5455 -0
- package/{src → dist}/core/friendly_errors/sketch_reader.js +50 -4
- package/{src → dist}/core/friendly_errors/sketch_verifier.js +6 -6
- package/{src → dist}/core/friendly_errors/stacktrace.js +3 -5
- package/{src → dist}/core/friendly_errors/validate_params.js +50 -41
- package/{src → dist}/core/helpers.js +9 -6
- package/dist/core/init.js +105 -0
- package/dist/core/internationalization.js +302 -0
- package/dist/core/legacy.js +73 -0
- package/dist/core/main.js +44 -0
- package/dist/core/noop.js +3 -0
- package/dist/core/p5.Graphics.js +40 -0
- package/dist/core/p5.Renderer.js +11 -0
- package/dist/core/p5.Renderer2D.js +44 -0
- package/dist/core/reference.js +1 -0
- package/dist/core/rendering.js +40 -0
- package/{src → dist}/core/structure.js +3 -3
- package/{src → dist}/core/transform.js +2 -2
- package/{src/color/creating_reading.js → dist/creating_reading-D4AAKRbx.js} +841 -13
- package/{src → dist}/data/index.js +3 -1
- package/{src → dist}/data/local_storage.js +2 -8
- package/{src → dist}/dom/dom.js +11 -5
- package/dist/dom/index.js +18 -0
- package/{src → dist}/dom/p5.Element.js +14 -12
- package/{src → dist}/dom/p5.File.js +4 -4
- package/{src → dist}/dom/p5.MediaElement.js +10 -4
- package/{src → dist}/events/acceleration.js +2 -2
- package/{src → dist}/events/index.js +3 -1
- package/{src → dist}/events/keyboard.js +14 -11
- package/{src → dist}/events/pointer.js +16 -17
- package/dist/image/const.js +9 -0
- package/{src → dist}/image/filterRenderer2D.js +57 -37
- package/{src → dist}/image/filters.js +1 -3
- package/dist/image/image.js +40 -0
- package/dist/image/index.js +51 -0
- package/dist/image/loading_displaying.js +40 -0
- package/dist/image/p5.Image.js +11 -0
- package/{src → dist}/image/pixels.js +4 -3
- package/{src → dist}/io/csv.js +72 -70
- package/dist/io/files.js +40 -0
- package/dist/io/index.js +51 -0
- package/{src → dist}/io/p5.Table.js +6 -6
- package/{src → dist}/io/p5.TableRow.js +3 -4
- package/{src → dist}/io/p5.XML.js +2 -5
- package/{src → dist}/io/utilities.js +1 -1
- package/{src/core/p5.Renderer2D.js → dist/main-s72KWcUy.js} +735 -57
- package/{src → dist}/math/Matrices/Matrix.js +10 -8
- package/{src → dist}/math/Matrices/MatrixInterface.js +5 -3
- package/{src → dist}/math/Matrices/MatrixNumjs.js +12 -26
- package/{src → dist}/math/calculation.js +2 -2
- package/{src → dist}/math/index.js +6 -3
- package/{src → dist}/math/math.js +2 -2
- package/{src → dist}/math/noise.js +2 -2
- package/{src → dist}/math/p5.Matrix.js +7 -4
- package/{src → dist}/math/p5.Vector.js +6 -6
- package/{src → dist}/math/random.js +2 -2
- package/{src → dist}/math/trigonometry.js +16 -15
- package/{src/image/p5.Image.js → dist/p5.Renderer-CwAYZOC2.js} +390 -19
- package/dist/rendering--aAe5aq3.js +24925 -0
- package/{src → dist}/shape/2d_primitives.js +18 -17
- package/{src → dist}/shape/attributes.js +18 -17
- package/{src → dist}/shape/curves.js +2 -2
- package/{src → dist}/shape/custom_shapes.js +44 -64
- package/{src → dist}/shape/index.js +10 -2
- package/{src → dist}/shape/vertex.js +2 -3
- package/dist/type/index.js +25 -0
- package/{src → dist}/type/lib/Typr.js +76 -94
- package/{src → dist}/type/p5.Font.js +37 -61
- package/{src → dist}/type/textCore.js +34 -57
- package/{src → dist}/type/unicodeRanges.js +3 -1
- package/{src → dist}/utilities/conversion.js +2 -2
- package/{src → dist}/utilities/index.js +3 -1
- package/{src → dist}/utilities/time_date.js +6 -7
- package/{src → dist}/utilities/utility_functions.js +2 -2
- package/dist/webgl/3d_primitives.js +40 -0
- package/{src → dist}/webgl/GeometryBufferCache.js +3 -1
- package/{src → dist}/webgl/GeometryBuilder.js +12 -8
- package/{src → dist}/webgl/ShaderGenerator.js +79 -82
- package/{src → dist}/webgl/ShapeBuilder.js +26 -23
- package/dist/webgl/index.js +76 -0
- package/{src → dist}/webgl/interaction.js +7 -6
- package/dist/webgl/light.js +40 -0
- package/{src → dist}/webgl/loading.js +45 -12
- package/dist/webgl/material.js +40 -0
- package/dist/webgl/p5.Camera.js +40 -0
- package/{src → dist}/webgl/p5.DataArray.js +3 -5
- package/dist/webgl/p5.Framebuffer.js +40 -0
- package/{src → dist}/webgl/p5.Geometry.js +12 -15
- package/{src → dist}/webgl/p5.Quat.js +5 -4
- package/{src → dist}/webgl/p5.RenderBuffer.js +2 -3
- package/dist/webgl/p5.RendererGL.js +40 -0
- package/dist/webgl/p5.Shader.js +40 -0
- package/dist/webgl/p5.Texture.js +40 -0
- package/{src → dist}/webgl/text.js +51 -9
- package/lib/p5.esm.js +102 -48
- package/lib/p5.js +102 -48
- package/lib/p5.min.js +1 -1
- package/package.json +17 -16
- package/translations/dev.js +6 -6
- package/translations/index.js +1 -1
- package/src/README.md +0 -27
- package/src/accessibility/index.js +0 -13
- package/src/app.js +0 -61
- package/src/color/index.js +0 -9
- package/src/color/p5.Color.culori.js +0 -66
- package/src/color/p5.Color.js +0 -851
- package/src/core/README.md +0 -91
- package/src/core/friendly_errors/index.js +0 -13
- package/src/core/friendly_errors/param_validator.js +0 -561
- package/src/core/init.js +0 -58
- package/src/core/internationalization.js +0 -195
- package/src/core/legacy.js +0 -29
- package/src/core/main.js +0 -689
- package/src/core/noop.js +0 -1
- package/src/core/p5.Graphics.js +0 -696
- package/src/core/p5.Renderer.js +0 -408
- package/src/core/reference.js +0 -2060
- package/src/core/rendering.js +0 -697
- package/src/dom/index.js +0 -11
- package/src/image/const.js +0 -6
- package/src/image/image.js +0 -731
- package/src/image/index.js +0 -15
- package/src/image/loading_displaying.js +0 -1431
- package/src/io/files.js +0 -2210
- package/src/io/index.js +0 -11
- package/src/math/README.md +0 -40
- package/src/type/index.js +0 -9
- package/src/webgl/3d_primitives.js +0 -2741
- package/src/webgl/index.js +0 -37
- package/src/webgl/light.js +0 -1851
- package/src/webgl/material.js +0 -3854
- package/src/webgl/p5.Camera.js +0 -4010
- package/src/webgl/p5.Framebuffer.js +0 -1865
- package/src/webgl/p5.RendererGL.js +0 -2867
- package/src/webgl/p5.Shader.js +0 -1505
- package/src/webgl/p5.Texture.js +0 -541
- package/src/webgl/shaders/basic.frag +0 -6
- package/src/webgl/shaders/filters/base.frag +0 -22
- package/src/webgl/shaders/filters/base.vert +0 -19
- package/src/webgl/shaders/filters/blur.frag +0 -60
- package/src/webgl/shaders/filters/default.vert +0 -18
- package/src/webgl/shaders/filters/dilate.frag +0 -39
- package/src/webgl/shaders/filters/erode.frag +0 -39
- package/src/webgl/shaders/filters/gray.frag +0 -16
- package/src/webgl/shaders/filters/invert.frag +0 -15
- package/src/webgl/shaders/filters/opaque.frag +0 -12
- package/src/webgl/shaders/filters/posterize.frag +0 -29
- package/src/webgl/shaders/filters/threshold.frag +0 -23
- package/src/webgl/shaders/font.frag +0 -216
- package/src/webgl/shaders/font.vert +0 -44
- package/src/webgl/shaders/imageLight.vert +0 -33
- package/src/webgl/shaders/imageLightDiffused.frag +0 -82
- package/src/webgl/shaders/imageLightSpecular.frag +0 -134
- package/src/webgl/shaders/light.vert +0 -37
- package/src/webgl/shaders/light_texture.frag +0 -26
- package/src/webgl/shaders/lighting.glsl +0 -227
- package/src/webgl/shaders/line.frag +0 -74
- package/src/webgl/shaders/line.vert +0 -294
- package/src/webgl/shaders/normal.frag +0 -6
- package/src/webgl/shaders/normal.vert +0 -72
- package/src/webgl/shaders/phong.frag +0 -84
- package/src/webgl/shaders/phong.vert +0 -87
- package/src/webgl/shaders/point.frag +0 -29
- package/src/webgl/shaders/point.vert +0 -19
- package/src/webgl/shaders/sphereMapping.frag +0 -26
- package/src/webgl/shaders/webgl2Compatibility.glsl +0 -34
package/lib/p5.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! p5.js v2.0.
|
|
1
|
+
/*! p5.js v2.0.1 April 23, 2025 */
|
|
2
2
|
var p5 = (function () {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ var p5 = (function () {
|
|
|
15
15
|
* @property {String} VERSION
|
|
16
16
|
* @final
|
|
17
17
|
*/
|
|
18
|
-
const VERSION = '2.0.
|
|
18
|
+
const VERSION = '2.0.1';
|
|
19
19
|
|
|
20
20
|
// GRAPHICS RENDERER
|
|
21
21
|
/**
|
|
@@ -52870,7 +52870,7 @@ var p5 = (function () {
|
|
|
52870
52870
|
|
|
52871
52871
|
var phongVert = "precision highp int;\n\n#define HOOK_DEFINES\n\nIN vec3 aPosition;\nIN vec3 aNormal;\nIN vec2 aTexCoord;\nIN vec4 aVertexColor;\n\nuniform vec3 uAmbientColor[5];\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\nuniform mat4 uModelMatrix;\nuniform mat4 uViewMatrix;\nuniform mat3 uModelNormalMatrix;\nuniform mat3 uCameraNormalMatrix;\n#else\nuniform mat4 uModelViewMatrix;\nuniform mat3 uNormalMatrix;\n#endif\nuniform mat4 uProjectionMatrix;\nuniform int uAmbientLightCount;\n\nuniform bool uUseVertexColor;\nuniform vec4 uMaterialColor;\n\nOUT vec3 vNormal;\nOUT vec2 vTexCoord;\nOUT vec3 vViewPosition;\nOUT vec3 vAmbientColor;\nOUT vec4 vColor;\n\nstruct Vertex {\n vec3 position;\n vec3 normal;\n vec2 texCoord;\n vec4 color;\n};\n\nvoid main(void) {\n HOOK_beforeVertex();\n\n Vertex inputs;\n inputs.position = aPosition;\n inputs.normal = aNormal;\n inputs.texCoord = aTexCoord;\n inputs.color = (uUseVertexColor && aVertexColor.x >= 0.0) ? aVertexColor : uMaterialColor;\n#ifdef AUGMENTED_HOOK_getObjectInputs\n inputs = HOOK_getObjectInputs(inputs);\n#endif\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\n inputs.position = (uModelMatrix * vec4(inputs.position, 1.)).xyz;\n inputs.normal = uModelNormalMatrix * inputs.normal;\n inputs = HOOK_getWorldInputs(inputs);\n#endif\n\n#ifdef AUGMENTED_HOOK_getWorldInputs\n // Already multiplied by the model matrix, just apply view\n inputs.position = (uViewMatrix * vec4(inputs.position, 1.)).xyz;\n inputs.normal = uCameraNormalMatrix * inputs.normal;\n#else\n // Apply both at once\n inputs.position = (uModelViewMatrix * vec4(inputs.position, 1.)).xyz;\n inputs.normal = uNormalMatrix * inputs.normal;\n#endif\n#ifdef AUGMENTED_HOOK_getCameraInputs\n inputs = HOOK_getCameraInputs(inputs);\n#endif\n\n // Pass varyings to fragment shader\n vViewPosition = inputs.position;\n vTexCoord = inputs.texCoord;\n vNormal = inputs.normal;\n vColor = inputs.color;\n\n // TODO: this should be a uniform\n vAmbientColor = vec3(0.0);\n for (int i = 0; i < 5; i++) {\n if (i < uAmbientLightCount) {\n vAmbientColor += uAmbientColor[i];\n }\n }\n\n gl_Position = uProjectionMatrix * vec4(inputs.position, 1.);\n HOOK_afterVertex();\n}\n";
|
|
52872
52872
|
|
|
52873
|
-
var phongFrag = "// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nstruct ColorComponents {\n vec3 baseColor;\n float opacity;\n vec3 ambientColor;\n vec3 specularColor;\n vec3 diffuse;\n vec3 ambient;\n vec3 specular;\n vec3 emissive;\n};\n\nstruct Inputs {\n vec3 normal;\n vec2 texCoord;\n vec3 ambientLight;\n vec3 ambientMaterial;\n vec3 specularMaterial;\n vec3 emissiveMaterial;\n vec4 color;\n float shininess;\n float metalness;\n};\n\nvoid main(void) {\n HOOK_beforeFragment();\n\n Inputs inputs;\n inputs.normal = normalize(vNormal);\n inputs.texCoord = vTexCoord;\n inputs.ambientLight = vAmbientColor;\n inputs.color = isTexture\n ? TEXTURE(uSampler, vTexCoord) * uTint/255
|
|
52873
|
+
var phongFrag = "// include lighting.glsl\nprecision highp int;\n\nuniform bool uHasSetAmbient;\nuniform vec4 uSpecularMatColor;\nuniform vec4 uAmbientMatColor;\nuniform vec4 uEmissiveMatColor;\n\nuniform vec4 uTint;\nuniform sampler2D uSampler;\nuniform bool isTexture;\n\nIN vec3 vNormal;\nIN vec2 vTexCoord;\nIN vec3 vViewPosition;\nIN vec3 vAmbientColor;\nIN vec4 vColor;\n\nstruct ColorComponents {\n vec3 baseColor;\n float opacity;\n vec3 ambientColor;\n vec3 specularColor;\n vec3 diffuse;\n vec3 ambient;\n vec3 specular;\n vec3 emissive;\n};\n\nstruct Inputs {\n vec3 normal;\n vec2 texCoord;\n vec3 ambientLight;\n vec3 ambientMaterial;\n vec3 specularMaterial;\n vec3 emissiveMaterial;\n vec4 color;\n float shininess;\n float metalness;\n};\n\nvoid main(void) {\n HOOK_beforeFragment();\n\n Inputs inputs;\n inputs.normal = normalize(vNormal);\n inputs.texCoord = vTexCoord;\n inputs.ambientLight = vAmbientColor;\n inputs.color = isTexture\n ? TEXTURE(uSampler, vTexCoord) * (vec4(uTint.rgb/255., 1.) * uTint.a/255.)\n : vColor;\n if (isTexture && inputs.color.a > 0.0) {\n // Textures come in with premultiplied alpha. Temporarily unpremultiply it\n // so hooks users don't have to think about premultiplied alpha.\n inputs.color.rgb /= inputs.color.a;\n }\n inputs.shininess = uShininess;\n inputs.metalness = uMetallic;\n inputs.ambientMaterial = uHasSetAmbient ? uAmbientMatColor.rgb : inputs.color.rgb;\n inputs.specularMaterial = uSpecularMatColor.rgb;\n inputs.emissiveMaterial = uEmissiveMatColor.rgb;\n inputs = HOOK_getPixelInputs(inputs);\n\n vec3 diffuse;\n vec3 specular;\n totalLight(vViewPosition, inputs.normal, inputs.shininess, inputs.metalness, diffuse, specular);\n\n // Calculating final color as result of all lights (plus emissive term).\n\n vec2 texCoord = inputs.texCoord;\n vec4 baseColor = inputs.color;\n ColorComponents c;\n c.opacity = baseColor.a;\n c.baseColor = baseColor.rgb;\n c.ambientColor = inputs.ambientMaterial;\n c.specularColor = inputs.specularMaterial;\n c.diffuse = diffuse;\n c.ambient = inputs.ambientLight;\n c.specular = specular;\n c.emissive = inputs.emissiveMaterial;\n OUT_COLOR = HOOK_getFinalColor(HOOK_combineColors(c));\n OUT_COLOR.rgb *= OUT_COLOR.a; // Premultiply alpha before rendering\n HOOK_afterFragment();\n}\n";
|
|
52874
52874
|
|
|
52875
52875
|
var fontVert = "IN vec3 aPosition;\nIN vec2 aTexCoord;\nuniform mat4 uModelViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nuniform vec4 uGlyphRect;\nuniform float uGlyphOffset;\n\nOUT vec2 vTexCoord;\nOUT float w;\n\nvoid main() {\n vec4 positionVec4 = vec4(aPosition, 1.0);\n\n // scale by the size of the glyph's rectangle\n positionVec4.xy *= uGlyphRect.zw - uGlyphRect.xy;\n\n // Expand glyph bounding boxes by 1px on each side to give a bit of room\n // for antialiasing\n vec3 newOrigin = (uModelViewMatrix * vec4(0., 0., 0., 1.)).xyz;\n vec3 newDX = (uModelViewMatrix * vec4(1., 0., 0., 1.)).xyz;\n vec3 newDY = (uModelViewMatrix * vec4(0., 1., 0., 1.)).xyz;\n vec2 pixelScale = vec2(\n 1. / length(newOrigin - newDX),\n 1. / length(newOrigin - newDY)\n );\n vec2 offset = pixelScale * normalize(aTexCoord - vec2(0.5, 0.5));\n vec2 textureOffset = offset * (1. / vec2(\n uGlyphRect.z - uGlyphRect.x,\n uGlyphRect.w - uGlyphRect.y\n ));\n\n // move to the corner of the glyph\n positionVec4.xy += uGlyphRect.xy;\n\n // move to the letter's line offset\n positionVec4.x += uGlyphOffset;\n\n positionVec4.xy += offset;\n \n gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;\n vTexCoord = aTexCoord + textureOffset;\n w = gl_Position.w;\n}\n";
|
|
52876
52876
|
|
|
@@ -65649,6 +65649,7 @@ var p5 = (function () {
|
|
|
65649
65649
|
attributes(p5, p5.Graphics.prototype);
|
|
65650
65650
|
curves(p5, p5.Graphics.prototype);
|
|
65651
65651
|
vertex(p5, p5.Graphics.prototype);
|
|
65652
|
+
customShapes(p5, p5.Graphics.prototype);
|
|
65652
65653
|
|
|
65653
65654
|
setting(p5, p5.Graphics.prototype);
|
|
65654
65655
|
loadingDisplaying(p5, p5.Graphics.prototype);
|
|
@@ -70089,9 +70090,10 @@ var p5 = (function () {
|
|
|
70089
70090
|
* a p5 sketch. It expects an incoming sketch closure and it can also
|
|
70090
70091
|
* take an optional node parameter for attaching the generated p5 canvas
|
|
70091
70092
|
* to a node. The sketch closure takes the newly created p5 instance as
|
|
70092
|
-
* its sole argument and may optionally set
|
|
70093
|
-
* <a href="#/p5/setup">setup()</a>,
|
|
70094
|
-
* <a href="#/p5/
|
|
70093
|
+
* its sole argument and may optionally set an asynchronous function
|
|
70094
|
+
* using `async/await`, along with the standard <a href="#/p5/setup">setup()</a>,
|
|
70095
|
+
* and/or <a href="#/p5/setup">setup()</a>, and/or <a href="#/p5/draw">draw()</a>
|
|
70096
|
+
* properties on it for running a sketch.
|
|
70095
70097
|
*
|
|
70096
70098
|
* A p5 sketch can run in "global" or "instance" mode:
|
|
70097
70099
|
* "global" - all properties and methods are attached to the window
|
|
@@ -70212,10 +70214,11 @@ var p5 = (function () {
|
|
|
70212
70214
|
bindGlobal(p);
|
|
70213
70215
|
}
|
|
70214
70216
|
|
|
70217
|
+
const protectedProperties = ['constructor', 'length'];
|
|
70215
70218
|
// Attach its properties to the window
|
|
70216
70219
|
for (const p in this) {
|
|
70217
70220
|
if (this.hasOwnProperty(p)) {
|
|
70218
|
-
if(p[0] === '_') continue;
|
|
70221
|
+
if(p[0] === '_' || protectedProperties.includes(p)) continue;
|
|
70219
70222
|
bindGlobal(p);
|
|
70220
70223
|
}
|
|
70221
70224
|
}
|
|
@@ -70540,6 +70543,8 @@ var p5 = (function () {
|
|
|
70540
70543
|
* <a href="#/p5/draw">draw()</a> begins looping. If the
|
|
70541
70544
|
* <a href="#/p5/preload">preload()</a> is declared, then `setup()` will
|
|
70542
70545
|
* run immediately after <a href="#/p5/preload">preload()</a> finishes
|
|
70546
|
+
*
|
|
70547
|
+
*
|
|
70543
70548
|
* loading assets.
|
|
70544
70549
|
*
|
|
70545
70550
|
* Note: `setup()` doesn’t have to be declared, but it’s common practice to do so.
|
|
@@ -76719,7 +76724,7 @@ var p5 = (function () {
|
|
|
76719
76724
|
// actual name with correct capitalization doesnt exist in context,
|
|
76720
76725
|
// and if the user-defined symbol is of the type function
|
|
76721
76726
|
if (
|
|
76722
|
-
fxns
|
|
76727
|
+
fxns.hasOwnProperty(lowercase) &&
|
|
76723
76728
|
!context[fxns[lowercase]] &&
|
|
76724
76729
|
typeof context[prop] === 'function'
|
|
76725
76730
|
) {
|
|
@@ -83264,6 +83269,13 @@ var p5 = (function () {
|
|
|
83264
83269
|
]
|
|
83265
83270
|
]
|
|
83266
83271
|
},
|
|
83272
|
+
createMatrix: {
|
|
83273
|
+
overloads: [
|
|
83274
|
+
[
|
|
83275
|
+
"Number[]"
|
|
83276
|
+
]
|
|
83277
|
+
]
|
|
83278
|
+
},
|
|
83267
83279
|
noise: {
|
|
83268
83280
|
overloads: [
|
|
83269
83281
|
[
|
|
@@ -83686,23 +83698,14 @@ var p5 = (function () {
|
|
|
83686
83698
|
bezierOrder: {
|
|
83687
83699
|
overloads: [
|
|
83688
83700
|
[
|
|
83689
|
-
"Number"
|
|
83690
83701
|
],
|
|
83691
83702
|
[
|
|
83703
|
+
"Number"
|
|
83692
83704
|
]
|
|
83693
83705
|
]
|
|
83694
83706
|
},
|
|
83695
83707
|
splineVertex: {
|
|
83696
83708
|
overloads: [
|
|
83697
|
-
[
|
|
83698
|
-
"Number",
|
|
83699
|
-
"Number"
|
|
83700
|
-
],
|
|
83701
|
-
[
|
|
83702
|
-
"Number",
|
|
83703
|
-
"Number",
|
|
83704
|
-
"Number?"
|
|
83705
|
-
],
|
|
83706
83709
|
[
|
|
83707
83710
|
"Number",
|
|
83708
83711
|
"Number",
|
|
@@ -83721,20 +83724,20 @@ var p5 = (function () {
|
|
|
83721
83724
|
splineProperty: {
|
|
83722
83725
|
overloads: [
|
|
83723
83726
|
[
|
|
83724
|
-
"String"
|
|
83725
|
-
null
|
|
83727
|
+
"String"
|
|
83726
83728
|
],
|
|
83727
83729
|
[
|
|
83728
|
-
"String"
|
|
83730
|
+
"String",
|
|
83731
|
+
null
|
|
83729
83732
|
]
|
|
83730
83733
|
]
|
|
83731
83734
|
},
|
|
83732
83735
|
splineProperties: {
|
|
83733
83736
|
overloads: [
|
|
83734
83737
|
[
|
|
83735
|
-
"Object"
|
|
83736
83738
|
],
|
|
83737
83739
|
[
|
|
83740
|
+
"Object"
|
|
83738
83741
|
]
|
|
83739
83742
|
]
|
|
83740
83743
|
},
|
|
@@ -83796,6 +83799,19 @@ var p5 = (function () {
|
|
|
83796
83799
|
]
|
|
83797
83800
|
]
|
|
83798
83801
|
},
|
|
83802
|
+
curveVertex: {
|
|
83803
|
+
overloads: [
|
|
83804
|
+
[
|
|
83805
|
+
"Number",
|
|
83806
|
+
"Number"
|
|
83807
|
+
],
|
|
83808
|
+
[
|
|
83809
|
+
"Number",
|
|
83810
|
+
"Number",
|
|
83811
|
+
"Number?"
|
|
83812
|
+
]
|
|
83813
|
+
]
|
|
83814
|
+
},
|
|
83799
83815
|
endShape: {
|
|
83800
83816
|
overloads: [
|
|
83801
83817
|
[
|
|
@@ -84602,6 +84618,42 @@ var p5 = (function () {
|
|
|
84602
84618
|
]
|
|
84603
84619
|
]
|
|
84604
84620
|
},
|
|
84621
|
+
parseObj: {
|
|
84622
|
+
overloads: [
|
|
84623
|
+
[
|
|
84624
|
+
]
|
|
84625
|
+
]
|
|
84626
|
+
},
|
|
84627
|
+
parseSTL: {
|
|
84628
|
+
overloads: [
|
|
84629
|
+
[
|
|
84630
|
+
]
|
|
84631
|
+
]
|
|
84632
|
+
},
|
|
84633
|
+
isBinary: {
|
|
84634
|
+
overloads: [
|
|
84635
|
+
[
|
|
84636
|
+
]
|
|
84637
|
+
]
|
|
84638
|
+
},
|
|
84639
|
+
matchDataViewAt: {
|
|
84640
|
+
overloads: [
|
|
84641
|
+
[
|
|
84642
|
+
]
|
|
84643
|
+
]
|
|
84644
|
+
},
|
|
84645
|
+
parseBinarySTL: {
|
|
84646
|
+
overloads: [
|
|
84647
|
+
[
|
|
84648
|
+
]
|
|
84649
|
+
]
|
|
84650
|
+
},
|
|
84651
|
+
parseASCIISTL: {
|
|
84652
|
+
overloads: [
|
|
84653
|
+
[
|
|
84654
|
+
]
|
|
84655
|
+
]
|
|
84656
|
+
},
|
|
84605
84657
|
model: {
|
|
84606
84658
|
overloads: [
|
|
84607
84659
|
[
|
|
@@ -97787,6 +97839,15 @@ var p5 = (function () {
|
|
|
97787
97839
|
* </div>
|
|
97788
97840
|
*/
|
|
97789
97841
|
fn._onkeyup = function(e) {
|
|
97842
|
+
|
|
97843
|
+
const context = this._isGlobal ? window : this;
|
|
97844
|
+
if (typeof context.keyReleased === 'function') {
|
|
97845
|
+
const executeDefault = context.keyReleased(e);
|
|
97846
|
+
if (executeDefault === false) {
|
|
97847
|
+
e.preventDefault();
|
|
97848
|
+
}
|
|
97849
|
+
}
|
|
97850
|
+
|
|
97790
97851
|
delete this._downKeyCodes[e.code];
|
|
97791
97852
|
delete this._downKeys[e.key];
|
|
97792
97853
|
|
|
@@ -97803,15 +97864,9 @@ var p5 = (function () {
|
|
|
97803
97864
|
this.key = lastPressedKey;
|
|
97804
97865
|
}
|
|
97805
97866
|
|
|
97806
|
-
const context = this._isGlobal ? window : this;
|
|
97807
|
-
if (typeof context.keyReleased === 'function') {
|
|
97808
|
-
const executeDefault = context.keyReleased(e);
|
|
97809
|
-
if (executeDefault === false) {
|
|
97810
|
-
e.preventDefault();
|
|
97811
|
-
}
|
|
97812
|
-
}
|
|
97813
97867
|
};
|
|
97814
97868
|
|
|
97869
|
+
|
|
97815
97870
|
/**
|
|
97816
97871
|
* A function that's called once when keys with printable characters are pressed.
|
|
97817
97872
|
*
|
|
@@ -99023,25 +99078,25 @@ var p5 = (function () {
|
|
|
99023
99078
|
|
|
99024
99079
|
fn._updatePointerCoords = function (e) {
|
|
99025
99080
|
if (this._curElement !== null) {
|
|
99026
|
-
|
|
99027
|
-
|
|
99028
|
-
|
|
99081
|
+
const canvas = this._curElement.elt;
|
|
99082
|
+
const sx = canvas.scrollWidth / this.width || 1;
|
|
99083
|
+
const sy = canvas.scrollHeight / this.height || 1;
|
|
99029
99084
|
|
|
99030
|
-
|
|
99085
|
+
if (e.pointerType == 'touch') {
|
|
99031
99086
|
const touches = [];
|
|
99032
99087
|
for (const touch of this._activePointers.values()) {
|
|
99033
|
-
|
|
99088
|
+
touches.push(getTouchInfo(canvas, sx, sy, touch));
|
|
99034
99089
|
}
|
|
99035
99090
|
this.touches = touches;
|
|
99036
|
-
|
|
99037
|
-
|
|
99038
|
-
|
|
99039
|
-
|
|
99040
|
-
|
|
99041
|
-
|
|
99042
|
-
|
|
99043
|
-
|
|
99044
|
-
|
|
99091
|
+
}
|
|
99092
|
+
|
|
99093
|
+
const mousePos = getMouseInfo(canvas, sx, sy, e);
|
|
99094
|
+
this.movedX = e.movementX || 0;
|
|
99095
|
+
this.movedY = e.movementY || 0;
|
|
99096
|
+
this.mouseX = mousePos.x;
|
|
99097
|
+
this.mouseY = mousePos.y;
|
|
99098
|
+
this.winMouseX = mousePos.winX;
|
|
99099
|
+
this.winMouseY = mousePos.winY;
|
|
99045
99100
|
|
|
99046
99101
|
if (!this._hasMouseInteracted) {
|
|
99047
99102
|
this._updateMouseCoords();
|
|
@@ -106062,11 +106117,10 @@ var p5 = (function () {
|
|
|
106062
106117
|
*
|
|
106063
106118
|
* If a sketch has a
|
|
106064
106119
|
* <a href="#/p5/setup">setup()</a> function, then `millis()` begins tracking
|
|
106065
|
-
* time before the code in <a href="#/p5/setup">setup()</a> runs.
|
|
106066
|
-
* sketch includes
|
|
106067
|
-
* `millis()` begins tracking time as soon as the code
|
|
106068
|
-
*
|
|
106069
|
-
*
|
|
106120
|
+
* time before the code in <a href="#/p5/setup">setup()</a> runs. If a
|
|
106121
|
+
* sketch includes asynchronous loading using `async`/`await`, then
|
|
106122
|
+
* `millis()` begins tracking time as soon as the asynchronous code
|
|
106123
|
+
* starts running.
|
|
106070
106124
|
* @method millis
|
|
106071
106125
|
* @return {Number} number of milliseconds since starting the sketch.
|
|
106072
106126
|
*
|