Documentation ¶
Overview ¶
Package box2d demonstrates the use of the Go port of Box2D, a 2D physics engine for games.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SysB2Physics ¶
type SysB2Physics struct {
// contains filtered or unexported fields
}
SysB2Physics is a simple system that updates the Box2D world to perform a physics step.
func (*SysB2Physics) Finalize ¶
func (s *SysB2Physics) Finalize(world *ecs.World)
Finalize the system
func (*SysB2Physics) Initialize ¶
func (s *SysB2Physics) Initialize(world *ecs.World)
Initialize the system
type SysInitEntities ¶
SysInitEntities is a system to create Box2D bodies and associated ECS entities.
func (*SysInitEntities) Finalize ¶
func (s *SysInitEntities) Finalize(world *ecs.World)
Finalize the system
func (*SysInitEntities) Initialize ¶
func (s *SysInitEntities) Initialize(world *ecs.World)
Initialize the system
func (*SysInitEntities) Update ¶
func (s *SysInitEntities) Update(world *ecs.World)
Update the system
type SysPhysics ¶
type SysPhysics struct { MinFleeDistance float64 MaxFleeDistance float64 ForceScale float64 // contains filtered or unexported fields }
SysPhysics is a system that applies an impulse to all Box2D bodies that are within a certain distance to the mouse.
func (*SysPhysics) Initialize ¶
func (s *SysPhysics) Initialize(world *ecs.World)
Initialize the system
type UISysDrawEntities ¶
type UISysDrawEntities struct {
// contains filtered or unexported fields
}
UISysDrawEntities is a system to draw Box2D bodies on an [Image] resource.
func (*UISysDrawEntities) FinalizeUI ¶
func (s *UISysDrawEntities) FinalizeUI(world *ecs.World)
FinalizeUI the system
func (*UISysDrawEntities) InitializeUI ¶
func (s *UISysDrawEntities) InitializeUI(world *ecs.World)
InitializeUI the system
func (*UISysDrawEntities) PostUpdateUI ¶
func (s *UISysDrawEntities) PostUpdateUI(world *ecs.World)
PostUpdateUI the system
func (*UISysDrawEntities) UpdateUI ¶
func (s *UISysDrawEntities) UpdateUI(world *ecs.World)
UpdateUI the system
type UISysManagePause ¶
type UISysManagePause struct {
// contains filtered or unexported fields
}
UISysManagePause is a simple system that transfers the pause state from the common.PauseMouseListener resource to the model's model.Systems.
func (*UISysManagePause) FinalizeUI ¶
func (s *UISysManagePause) FinalizeUI(world *ecs.World)
FinalizeUI the system
func (*UISysManagePause) InitializeUI ¶
func (s *UISysManagePause) InitializeUI(world *ecs.World)
InitializeUI the system
func (*UISysManagePause) PostUpdateUI ¶
func (s *UISysManagePause) PostUpdateUI(world *ecs.World)
PostUpdateUI the system
func (*UISysManagePause) UpdateUI ¶
func (s *UISysManagePause) UpdateUI(world *ecs.World)
UpdateUI the system