p5 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{src → dist}/accessibility/color_namer.js +48 -3
- package/{src → dist}/accessibility/describe.js +12 -2
- package/{src → dist}/accessibility/gridOutput.js +2 -2
- package/dist/accessibility/index.js +60 -0
- package/{src → dist}/accessibility/outputs.js +23 -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-tYr0tCl8.js} +284 -132
- package/{src → dist}/core/States.js +3 -1
- package/dist/core/constants.js +1 -0
- package/{src → dist}/core/environment.js +12 -10
- 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 +5421 -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-Cr8L2Jnm.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 +19 -13
- 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 +26 -26
- package/{src → dist}/events/index.js +3 -1
- package/{src → dist}/events/keyboard.js +14 -12
- 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 +5 -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 +5 -6
- 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-CAxvgiOV.js} +738 -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 +3 -3
- 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-Swjl9HQO.js} +393 -22
- package/dist/rendering-B5TRR7aY.js +24960 -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 -63
- package/{src → dist}/type/textCore.js +35 -58
- 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 +78 -38
- package/lib/p5.esm.js +296 -194
- package/lib/p5.js +296 -194
- package/lib/p5.min.js +1 -1
- package/package.json +17 -17
- package/translations/dev.js +6 -6
- package/translations/index.js +1 -1
- package/types/accessibility/color_namer.d.ts +8 -0
- package/types/accessibility/describe.d.ts +184 -0
- package/types/accessibility/gridOutput.d.ts +8 -0
- package/types/accessibility/outputs.d.ts +235 -0
- package/types/accessibility/textOutput.d.ts +8 -0
- package/types/color/color_conversion.d.ts +47 -0
- package/types/color/creating_reading.d.ts +1348 -0
- package/types/color/p5.Color.d.ts +1070 -0
- package/types/color/setting.d.ts +2085 -0
- package/types/core/constants.d.ts +341 -0
- package/types/core/environment.d.ts +668 -0
- package/types/core/friendly_errors/fes_core.d.ts +8 -0
- package/types/core/friendly_errors/file_errors.d.ts +8 -0
- package/types/core/friendly_errors/param_validator.d.ts +30 -0
- package/types/core/friendly_errors/sketch_reader.d.ts +8 -0
- package/types/core/friendly_errors/stacktrace.d.ts +11 -0
- package/types/core/friendly_errors/validate_params.d.ts +8 -0
- package/types/core/helpers.d.ts +8 -0
- package/types/core/legacy.d.ts +8 -0
- package/types/core/main.d.ts +5996 -0
- package/types/core/p5.Graphics.d.ts +484 -0
- package/types/core/p5.Renderer.d.ts +14 -0
- package/types/core/reference.d.ts +8 -0
- package/types/core/rendering.d.ts +481 -0
- package/types/core/structure.d.ts +492 -0
- package/types/core/transform.d.ts +1638 -0
- package/types/data/local_storage.d.ts +323 -0
- package/types/dom/dom.d.ts +1295 -0
- package/types/dom/p5.Element.d.ts +2011 -0
- package/types/dom/p5.File.d.ts +13 -0
- package/types/dom/p5.MediaElement.d.ts +1249 -0
- package/types/events/acceleration.d.ts +193 -0
- package/types/events/keyboard.d.ts +499 -0
- package/types/events/pointer.d.ts +782 -0
- package/types/global.d.ts +5542 -0
- package/types/image/filterRenderer2D.d.ts +54 -0
- package/types/image/image.d.ts +326 -0
- package/types/image/loading_displaying.d.ts +580 -0
- package/types/image/p5.Image.d.ts +5882 -0
- package/types/image/pixels.d.ts +832 -0
- package/types/io/files.d.ts +1447 -0
- package/types/io/p5.Table.d.ts +1247 -0
- package/types/io/p5.TableRow.d.ts +343 -0
- package/types/io/p5.XML.d.ts +1188 -0
- package/types/math/Matrices/Matrix.d.ts +1029 -0
- package/types/math/Matrices/MatrixNumjs.d.ts +8 -0
- package/types/math/calculation.d.ts +923 -0
- package/types/math/math.d.ts +90 -0
- package/types/math/noise.d.ts +311 -0
- package/types/math/p5.Matrix.d.ts +8 -0
- package/types/math/p5.Vector.d.ts +3416 -0
- package/types/math/random.d.ts +267 -0
- package/types/math/trigonometry.d.ts +663 -0
- package/types/p5.d.ts +6663 -0
- package/types/shape/2d_primitives.d.ts +1033 -0
- package/types/shape/attributes.d.ts +466 -0
- package/types/shape/curves.d.ts +740 -0
- package/types/shape/custom_shapes.d.ts +888 -0
- package/types/shape/vertex.d.ts +1141 -0
- package/types/type/p5.Font.d.ts +575 -0
- package/types/type/textCore.d.ts +1198 -0
- package/types/utilities/conversion.d.ts +894 -0
- package/types/utilities/time_date.d.ts +295 -0
- package/types/utilities/utility_functions.d.ts +587 -0
- package/types/webgl/3d_primitives.d.ts +1432 -0
- package/types/webgl/ShaderGenerator.d.ts +8 -0
- package/types/webgl/interaction.d.ts +371 -0
- package/types/webgl/light.d.ts +1184 -0
- package/types/webgl/loading.d.ts +481 -0
- package/types/webgl/material.d.ts +2656 -0
- package/types/webgl/p5.Camera.d.ts +3023 -0
- package/types/webgl/p5.DataArray.d.ts +61 -0
- package/types/webgl/p5.Framebuffer.d.ts +760 -0
- package/types/webgl/p5.Geometry.d.ts +1191 -0
- package/types/webgl/p5.Quat.d.ts +45 -0
- package/types/webgl/p5.RendererGL.d.ts +234 -0
- package/types/webgl/p5.Shader.d.ts +660 -0
- package/types/webgl/p5.Texture.d.ts +61 -0
- package/types/webgl/text.d.ts +74 -0
- 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
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
// This file is auto-generated from JSDoc documentation
|
|
2
|
+
|
|
3
|
+
import p5 from 'p5';
|
|
4
|
+
|
|
5
|
+
declare module 'p5' {
|
|
6
|
+
/**
|
|
7
|
+
* Allows the user to orbit around a 3D sketch using a mouse, trackpad, or
|
|
8
|
+
* touchscreen.3D sketches are viewed through an imaginary camera. Calling
|
|
9
|
+
* `orbitControl()` within the draw() function allows
|
|
10
|
+
* the user to change the camera’s position:`function draw() {
|
|
11
|
+
* background(200);
|
|
12
|
+
*
|
|
13
|
+
* // Enable orbiting with the mouse.
|
|
14
|
+
* orbitControl();
|
|
15
|
+
*
|
|
16
|
+
* // Rest of sketch.
|
|
17
|
+
* }`Left-clicking and dragging or swipe motion will rotate the camera position
|
|
18
|
+
* about the center of the sketch. Right-clicking and dragging or multi-swipe
|
|
19
|
+
* will pan the camera position without rotation. Using the mouse wheel
|
|
20
|
+
* (scrolling) or pinch in/out will move the camera further or closer from the
|
|
21
|
+
* center of the sketch.The first three parameters, `sensitivityX`, `sensitivityY`, and
|
|
22
|
+
* `sensitivityZ`, are optional. They’re numbers that set the sketch’s
|
|
23
|
+
* sensitivity to movement along each axis. For example, calling
|
|
24
|
+
* `orbitControl(1, 2, -1)` keeps movement along the x-axis at its default
|
|
25
|
+
* value, makes the sketch twice as sensitive to movement along the y-axis,
|
|
26
|
+
* and reverses motion along the z-axis. By default, all sensitivity values
|
|
27
|
+
* are 1.The fourth parameter, `options`, is also optional. It’s an object that
|
|
28
|
+
* changes the behavior of orbiting. For example, calling
|
|
29
|
+
* `orbitControl(1, 1, 1, options)` keeps the default sensitivity values while
|
|
30
|
+
* changing the behaviors set with `options`. The object can have the
|
|
31
|
+
* following properties:`let options = {
|
|
32
|
+
* // Setting this to false makes mobile interactions smoother by
|
|
33
|
+
* // preventing accidental interactions with the page while orbiting.
|
|
34
|
+
* // By default, it's true.
|
|
35
|
+
* disableTouchActions: true,
|
|
36
|
+
*
|
|
37
|
+
* // Setting this to true makes the camera always rotate in the
|
|
38
|
+
* // direction the mouse/touch is moving.
|
|
39
|
+
* // By default, it's false.
|
|
40
|
+
* freeRotation: false
|
|
41
|
+
* };
|
|
42
|
+
*
|
|
43
|
+
* orbitControl(1, 1, 1, options);`
|
|
44
|
+
*
|
|
45
|
+
* @for p5
|
|
46
|
+
* @param sensitivity to movement along the x-axis. Defaults to 1.
|
|
47
|
+
* @param sensitivity to movement along the y-axis. Defaults to 1.
|
|
48
|
+
* @param sensitivity to movement along the z-axis. Defaults to 1.
|
|
49
|
+
* @param object with two optional properties, `disableTouchActions`
|
|
50
|
+
* and `freeRotation`. Both are `Boolean`s. `disableTouchActions`
|
|
51
|
+
* defaults to `true` and `freeRotation` defaults to `false`.
|
|
52
|
+
* @example <div>
|
|
53
|
+
* <code>
|
|
54
|
+
* // Click and drag the mouse to view the scene from different angles.
|
|
55
|
+
*
|
|
56
|
+
* function setup() {
|
|
57
|
+
* createCanvas(100, 100, WEBGL);
|
|
58
|
+
*
|
|
59
|
+
* describe('A multicolor box on a gray background. The camera angle changes when the user interacts using a mouse, trackpad, or touchscreen.');
|
|
60
|
+
* }
|
|
61
|
+
*
|
|
62
|
+
* function draw() {
|
|
63
|
+
* background(200);
|
|
64
|
+
*
|
|
65
|
+
* // Enable orbiting with the mouse.
|
|
66
|
+
* orbitControl();
|
|
67
|
+
*
|
|
68
|
+
* // Style the box.
|
|
69
|
+
* normalMaterial();
|
|
70
|
+
*
|
|
71
|
+
* // Draw the box.
|
|
72
|
+
* box(30, 50);
|
|
73
|
+
* }
|
|
74
|
+
* </code>
|
|
75
|
+
* </div>
|
|
76
|
+
*
|
|
77
|
+
* <div>
|
|
78
|
+
* <code>
|
|
79
|
+
* // Click and drag the mouse to view the scene from different angles.
|
|
80
|
+
*
|
|
81
|
+
* function setup() {
|
|
82
|
+
* createCanvas(100, 100, WEBGL);
|
|
83
|
+
*
|
|
84
|
+
* describe('A multicolor box on a gray background. The camera angle changes when the user interacts using a mouse, trackpad, or touchscreen.');
|
|
85
|
+
* }
|
|
86
|
+
*
|
|
87
|
+
* function draw() {
|
|
88
|
+
* background(200);
|
|
89
|
+
*
|
|
90
|
+
* // Enable orbiting with the mouse.
|
|
91
|
+
* // Make the interactions 3X sensitive.
|
|
92
|
+
* orbitControl(3, 3, 3);
|
|
93
|
+
*
|
|
94
|
+
* // Style the box.
|
|
95
|
+
* normalMaterial();
|
|
96
|
+
*
|
|
97
|
+
* // Draw the box.
|
|
98
|
+
* box(30, 50);
|
|
99
|
+
* }
|
|
100
|
+
* </code>
|
|
101
|
+
* </div>
|
|
102
|
+
*
|
|
103
|
+
* <div>
|
|
104
|
+
* <code>
|
|
105
|
+
* // Click and drag the mouse to view the scene from different angles.
|
|
106
|
+
*
|
|
107
|
+
* function setup() {
|
|
108
|
+
* createCanvas(100, 100, WEBGL);
|
|
109
|
+
*
|
|
110
|
+
* describe('A multicolor box on a gray background. The camera angle changes when the user interacts using a mouse, trackpad, or touchscreen.');
|
|
111
|
+
* }
|
|
112
|
+
*
|
|
113
|
+
* function draw() {
|
|
114
|
+
* background(200);
|
|
115
|
+
*
|
|
116
|
+
* // Create an options object.
|
|
117
|
+
* let options = {
|
|
118
|
+
* disableTouchActions: false,
|
|
119
|
+
* freeRotation: true
|
|
120
|
+
* };
|
|
121
|
+
*
|
|
122
|
+
* // Enable orbiting with the mouse.
|
|
123
|
+
* // Prevent accidental touch actions on touchscreen devices
|
|
124
|
+
* // and enable free rotation.
|
|
125
|
+
* orbitControl(1, 1, 1, options);
|
|
126
|
+
*
|
|
127
|
+
* // Style the box.
|
|
128
|
+
* normalMaterial();
|
|
129
|
+
*
|
|
130
|
+
* // Draw the box.
|
|
131
|
+
* box(30, 50);
|
|
132
|
+
* }
|
|
133
|
+
* </code>
|
|
134
|
+
* </div>
|
|
135
|
+
*/
|
|
136
|
+
function orbitControl(sensitivityX?: number, sensitivityY?: number, sensitivityZ?: number, options?: object): void;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Adds a grid and an axes icon to clarify orientation in 3D sketches.`debugMode()` adds a grid that shows where the “ground” is in a sketch. By
|
|
140
|
+
* default, the grid will run through the origin `(0, 0, 0)` of the sketch
|
|
141
|
+
* along the XZ plane. `debugMode()` also adds an axes icon that points along
|
|
142
|
+
* the positive x-, y-, and z-axes. Calling `debugMode()` displays the grid
|
|
143
|
+
* and axes icon with their default size and position.There are four ways to call `debugMode()` with optional parameters to
|
|
144
|
+
* customize the debugging environment.The first way to call `debugMode()` has one parameter, `mode`. If the
|
|
145
|
+
* system constant `GRID` is passed, as in `debugMode(GRID)`, then the grid
|
|
146
|
+
* will be displayed and the axes icon will be hidden. If the constant `AXES`
|
|
147
|
+
* is passed, as in `debugMode(AXES)`, then the axes icon will be displayed
|
|
148
|
+
* and the grid will be hidden.The second way to call `debugMode()` has six parameters. The first
|
|
149
|
+
* parameter, `mode`, selects either `GRID` or `AXES` to be displayed. The
|
|
150
|
+
* next five parameters, `gridSize`, `gridDivisions`, `xOff`, `yOff`, and
|
|
151
|
+
* `zOff` are optional. They’re numbers that set the appearance of the grid
|
|
152
|
+
* (`gridSize` and `gridDivisions`) and the placement of the axes icon
|
|
153
|
+
* (`xOff`, `yOff`, and `zOff`). For example, calling
|
|
154
|
+
* `debugMode(20, 5, 10, 10, 10)` sets the `gridSize` to 20 pixels, the number
|
|
155
|
+
* of `gridDivisions` to 5, and offsets the axes icon by 10 pixels along the
|
|
156
|
+
* x-, y-, and z-axes.The third way to call `debugMode()` has five parameters. The first
|
|
157
|
+
* parameter, `mode`, selects either `GRID` or `AXES` to be displayed. The
|
|
158
|
+
* next four parameters, `axesSize`, `xOff`, `yOff`, and `zOff` are optional.
|
|
159
|
+
* They’re numbers that set the appearance of the size of the axes icon
|
|
160
|
+
* (`axesSize`) and its placement (`xOff`, `yOff`, and `zOff`).The fourth way to call `debugMode()` has nine optional parameters. The
|
|
161
|
+
* first five parameters, `gridSize`, `gridDivisions`, `gridXOff`, `gridYOff`,
|
|
162
|
+
* and `gridZOff` are numbers that set the appearance of the grid. For
|
|
163
|
+
* example, calling `debugMode(100, 5, 0, 0, 0)` sets the `gridSize` to 100,
|
|
164
|
+
* the number of `gridDivisions` to 5, and sets all the offsets to 0 so that
|
|
165
|
+
* the grid is centered at the origin. The next four parameters, `axesSize`,
|
|
166
|
+
* `xOff`, `yOff`, and `zOff` are numbers that set the appearance of the size
|
|
167
|
+
* of the axes icon (`axesSize`) and its placement (`axesXOff`, `axesYOff`,
|
|
168
|
+
* and `axesZOff`). For example, calling
|
|
169
|
+
* `debugMode(100, 5, 0, 0, 0, 50, 10, 10, 10)` sets the `gridSize` to 100,
|
|
170
|
+
* the number of `gridDivisions` to 5, and sets all the offsets to 0 so that
|
|
171
|
+
* the grid is centered at the origin. It then sets the `axesSize` to 50 and
|
|
172
|
+
* offsets the icon 10 pixels along each axis.
|
|
173
|
+
*
|
|
174
|
+
* @example <div>
|
|
175
|
+
* <code>
|
|
176
|
+
* // Click and drag the mouse to view the scene from different angles.
|
|
177
|
+
*
|
|
178
|
+
* function setup() {
|
|
179
|
+
* createCanvas(100, 100, WEBGL);
|
|
180
|
+
*
|
|
181
|
+
* // Enable debug mode.
|
|
182
|
+
* debugMode();
|
|
183
|
+
*
|
|
184
|
+
* describe('A multicolor box on a gray background. A grid and axes icon are displayed near the box.');
|
|
185
|
+
* }
|
|
186
|
+
*
|
|
187
|
+
* function draw() {
|
|
188
|
+
* background(200);
|
|
189
|
+
*
|
|
190
|
+
* // Enable orbiting with the mouse.
|
|
191
|
+
* orbitControl();
|
|
192
|
+
*
|
|
193
|
+
* // Style the box.
|
|
194
|
+
* normalMaterial();
|
|
195
|
+
*
|
|
196
|
+
* // Draw the box.
|
|
197
|
+
* box(20, 40);
|
|
198
|
+
* }
|
|
199
|
+
* </code>
|
|
200
|
+
* </div>
|
|
201
|
+
*
|
|
202
|
+
* <div>
|
|
203
|
+
* <code>
|
|
204
|
+
* // Click and drag the mouse to view the scene from different angles.
|
|
205
|
+
*
|
|
206
|
+
* function setup() {
|
|
207
|
+
* createCanvas(100, 100, WEBGL);
|
|
208
|
+
*
|
|
209
|
+
* // Enable debug mode.
|
|
210
|
+
* // Only display the axes icon.
|
|
211
|
+
* debugMode(AXES);
|
|
212
|
+
*
|
|
213
|
+
* describe('A multicolor box on a gray background. A grid and axes icon are displayed near the box.');
|
|
214
|
+
* }
|
|
215
|
+
*
|
|
216
|
+
* function draw() {
|
|
217
|
+
* background(200);
|
|
218
|
+
*
|
|
219
|
+
* // Enable orbiting with the mouse.
|
|
220
|
+
* orbitControl();
|
|
221
|
+
*
|
|
222
|
+
* // Style the box.
|
|
223
|
+
* normalMaterial();
|
|
224
|
+
*
|
|
225
|
+
* // Draw the box.
|
|
226
|
+
* box(20, 40);
|
|
227
|
+
* }
|
|
228
|
+
* </code>
|
|
229
|
+
* </div>
|
|
230
|
+
*
|
|
231
|
+
* <div>
|
|
232
|
+
* <code>
|
|
233
|
+
* // Click and drag the mouse to view the scene from different angles.
|
|
234
|
+
*
|
|
235
|
+
* function setup() {
|
|
236
|
+
* createCanvas(100, 100, WEBGL);
|
|
237
|
+
*
|
|
238
|
+
* // Enable debug mode.
|
|
239
|
+
* // Only display the grid and customize it:
|
|
240
|
+
* // - size: 50
|
|
241
|
+
* // - divisions: 10
|
|
242
|
+
* // - offsets: 0, 20, 0
|
|
243
|
+
* debugMode(GRID, 50, 10, 0, 20, 0);
|
|
244
|
+
*
|
|
245
|
+
* describe('A multicolor box on a gray background. A grid is displayed below the box.');
|
|
246
|
+
* }
|
|
247
|
+
*
|
|
248
|
+
* function draw() {
|
|
249
|
+
* background(200);
|
|
250
|
+
*
|
|
251
|
+
* // Enable orbiting with the mouse.
|
|
252
|
+
* orbitControl();
|
|
253
|
+
*
|
|
254
|
+
* // Style the box.
|
|
255
|
+
* normalMaterial();
|
|
256
|
+
*
|
|
257
|
+
* // Draw the box.
|
|
258
|
+
* box(20, 40);
|
|
259
|
+
* }
|
|
260
|
+
* </code>
|
|
261
|
+
* </div>
|
|
262
|
+
*
|
|
263
|
+
* <div>
|
|
264
|
+
* <code>
|
|
265
|
+
* // Click and drag the mouse to view the scene from different angles.
|
|
266
|
+
*
|
|
267
|
+
* function setup() {
|
|
268
|
+
* createCanvas(100, 100, WEBGL);
|
|
269
|
+
*
|
|
270
|
+
* // Enable debug mode.
|
|
271
|
+
* // Display the grid and axes icon and customize them:
|
|
272
|
+
* // Grid
|
|
273
|
+
* // ----
|
|
274
|
+
* // - size: 50
|
|
275
|
+
* // - divisions: 10
|
|
276
|
+
* // - offsets: 0, 20, 0
|
|
277
|
+
* // Axes
|
|
278
|
+
* // ----
|
|
279
|
+
* // - size: 50
|
|
280
|
+
* // - offsets: 0, 0, 0
|
|
281
|
+
* debugMode(50, 10, 0, 20, 0, 50, 0, 0, 0);
|
|
282
|
+
*
|
|
283
|
+
* describe('A multicolor box on a gray background. A grid is displayed below the box. An axes icon is displayed at the center of the box.');
|
|
284
|
+
* }
|
|
285
|
+
*
|
|
286
|
+
* function draw() {
|
|
287
|
+
* background(200);
|
|
288
|
+
*
|
|
289
|
+
* // Enable orbiting with the mouse.
|
|
290
|
+
* orbitControl();
|
|
291
|
+
*
|
|
292
|
+
* // Style the box.
|
|
293
|
+
* normalMaterial();
|
|
294
|
+
*
|
|
295
|
+
* // Draw the box.
|
|
296
|
+
* box(20, 40);
|
|
297
|
+
* }
|
|
298
|
+
* </code>
|
|
299
|
+
* </div>
|
|
300
|
+
*/
|
|
301
|
+
function debugMode(): void;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* @param either GRID or AXES
|
|
305
|
+
*/
|
|
306
|
+
function debugMode(mode: GRID | AXES): void;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @param side length of the grid.
|
|
310
|
+
* @param number of divisions in the grid.
|
|
311
|
+
* @param offset from origin along the x-axis.
|
|
312
|
+
* @param offset from origin along the y-axis.
|
|
313
|
+
* @param offset from origin along the z-axis.
|
|
314
|
+
*/
|
|
315
|
+
function debugMode(mode: GRID | AXES, gridSize?: number, gridDivisions?: number, xOff?: number, yOff?: number, zOff?: number): void;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* @param length of axes icon markers.
|
|
319
|
+
*/
|
|
320
|
+
function debugMode(mode: GRID | AXES, axesSize?: number, xOff?: number, yOff?: number, zOff?: number): void;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @param grid offset from the origin along the x-axis.
|
|
324
|
+
* @param grid offset from the origin along the y-axis.
|
|
325
|
+
* @param grid offset from the origin along the z-axis.
|
|
326
|
+
* @param axes icon offset from the origin along the x-axis.
|
|
327
|
+
* @param axes icon offset from the origin along the y-axis.
|
|
328
|
+
* @param axes icon offset from the origin along the z-axis.
|
|
329
|
+
*/
|
|
330
|
+
function debugMode(gridSize?: number, gridDivisions?: number, gridXOff?: number, gridYOff?: number, gridZOff?: number, axesSize?: number, axesXOff?: number, axesYOff?: number, axesZOff?: number): void;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Turns off debugMode() in a 3D sketch.
|
|
334
|
+
*
|
|
335
|
+
* @example <div>
|
|
336
|
+
* <code>
|
|
337
|
+
* // Click and drag the mouse to view the scene from different angles.
|
|
338
|
+
*
|
|
339
|
+
* function setup() {
|
|
340
|
+
* createCanvas(100, 100, WEBGL);
|
|
341
|
+
*
|
|
342
|
+
* // Enable debug mode.
|
|
343
|
+
* debugMode();
|
|
344
|
+
*
|
|
345
|
+
* describe('A multicolor box on a gray background. A grid and axes icon are displayed near the box. They disappear when the user double-clicks.');
|
|
346
|
+
* }
|
|
347
|
+
*
|
|
348
|
+
* function draw() {
|
|
349
|
+
* background(200);
|
|
350
|
+
*
|
|
351
|
+
* // Enable orbiting with the mouse.
|
|
352
|
+
* orbitControl();
|
|
353
|
+
*
|
|
354
|
+
* // Style the box.
|
|
355
|
+
* normalMaterial();
|
|
356
|
+
*
|
|
357
|
+
* // Draw the box. box(20, 40);
|
|
358
|
+
* }
|
|
359
|
+
*
|
|
360
|
+
* // Disable debug mode when the user double-clicks.
|
|
361
|
+
* function doubleClicked() {
|
|
362
|
+
* noDebugMode();
|
|
363
|
+
* }
|
|
364
|
+
* </code>
|
|
365
|
+
* </div>
|
|
366
|
+
*/
|
|
367
|
+
function noDebugMode(): void;
|
|
368
|
+
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export default function interaction(p5: any, fn: any): void;
|