Documentation
¶
Index ¶
- func CalculateInertia(entity *states.PhysicsState) float64
- type AerodynamicSystem
- func (a *AerodynamicSystem) Add(as *states.PhysicsState)
- func (a *AerodynamicSystem) CalculateAerodynamicMoment(entity states.PhysicsState) types.Vector3
- func (a *AerodynamicSystem) CalculateDrag(entity states.PhysicsState) types.Vector3
- func (a *AerodynamicSystem) GetAirDensity(altitude float64) float64
- func (a *AerodynamicSystem) GetSpeedOfSound(altitude float64) float64
- func (a *AerodynamicSystem) Update(dt float64) error
- type Event
- type EventLog
- type LaunchRail
- type LaunchRailSystem
- type LogParasiteSystem
- type ParasiteSystem
- type PhysicsSystem
- type RulesSystem
- 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 ¶
NewAerodynamicSystem creates a new AerodynamicSystem
func (*AerodynamicSystem) Add ¶
func (a *AerodynamicSystem) Add(as *states.PhysicsState)
Add adds entities to the system
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 now handles atmospheric effects and Mach number
func (*AerodynamicSystem) GetAirDensity ¶
func (a *AerodynamicSystem) GetAirDensity(altitude float64) float64
GetAirDensity returns the air density at a given altitude
func (*AerodynamicSystem) GetSpeedOfSound ¶
func (a *AerodynamicSystem) GetSpeedOfSound(altitude float64) float64
calculateSoundSpeed calculates the speed of sound at a given temperature
func (*AerodynamicSystem) Update ¶
func (a *AerodynamicSystem) Update(dt float64) error
Update implements parallel force calculation and application
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, angle, orientation float64) *LaunchRailSystem
Add adds a physics entity to the launch rail system
func (*LaunchRailSystem) Add ¶
func (s *LaunchRailSystem) Add(pe *states.PhysicsState)
Add adds entities to the 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) 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 float64) error
Update applies launch rail constraints to entities
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 float64) error
Update the LogParasiteSystem
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) *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 float64) error
Update applies forces to entities
type RulesSystem ¶
type RulesSystem struct {
// contains filtered or unexported fields
}
RulesSystem enforces rules of flight
func NewRulesSystem ¶
func NewRulesSystem(world *ecs.World, config *config.Engine) *RulesSystem
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() Event
GetLastEvent returns the last event detected by the rules system
func (*RulesSystem) ProcessRules ¶
func (s *RulesSystem) ProcessRules(entity *states.PhysicsState) Event
func (*RulesSystem) Update ¶
func (s *RulesSystem) Update(dt float64) error
Update applies rules of flight to entities
type StorageParasiteSystem ¶
type StorageParasiteSystem struct {
// contains filtered or unexported fields
}
StorageParasiteSystem logs rocket state data to storage
func NewStorageParasiteSystem ¶
func NewStorageParasiteSystem(world *ecs.World, store 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