-
Notifications
You must be signed in to change notification settings - Fork 48
/
DynamicsB2TimeStep.go
54 lines (46 loc) · 1 KB
/
DynamicsB2TimeStep.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package box2d
/// Profiling data. Times are in milliseconds.
type B2Profile struct {
Step float64
Collide float64
Solve float64
SolveInit float64
SolveVelocity float64
SolvePosition float64
Broadphase float64
SolveTOI float64
}
func MakeB2Profile() B2Profile {
return B2Profile{}
}
/// This is an internal structure.
type B2TimeStep struct {
Dt float64 // time step
Inv_dt float64 // inverse time step (0 if dt == 0).
DtRatio float64 // dt * inv_dt0
VelocityIterations int
PositionIterations int
WarmStarting bool
}
func MakeB2TimeStep() B2TimeStep {
return B2TimeStep{}
}
/// This is an internal structure.
type B2Position struct {
C B2Vec2
A float64
}
/// This is an internal structure.
type B2Velocity struct {
V B2Vec2
W float64
}
/// Solver Data
type B2SolverData struct {
Step B2TimeStep
Positions []B2Position
Velocities []B2Velocity
}
func MakeB2SolverData() B2SolverData {
return B2SolverData{}
}