Something is off in my vector calculations

This commit is contained in:
2026-01-30 13:45:20 -08:00
parent 89cf20e35a
commit 478c90e398

View File

@@ -767,7 +767,9 @@ const Move = (() => {
const side = isClockwise([contact.edge.xa, contact.edge.ya], [contact.edge.xb, contact.edge.yb], [px, py]);
// contact.velocity = { x: prVonNx, y: prVonNy };
Velocity[entity_id] = { x: -prVonNx, y: -prVonNy };
// Velocity[entity_id] = { x: prVonNx, y: prVonNy };
Velocity[entity_id] = { x: v.x + prVonNx, y: v.y + prVonNy };
console.log("v", v);
console.log("velocity", Velocity[entity_id]);
console.log("current position", px, py);

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB