Documentation
¶
Index ¶
- func CalculateInertia(entity *states.PhysicsState) float64
- type AerodynamicSystem
- func (a *AerodynamicSystem) Add(entity *states.PhysicsState)
- func (a *AerodynamicSystem) CalculateAerodynamicMoment(entity states.PhysicsState) types.Vector3
- func (a *AerodynamicSystem) CalculateDrag(entity *states.PhysicsState) types.Vector3
- func (a *AerodynamicSystem) Remove(basic ecs.BasicEntity)
- func (a *AerodynamicSystem) Update(dt float32)
- func (a *AerodynamicSystem) UpdateWithError(dt float64) error
- type EventLog
- type LaunchRail
- type LaunchRailSystem
- func (s *LaunchRailSystem) Add(pe *states.PhysicsState)
- func (s *LaunchRailSystem) GetEntities() []*states.PhysicsState
- func (s *LaunchRailSystem) GetRail() LaunchRail
- func (lrs *LaunchRailSystem) InitializeRocketPosition(rocketState *states.PhysicsState)
- func (s *LaunchRailSystem) IsOnRail() bool
- func (s *LaunchRailSystem) Update(dt float32)
- func (s *LaunchRailSystem) UpdateWithError(dt float64) error
- type LogParasiteSystem
- type ParasiteSystem
- type PhysicsSystem
- type Result
- type RulesSystem
- func (s *RulesSystem) Add(entity *states.PhysicsState)
- func (s *RulesSystem) DetectApogee(entity *states.PhysicsState) bool
- func (s *RulesSystem) GetLastEvent() types.Event
- func (s *RulesSystem) ProcessRules(entity *states.PhysicsState) types.Event
- func (s *RulesSystem) Update(dt float32)
- func (s *RulesSystem) UpdateWithError(dt float64) error
- type StorageParasiteSystem
- type System
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateInertia ¶
func CalculateInertia(entity *states.PhysicsState) float64
CalculateInertia returns a simplified moment of inertia value for pitch/yaw
Types ¶
type AerodynamicSystem ¶
type AerodynamicSystem struct {
// contains filtered or unexported fields
}
AerodynamicSystem calculates aerodynamic forces on entities
func NewAerodynamicSystem ¶
func NewAerodynamicSystem(world *ecs.World, isa *atmosphere.ISAModel, log logf.Logger) *AerodynamicSystem
NewAerodynamicSystem creates a new aerodynamic system
func (*AerodynamicSystem) Add ¶
func (a *AerodynamicSystem) Add(entity *states.PhysicsState)
Add implements System interface
func (*AerodynamicSystem) CalculateAerodynamicMoment ¶
func (a *AerodynamicSystem) CalculateAerodynamicMoment(entity states.PhysicsState) types.Vector3
CalculateAerodynamicMoment calculates the aerodynamic moments on the entity
func (*AerodynamicSystem) CalculateDrag ¶
func (a *AerodynamicSystem) CalculateDrag(entity *states.PhysicsState) types.Vector3
CalculateDrag calculates drag force in world frame
func (*AerodynamicSystem) Remove ¶ added in v0.8.0
func (a *AerodynamicSystem) Remove(basic ecs.BasicEntity)
Remove implements System interface
func (*AerodynamicSystem) Update ¶
func (a *AerodynamicSystem) Update(dt float32)
Update implements ecs.System interface
func (*AerodynamicSystem) UpdateWithError ¶ added in v0.8.0
func (a *AerodynamicSystem) UpdateWithError(dt float64) error
UpdateWithError implements System interface
type LaunchRail ¶
type LaunchRail struct {
Length float64
Angle float64 // Angle from vertical in degrees
Orientation float64 // Compass orientation in degrees
}
LaunchRail represents a launch rail
type LaunchRailSystem ¶
type LaunchRailSystem struct {
// contains filtered or unexported fields
}
LaunchRailSystem constrains entities to a launch rail
func NewLaunchRailSystem ¶
func NewLaunchRailSystem(world *ecs.World, length, angleDegrees, orientationDegrees float64, logger *logf.Logger) *LaunchRailSystem
NewLaunchRailSystem creates a new LaunchRailSystem
func (*LaunchRailSystem) Add ¶
func (s *LaunchRailSystem) Add(pe *states.PhysicsState)
Add adds a physics entity to the launch rail system
func (*LaunchRailSystem) GetEntities ¶
func (s *LaunchRailSystem) GetEntities() []*states.PhysicsState
GetEntities returns the tracked entities
func (*LaunchRailSystem) GetRail ¶
func (s *LaunchRailSystem) GetRail() LaunchRail
GetRail returns the launch rail configuration
func (*LaunchRailSystem) InitializeRocketPosition ¶ added in v0.8.0
func (lrs *LaunchRailSystem) InitializeRocketPosition(rocketState *states.PhysicsState)
InitializeRocketPosition sets the initial X and Y position of the rocket based on the launch rail.
func (*LaunchRailSystem) IsOnRail ¶
func (s *LaunchRailSystem) IsOnRail() bool
IsOnRail returns whether the system is still constraining to the rail
func (*LaunchRailSystem) Update ¶
func (s *LaunchRailSystem) Update(dt float32)
Update implements ecs.System interface
func (*LaunchRailSystem) UpdateWithError ¶ added in v0.8.0
func (s *LaunchRailSystem) UpdateWithError(dt float64) error
UpdateWithError implements System interface
type LogParasiteSystem ¶
type LogParasiteSystem struct {
// contains filtered or unexported fields
}
LogParasiteSystem logs rocket state data
func NewLogParasiteSystem ¶
func NewLogParasiteSystem(world *ecs.World, logger logf.Logger) *LogParasiteSystem
NewLogParasiteSystem creates a new LogParasiteSystem
func (*LogParasiteSystem) Add ¶
func (s *LogParasiteSystem) Add(pe *states.PhysicsState)
Add adds entities to the system
func (*LogParasiteSystem) Start ¶
func (s *LogParasiteSystem) Start(dataChan chan *states.PhysicsState)
Start the LogParasiteSystem
func (*LogParasiteSystem) Update ¶
func (s *LogParasiteSystem) Update(dt float32)
Update implements ecs.System interface
func (*LogParasiteSystem) UpdateWithError ¶ added in v0.8.0
func (s *LogParasiteSystem) UpdateWithError(dt float64) error
UpdateWithError implements System interface
type ParasiteSystem ¶
type ParasiteSystem interface {
ecs.System
Start(dataChan chan *states.PhysicsState)
Stop()
}
ParasiteSystem extends the base System interface
type PhysicsSystem ¶
type PhysicsSystem struct {
// contains filtered or unexported fields
}
PhysicsSystem calculates forces on entities
func NewPhysicsSystem ¶
func NewPhysicsSystem(world *ecs.World, cfg *config.Engine, logger logf.Logger, workers int) *PhysicsSystem
NewPhysicsSystem creates a new PhysicsSystem
func (*PhysicsSystem) Add ¶
func (s *PhysicsSystem) Add(pe *states.PhysicsState)
Add adds an entity to the system
func (*PhysicsSystem) Remove ¶
func (s *PhysicsSystem) Remove(basic ecs.BasicEntity)
Remove removes an entity from the system
func (*PhysicsSystem) String ¶
func (s *PhysicsSystem) String() string
String returns the system name
func (*PhysicsSystem) Update ¶
func (s *PhysicsSystem) Update(dt float32)
Update implements ecs.System interface
func (*PhysicsSystem) UpdateWithError ¶ added in v0.8.0
func (s *PhysicsSystem) UpdateWithError(dt float64) error
UpdateWithError implements System interface
type Result ¶ added in v0.8.0
type Result struct {
// contains filtered or unexported fields
}
Result represents the outcome of a physics calculation
type RulesSystem ¶
type RulesSystem struct {
// contains filtered or unexported fields
}
RulesSystem enforces rules of flight
func NewRulesSystem ¶
NewRulesSystem creates a new RulesSystem
func (*RulesSystem) Add ¶
func (s *RulesSystem) Add(entity *states.PhysicsState)
Add adds a physics entity to the rules system
func (*RulesSystem) DetectApogee ¶
func (s *RulesSystem) DetectApogee(entity *states.PhysicsState) bool
func (*RulesSystem) GetLastEvent ¶
func (s *RulesSystem) GetLastEvent() types.Event
GetLastEvent returns the last event detected by the rules system
func (*RulesSystem) ProcessRules ¶
func (s *RulesSystem) ProcessRules(entity *states.PhysicsState) types.Event
func (*RulesSystem) Update ¶
func (s *RulesSystem) Update(dt float32)
Update implements ecs.System interface
func (*RulesSystem) UpdateWithError ¶ added in v0.8.0
func (s *RulesSystem) UpdateWithError(dt float64) error
UpdateWithError implements System interface
type StorageParasiteSystem ¶
type StorageParasiteSystem struct {
// contains filtered or unexported fields
}
StorageParasiteSystem logs rocket state data to storage
func NewStorageParasiteSystem ¶
func NewStorageParasiteSystem(world *ecs.World, storage storage.StorageInterface, storeType storage.SimStorageType) *StorageParasiteSystem
NewStorageParasiteSystem creates a new StorageParasiteSystem
func (*StorageParasiteSystem) Add ¶
func (s *StorageParasiteSystem) Add(pe *states.PhysicsState)
Add adds entities to the system
func (*StorageParasiteSystem) Start ¶
func (s *StorageParasiteSystem) Start(dataChan chan *states.PhysicsState) error
Start the StorageParasiteSystem
func (*StorageParasiteSystem) Stop ¶
func (s *StorageParasiteSystem) Stop()
Stop the StorageParasiteSystem
func (*StorageParasiteSystem) Update ¶
func (s *StorageParasiteSystem) Update(dt float64) error
Update the StorageParasiteSystem