littlejsengine 1.17.14 → 1.17.15
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/dist/littlejs.esm.js +11 -9
- package/dist/littlejs.esm.min.js +1 -1
- package/dist/littlejs.js +11 -9
- package/dist/littlejs.min.js +1 -1
- package/dist/littlejs.release.js +11 -9
- package/examples/shorts/base.html +1 -1
- package/examples/starter/index.html +2 -2
- package/package.json +1 -1
- package/src/engine.js +1 -1
- package/src/engineMath.js +10 -8
package/dist/littlejs.esm.js
CHANGED
|
@@ -35,7 +35,7 @@ const engineName = 'LittleJS';
|
|
|
35
35
|
* @type {string}
|
|
36
36
|
* @default
|
|
37
37
|
* @memberof Engine */
|
|
38
|
-
const engineVersion = '1.17.
|
|
38
|
+
const engineVersion = '1.17.15';
|
|
39
39
|
|
|
40
40
|
/** Frames per second to update
|
|
41
41
|
* @type {number}
|
|
@@ -1767,15 +1767,17 @@ function lineTest(posStart, posEnd, testFunction, normal)
|
|
|
1767
1767
|
// set hit point
|
|
1768
1768
|
const hitPos = vec2(posStart.x + dirX*t, posStart.y + dirY*t);
|
|
1769
1769
|
|
|
1770
|
-
//
|
|
1770
|
+
// ensure result is inside the tile
|
|
1771
1771
|
const e = 1e-9;
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
hitPos.y
|
|
1772
|
+
const hitPosFloor = hitPos.floor();
|
|
1773
|
+
if (hitPosFloor.x < pos.x)
|
|
1774
|
+
hitPos.x = pos.x;
|
|
1775
|
+
else if (hitPosFloor.x > pos.x)
|
|
1776
|
+
hitPos.x = pos.x + 1 - e;
|
|
1777
|
+
if (hitPosFloor.y < pos.y)
|
|
1778
|
+
hitPos.y = pos.y;
|
|
1779
|
+
else if (hitPosFloor.y > pos.y)
|
|
1780
|
+
hitPos.y = pos.y + 1 - e;
|
|
1779
1781
|
|
|
1780
1782
|
// set normal
|
|
1781
1783
|
if (normal)
|