| 12345678910111213141516171819202122232425262728293031 |
- // Copyright 2016 The G3N Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style
- // license that can be found in the LICENSE file.
- package physics
- import (
- "github.com/g3n/engine/math32"
- "github.com/g3n/engine/graphic"
- )
- // Particle represents a physics-driven particle.
- type Particle struct {
- Body
- mass float32
- radius float32
- position math32.Vector3
- velocity math32.Vector3
- //netForce math32.Vector3
- colliding bool
- }
- // NewParticle creates and returns a pointer to a new Particle.
- func NewParticle(igraphic graphic.IGraphic) *Particle {
- p := new(Particle)
- p.Graphic = igraphic.GetGraphic()
- p.mass = 1
- p.radius = 1
- return p
- }
|