1
0
Fork 0
Browse Source

refactor: don't attach acceleration to shapes anymore

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
combat-scorched-earth-from-outer-space
André Jaenisch 10 months ago
parent
commit
74bfda593e
Signed by: ryuno-ki
GPG Key ID: 5A668E771F1ED854
  1. 3
      src/js/shape.js
  2. 2
      types/shape.d.ts

3
src/js/shape.js

@ -1,4 +1,3 @@
import { gravity } from './constants.js'
import { normalize, subtract, Vec2 } from './vector.js'
/** @typedef {import('./vector.js').Vector2D} Vector2D
@ -10,7 +9,6 @@ import { normalize, subtract, Vec2 } from './vector.js'
* @property {number} R
* @property {number} M
* @property {Vector2D} V
* @property {Vector2D} A
* @property {number} G
* @property {number} v
* @property {number} a
@ -51,7 +49,6 @@ export function RigidShape ({
R: restitution,
M: mass ? 1 / mass : immobile,
V: Vec2(0, 0), // velocity, i.e. speed
A: mass ? gravity : Vec2(0, 0), // acceleration
G: 0, // angle
v: 0, // angle velocity
a: 0, // angle acceleration

2
types/shape.d.ts vendored

@ -7,7 +7,6 @@
* @property {number} R
* @property {number} M
* @property {Vector2D} V
* @property {Vector2D} A
* @property {number} G
* @property {number} v
* @property {number} a
@ -55,7 +54,6 @@ export type Shape = {
R: number;
M: number;
V: Vector2D;
A: Vector2D;
G: number;
v: number;
a: number;

Loading…
Cancel
Save