littlejsengine 1.22.0 → 1.23.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/COPYRIGHT.txt +65 -38
- package/EDITOR.md +359 -0
- package/README.md +12 -7
- package/REFERENCE.md +2314 -0
- package/dist/littlejs.d.ts +640 -100
- package/dist/littlejs.esm.js +3596 -1444
- package/dist/littlejs.esm.min.js +3 -3
- package/dist/littlejs.js +3583 -1444
- package/dist/littlejs.min.js +2 -2
- package/dist/littlejs.release.js +2106 -1355
- package/package.json +4 -3
- package/plugins/gltf.js +29 -13
- package/plugins/lightSystem.js +8 -6
- package/plugins/parallax.js +174 -0
- package/plugins/particleEffects.js +37 -22
- package/plugins/pluginExport.js +8 -0
- package/plugins/postProcess.js +5 -2
- package/plugins/render3d.js +59 -21
- package/plugins/render3dEditor.js +1058 -118
- package/plugins/render3dExtras.js +82 -21
- package/plugins/render3dLevel.js +328 -8
- package/plugins/textureSheet.js +1 -0
- package/plugins/tweenSystem.js +39 -34
- package/plugins/uiSystem.js +7 -3
- package/plugins/zzfxm.js +161 -159
- package/src/engine.js +1 -1
- package/src/engineAudio.js +17 -3
- package/src/engineBuild.mjs +18 -2
- package/src/engineDraw.js +26 -10
- package/src/engineEditor.js +515 -52
- package/src/engineExport.js +5 -0
- package/src/engineInput.js +48 -6
- package/src/engineObject.js +675 -675
- package/src/engineRelease.js +17 -2
- package/src/engineSettings.js +14 -0
- package/src/engineTileLayer.js +2 -1
- package/src/engineUtilities.js +291 -291
- package/src/engineWebGL.js +12 -3
package/src/engineWebGL.js
CHANGED
|
@@ -770,6 +770,9 @@ function glDrawUntextured(x, y, sizeX, sizeY, angle, rgba)
|
|
|
770
770
|
glDraw(x, y, sizeX, sizeY, angle, 0, 0, 0, 0, 0, rgba);
|
|
771
771
|
}
|
|
772
772
|
|
|
773
|
+
// the list and the vectors glDrawPointsTransform writes its points into
|
|
774
|
+
const glPointsOut = [], glPointsPool = [];
|
|
775
|
+
|
|
773
776
|
/** Transform and add a polygon to the gl draw list
|
|
774
777
|
* @param {Array<Vector2>} points - Array of Vector2 points
|
|
775
778
|
* @param {number} rgba - Color of the polygon as a 32-bit integer
|
|
@@ -782,15 +785,21 @@ function glDrawUntextured(x, y, sizeX, sizeY, angle, rgba)
|
|
|
782
785
|
* @memberof WebGL */
|
|
783
786
|
function glDrawPointsTransform(points, rgba, x, y, sx, sy, angle, tristrip=true)
|
|
784
787
|
{
|
|
785
|
-
|
|
788
|
+
// written into vectors kept for this, a circle would make one for each of its sides at every draw; they are
|
|
789
|
+
// read into the batch before this returns
|
|
790
|
+
const pointsOut = glPointsOut, pool = glPointsPool, count = points.length;
|
|
791
|
+
pointsOut.length = count;
|
|
786
792
|
const sa = sin(-angle);
|
|
787
793
|
const ca = cos(-angle);
|
|
788
|
-
for (
|
|
794
|
+
for (let i = 0; i < count; ++i)
|
|
789
795
|
{
|
|
790
796
|
// transform the point
|
|
797
|
+
const p = points[i], out = pool[i] ||= vec2();
|
|
791
798
|
const px = p.x*sx;
|
|
792
799
|
const py = p.y*sy;
|
|
793
|
-
|
|
800
|
+
out.x = x + ca*px - sa*py;
|
|
801
|
+
out.y = y + sa*px + ca*py;
|
|
802
|
+
pointsOut[i] = out;
|
|
794
803
|
}
|
|
795
804
|
const drawPoints = tristrip ? glPolyStrip(pointsOut) : pointsOut;
|
|
796
805
|
glDrawPoints(drawPoints, rgba);
|