physics

package
v0.0.0-...-5a5d905 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Simulation

type Simulation struct {
	Fluid   []*Unit
	Metrics *metrics.Metrics
	Config  *config.Config
	IsPause bool
}

func NewSimulation

func NewSimulation(config *config.Config) (*Simulation, error)

func (*Simulation) NewFluidAtPosition

func (s *Simulation) NewFluidAtPosition(position rl.Vector2)

func (*Simulation) NewFluidWithVelocity

func (s *Simulation) NewFluidWithVelocity(position rl.Vector2)

func (*Simulation) Reset

func (s *Simulation) Reset()

func (*Simulation) Update

func (s *Simulation) Update() error

func (*Simulation) UpdateWithVerletIntegration

func (s *Simulation) UpdateWithVerletIntegration() error

type Unit

type Unit struct {
	Id               uuid.UUID
	Position         rl.Vector2
	PreviousPosition rl.Vector2
	Acceleration     rl.Vector2
	Elasticity       float32
	Radius           float32
	Mass             float32
	Color            color.RGBA
}

func NewUnitWithProperties

func NewUnitWithProperties(cfg *config.Config) *Unit

func (*Unit) GetVelocityWithVerlet

func (u *Unit) GetVelocityWithVerlet() rl.Vector2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL