Something is off in my vector calculations
This commit is contained in:
@@ -767,7 +767,9 @@ const Move = (() => {
|
|||||||
const side = isClockwise([contact.edge.xa, contact.edge.ya], [contact.edge.xb, contact.edge.yb], [px, py]);
|
const side = isClockwise([contact.edge.xa, contact.edge.ya], [contact.edge.xb, contact.edge.yb], [px, py]);
|
||||||
|
|
||||||
// contact.velocity = { x: prVonNx, y: prVonNy };
|
// 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("velocity", Velocity[entity_id]);
|
||||||
|
|
||||||
console.log("current position", px, py);
|
console.log("current position", px, py);
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Reference in New Issue
Block a user