One-way platforms, raycast and collision stay with contact data: a collider can be one-way with a side it blocks from (turning with its object, drawn thick in the scene view) and a tile can be one-way from above, one-way cells never merge with solid tiles, a contact blocks only when its normal is within 45 degrees of the blocking side, the new node Ignore one-way lets an object drop through for a while, and it all holds for Move and for dynamic bodies in Rapier, where the decision is made before each step because the hook may not touch the engine (#155); the new Raycast node answers hit, object, collider, point, normal and distance in our own f64 geometry, the same in editor run and play, and the editor run draws each ray for 0.25 s (#153); On collision stay gains an interval with its own clock per pair, and stay and enter gain the contact point next to normal and impulse (#149); fixes that every Rapier collider of a tilemap had the shape of its last cell
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
947a6b1977
commit
6a31f5e0ad
33 files changed
+2064
-125
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { edge, node } from '../lib/builders.mjs';
|
||||
import { LANES, MAKE_OBJECT } from './lib/scaffold.mjs';
|
||||
import { inView, LANES, MAKE_OBJECT } from './lib/scaffold.mjs';
|
||||
|
||||
/** Kicks its owner in On start, with the scene's gravity switched off first: it glides at 100 per second. */
|
||||
const KICK = 200;
|
||||
@@ -61,24 +61,6 @@ const rollGraph = {
|
||||
],
|
||||
};
|
||||
|
||||
/**
|
||||
* A point of a panel (`panel` and `point` are hook expressions), scrolled into view first: a
|
||||
* collider's material rows sit below the fold of the inspector, and after the earlier steps the
|
||||
* hierarchy is long enough to hide this step's objects. A click beside the panel would land on
|
||||
* whatever is drawn there instead.
|
||||
*/
|
||||
async function inView(t, panel, point) {
|
||||
for (let i = 0; i < 15; i++) {
|
||||
const rect = await t.json(panel);
|
||||
const at = await t.json(point);
|
||||
if (!rect) return null;
|
||||
if (at && at.y > rect.y + 8 && at.y < rect.y + rect.h - 8) return at;
|
||||
await t.wheel(rect.x + rect.w / 2, rect.y + rect.h / 2, at && at.y < rect.y ? -200 : 200);
|
||||
await t.settle();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The physics engine (Rapier) loads in the editor, in the background after the first project is
|
||||
* open, from a chunk of its own – the editor bundle does not carry it. A played scene simulates its
|
||||
|
||||
Reference in new issue
Block a user