-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypings.d.ts
More file actions
91 lines (79 loc) · 1.57 KB
/
typings.d.ts
File metadata and controls
91 lines (79 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { vec2, mat3 } from "gl-matrix"
declare global {
interface Window {
twgl: typeof import("twgl.js")
glMatrix: typeof import("gl-matrix")
}
type Vec2 = vec2
type Vec4 = [number, number, number, number]
interface Thruster {
location: vec2
angle: number
force: number
on: boolean
noise: (on: boolean) => void
key: string
touch: string
transform: mat3
}
type BodyType = "circle" | "poly"
interface DynamicBody {
type: BodyType
fixed: boolean
radius: number
mass: number
health: number
destroyed: number
location: Vec2
velocity: Vec2
force: Vec2
inertia: number
angle: number
angularVelocity: number
torque: number
points?: Vec2[]
scale: number
absolutePoints?: Vec2[]
absolutePointsTime?: number
orbitCenter?: Vec2
orbitRadius?: number
landed?: boolean
}
interface Ship extends DynamicBody {
thrusters: Thruster[]
health: number
}
interface System {
mass: number
orbitRadius: number
children?: System[]
orbitVelocity?: number
}
interface DebugPoint {
color: Vec4
origin: Vec2
offset?: Vec2
}
interface State {
running: boolean
rendered: boolean
time: number
zoom: number
idealZoom: number
viewRadius: number
width: number
height: number
bodies: DynamicBody[]
ship: Ship
debugPoints?: DebugPoint[]
pointsRendered: number
fps: number
lastRender: number
}
interface Collision {
point: Vec2
normal: Vec2
depth: number
}
}
export {}