Initial commit.
This commit is contained in:
25
elements/particle.go
Normal file
25
elements/particle.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user