Documentation
¶
Index ¶
- Constants
- type Bodytube
- func (b *Bodytube) GetDensity() float64
- func (b *Bodytube) GetMass() float64
- func (b *Bodytube) GetPlanformArea() float64
- func (b *Bodytube) GetSurfaceArea() float64
- func (b *Bodytube) GetVolume() float64
- func (b *Bodytube) String() string
- func (b *Bodytube) Type() string
- func (b *Bodytube) Update(dt float64) error
- type Motor
- func (m *Motor) GetElapsedTime() float64
- func (m *Motor) GetMass() float64
- func (m *Motor) GetPlanformArea() float64
- func (m *Motor) GetState() string
- func (m *Motor) GetThrust() float64
- func (m *Motor) IsCoasting() bool
- func (m *Motor) Reset()
- func (m *Motor) SetState(state string)
- func (m *Motor) String() string
- func (m *Motor) Type() string
- func (m *Motor) Update(dt float64) error
- type MotorFSM
- type Nosecone
- func (n *Nosecone) GetDensity() float64
- func (n *Nosecone) GetMass() float64
- func (n *Nosecone) GetPlanformArea() float64
- func (n *Nosecone) GetSurfaceArea() float64
- func (n *Nosecone) GetVolume() float64
- func (n *Nosecone) String() string
- func (n *Nosecone) Type() string
- func (n *Nosecone) Update(dt float64) error
- type Parachute
- func (p *Parachute) Deploy()
- func (p *Parachute) GetDensity() float64
- func (p *Parachute) GetMass() float64
- func (p *Parachute) GetPlanformArea() float64
- func (p *Parachute) GetSurfaceArea() float64
- func (p *Parachute) GetVolume() float64
- func (p *Parachute) IsDeployed() bool
- func (p *Parachute) String() string
- func (p *Parachute) Type() string
- func (p *Parachute) Update(dt float64) error
- type ParachuteTrigger
- type TrapezoidFinset
Constants ¶
const ( StateIdle = "idle" StateBurning = "burning" StateIgnited = "IGNITED" )
MotorState represents the states of the motor
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bodytube ¶
type Bodytube struct {
ID ecs.BasicEntity
Position types.Vector3
Radius float64
Length float64
Mass float64
Thickness float64
Density float64 // Material density
Finish string // Surface finish
MaterialName string // Name of material
MaterialType string // Type of material
CrossSection float64 // Cross-sectional area
SurfaceArea float64 // Total surface area
Volume float64 // Volume of material
}
Bodytube represents the bodytube entity of a rocket
func NewBodytube ¶
func NewBodytube(id ecs.BasicEntity, radius, length, mass, thickness float64) *Bodytube
NewBodytube creates a new bodytube instance
func NewBodytubeFromORK ¶
func NewBodytubeFromORK(id ecs.BasicEntity, orkData *openrocket.RocketDocument) (*Bodytube, error)
NewBodytubeFromORK creates a new bodytube instance from an ORK Document
func (*Bodytube) GetDensity ¶
GetDensity returns the material density of the bodytube
func (*Bodytube) GetPlanformArea ¶
GetPlanformArea returns the planform area of the bodytube
func (*Bodytube) GetSurfaceArea ¶
GetSurfaceArea returns the total surface area of the bodytube
type Motor ¶
type Motor struct {
ID ecs.BasicEntity
Position types.Vector3
Thrustcurve [][]float64
Mass float64
Props *thrustcurves.MotorData
FSM *MotorFSM
// contains filtered or unexported fields
}
Motor represents a rocket motor component
func NewMotor ¶
func NewMotor(id ecs.BasicEntity, md *thrustcurves.MotorData, logger logf.Logger) (*Motor, error)
NewMotor creates a new motor component from thrust curve data
func (*Motor) GetElapsedTime ¶
func (*Motor) GetPlanformArea ¶
func (*Motor) IsCoasting ¶
type MotorFSM ¶
MotorFSM represents the finite state machine for the motor
func NewMotorFSM ¶
NewMotorFSM creates a new FSM for the motor
type Nosecone ¶
type Nosecone struct {
ID ecs.BasicEntity
Position types.Vector3
Radius float64
Length float64
Mass float64
ShapeParameter float64
Thickness float64
Shape string
Finish string
MaterialName string
MaterialType string
Density float64
Volume float64
SurfaceArea float64
AftShoulderRadius float64
AftShoulderLength float64
AftShoulderCapped bool
ShapeClipped bool
IsFlipped bool
}
Nosecone represents the nosecone entity of a rocket
func NewNosecone ¶
func NewNosecone(id ecs.BasicEntity, radius, length, mass, shapeParameter float64) *Nosecone
NewNosecone creates a new nosecone instance
func NewNoseconeFromORK ¶
func NewNoseconeFromORK(id ecs.BasicEntity, orkData *openrocket.RocketDocument) *Nosecone
NewNoseconeFromORK creates a new nosecone instance from an ORK Document
func (*Nosecone) GetDensity ¶
GetDensity returns the material density
func (*Nosecone) GetPlanformArea ¶
GetPlanformArea returns the planform area of the nosecone
func (*Nosecone) GetSurfaceArea ¶
GetSurfaceArea returns the surface area of the nosecone
type Parachute ¶
type Parachute struct {
ID ecs.BasicEntity
Position types.Vector3
Diameter float64
DragCoefficient float64
Strands int
Area float64
Trigger ParachuteTrigger
Deployed bool
}
Parachute is a component that allows the entity to descend under drag and control its descent rate.
func NewParachute ¶
func NewParachute(id ecs.BasicEntity, diameter, dragCoefficient float64, strands int, trigger ParachuteTrigger) *Parachute
NewParachute creates a new parachute instance
func NewParachuteFromORK ¶
func NewParachuteFromORK(id ecs.BasicEntity, orkData *openrocket.RocketDocument) (*Parachute, error)
NewParachuteFromORK creates a new parachute instance from an ORK Document
func (*Parachute) GetDensity ¶
GetDensity returns the density of the Parachute
func (*Parachute) GetPlanformArea ¶
GetPlanformArea returns the planform area of the parachute
func (*Parachute) GetSurfaceArea ¶
GetSurfaceArea returns the surface area of the Parachute
func (*Parachute) IsDeployed ¶
IsDeployed returns whether the parachute is currently deployed
type ParachuteTrigger ¶
type ParachuteTrigger string
ParachuteTrigger represents the trigger configuration of the parachute
const ( // ParachuteTriggerNone represents no trigger ParachuteTriggerNone ParachuteTrigger = "none" // ParachuteTriggerApogee represents an apogee trigger ParachuteTriggerApogee ParachuteTrigger = "apogee" )
type TrapezoidFinset ¶
type TrapezoidFinset struct {
ecs.BasicEntity
RootChord float64
TipChord float64
Span float64
SweepAngle float64
Position types.Position
Mass float64
}
TrapezoidFinset represents a trapezoidal fin
func NewTrapezoidFinsetFromORK ¶
func NewTrapezoidFinsetFromORK(basic ecs.BasicEntity, ork *openrocket.RocketDocument) *TrapezoidFinset
NewTrapezoidFinsetFromORK creates a new TrapezoidFinset component from OpenRocket data
func (*TrapezoidFinset) GetMass ¶
func (f *TrapezoidFinset) GetMass() float64
GetMass returns the mass of the finset
func (*TrapezoidFinset) GetPlanformArea ¶
func (f *TrapezoidFinset) GetPlanformArea() float64
GetPlanformArea returns the planform area of the finset