(dt float32)
| 93 | } |
| 94 | |
| 95 | func (r *RotationSystem) Update(dt float32) { |
| 96 | // speed in radians per second |
| 97 | var speed float32 = math.Pi |
| 98 | // speed in degrees per second |
| 99 | var speedDegrees float32 = speed * 180 / math.Pi |
| 100 | |
| 101 | for _, e := range r.entities { |
| 102 | e.SpaceComponent.Rotation += speedDegrees * dt |
| 103 | e.SpaceComponent.Rotation = math.Mod(e.SpaceComponent.Rotation, 360) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func (*DefaultScene) Type() string { return "GameWorld" } |
| 108 |