particles

package
v0.0.0-...-f053a90 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// contains filtered or unexported fields
}

Conf represents the configuration structure of a particle system

func NewConf

func NewConf(
	continious bool,
	pLifespan, maxRetard, pushDurr int,
	pushMag float64,
	location, container *vectors.Vector) *Conf

NewConf creates a configuration object for a particle system

type Particle

type Particle struct {
	// contains filtered or unexported fields
}

Particle keeps vectors.Mover and adds a lifespan property

func NewParticle

func NewParticle(mover *vectors.Mover, conf *Conf) *Particle

NewParticle creates an object of type Particle (constructor)

func (*Particle) Reset

func (p *Particle) Reset(lifespan int)

Reset a particle to its initial state

type ParticleSystem

type ParticleSystem struct {
	// contains filtered or unexported fields
}

ParticleSystem describes a set a of particles

func NewParticleSystem

func NewParticleSystem(objs interface{}, conf *Conf) *ParticleSystem

NewParticleSystem creates an object of type ParticleSystem (constructor)

func (*ParticleSystem) SetMasses

func (ps *ParticleSystem) SetMasses(masses []float64) error

SetMasses adds mass to every particle in the system

func (*ParticleSystem) UpdateSystem

func (ps *ParticleSystem) UpdateSystem(update func(p *Particle))

UpdateSystem is a genetic method for updating particles in the system

func (*ParticleSystem) UpdateSystemSdl2

func (ps *ParticleSystem) UpdateSystemSdl2(updateSdlObj func(obj interface{}))

UpdateSystemSdl2 execures UpdateSdl2 on every mover/particle

Jump to

Keyboard shortcuts

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