26 lines
429 B
Go
26 lines
429 B
Go
|
|
package elements
|
||
|
|
|
||
|
|
import "fluids/gamedata"
|
||
|
|
|
||
|
|
type Particle struct {
|
||
|
|
Position gamedata.Vector
|
||
|
|
Velocity gamedata.Vector
|
||
|
|
Radius float64
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p Particle) GetDimensions() gamedata.Vector {
|
||
|
|
dim := gamedata.Vector{
|
||
|
|
X: p.Radius * 2,
|
||
|
|
Y: p.Radius * 2,
|
||
|
|
}
|
||
|
|
return dim
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p Particle) GetPosition() gamedata.Vector {
|
||
|
|
return p.Position
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *Particle) SetPosition(position gamedata.Vector) {
|
||
|
|
p.Position = position
|
||
|
|
}
|