-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathharmonica.go
32 lines (32 loc) · 920 Bytes
/
harmonica.go
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
// Package harmonica is a set of physics-based animation tools for 2D and 3D
// applications. There's a spring animation simulator for for smooth, realistic
// motion and a projectile simulator well suited for projectiles and particles.
//
// Example spring usage:
//
// // Run once to initialize.
// spring := NewSpring(FPS(60), 6.0, 0.2)
//
// // Update on every frame.
// pos := 0.0
// velocity := 0.0
// targetPos := 100.0
// someUpdateLoop(func() {
// pos, velocity = spring.Update(pos, velocity, targetPos)
// })
//
// Example projectile usage:
//
// // Run once to initialize.
// projectile := NewProjectile(
// FPS(60),
// Point{6.0, 100.0, 0.0},
// Vector{2.0, 0.0, 0.0},
// Vector{2.0, -9.81, 0.0},
// )
//
// // Update on every frame.
// someUpdateLoop(func() {
// pos := projectile.Update()
// })
package harmonica