Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Spatial conditions with R-Trees #5860

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
40c5012
Avoid useless object life-cycle calls.
D8H Oct 31, 2023
c3c0c19
Watch plaforms passively.
D8H Nov 2, 2023
8afea38
Add todo
D8H Nov 3, 2023
852fdd7
Try to maintain a R-Tree per object.
D8H Nov 4, 2023
cbae925
Try to maintain a R-Tree per layer.
D8H Nov 6, 2023
e45ba94
Reduce memory allocation from platform behavior.
D8H Nov 7, 2023
7f7a13d
Avoid extra mapping of searched items.
D8H Nov 9, 2023
2cdfc88
Fix initial culling.
D8H Nov 10, 2023
fbf4bae
Fix initial state.
D8H Nov 10, 2023
6e6ddb9
Allow objects to sleep at the 1st frame.
D8H Nov 11, 2023
27f16a3
Fix the distance condition.
D8H Nov 12, 2023
e34aedb
Add a fast collision condition.
D8H Nov 13, 2023
ad0f1f1
Add a flag to know if an ObjectsLists has been picked
D8H Nov 14, 2023
b7787d2
Fix the isPick flag handling.
D8H Nov 14, 2023
23a39f1
Use the isPicked flag.
D8H Nov 14, 2023
0f8fcac
Better comment.
D8H Nov 14, 2023
8c7331f
Fix Sprite initial life-cycle sleeping state.
D8H Nov 14, 2023
0755493
Fix TextInput culling.
D8H Nov 14, 2023
daa1f30
Explain a failing test of platformer.
D8H Nov 14, 2023
9d1233b
Fix the conditions with few objects.
D8H Nov 14, 2023
66f12b8
Fix types
D8H Nov 14, 2023
6330715
do fix types.
D8H Nov 15, 2023
38e187b
Fix platform update.
D8H Nov 16, 2023
72603a4
Fix the spatial conditions crash when used in extensions.
D8H Nov 16, 2023
329d899
Fix picking of iterated objects.
D8H Nov 16, 2023
5274f68
Fix state toggling.
D8H Nov 16, 2023
d153378
Partially fix collision for groups.
D8H Nov 17, 2023
92d7ddf
Ensure RBush compatibility for extensions using it.
D8H Nov 23, 2023
3271654
Add comments.
D8H Nov 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ensure RBush compatibility for extensions using it.
  • Loading branch information
D8H committed Nov 23, 2023
commit 92d7ddf5f7ada05abba395e6f4ae4e4823e7c54c
9 changes: 4 additions & 5 deletions GDJS/Runtime/libs/rbush.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.RBush = factory());
(global = global || self, global.rbush = global.RBush = factory());
}(this, function () { 'use strict';

function quickselect(arr, k, left, right, compare) {
Expand Down Expand Up @@ -86,7 +86,7 @@
const childBBox = node.leaf ? toBBox(child) : child;

if (intersects(bbox, childBBox)) {
if (node.leaf) result.push(child.source);
if (node.leaf) result.push(child.source || child);
else if (contains(bbox, childBBox)) this._all(child, result);
else nodesToSearch.push(child);
}
Expand Down Expand Up @@ -229,7 +229,7 @@
_all(node, result) {
const nodesToSearch = [];
while (node) {
if (node.leaf) node.children.forEach(child => result.push(child.source));
if (node.leaf) node.children.forEach(child => result.push(child.source || child));
else nodesToSearch.push(...node.children);

node = nodesToSearch.pop();
Expand Down Expand Up @@ -572,5 +572,4 @@

return RBush;

}));

}));