fluid

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT, MIT Imports: 1 Imported by: 0

README

fluid

Package fluid is a viscoelastic fluid simulator ported from kotsoft/particle_based_viscoelastic_fluid. Out of fear of making a mistake, I made no effort to translate the original JavaScript into idiomatic Go.

Documentation

Index

Constants

View Source
const (
	FLUID_PADDING = 1.5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Material

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

func NewMaterial

func NewMaterial(name string, restDensity, stiffness, nearStiffness, kernelRadius number) Material

type Particle

type Particle struct {
	X number
	Y number
	// contains filtered or unexported fields
}

func NewParticle

func NewParticle(posX, posY, velX, velY number) Particle

type Simulator

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

func New

func New(width, height number, particles []Particle) *Simulator

func (*Simulator) Particles

func (s *Simulator) Particles() []Particle

func (*Simulator) Update

func (s *Simulator) Update(dt float64)

Jump to

Keyboard shortcuts

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