Documentation ¶
Index ¶
- Variables
- func Add(out, add []float32)
- func Length(out []float32) float32
- func LengthSq(out []float32) float32
- func Lerp(start, end []float32, delta float32, out []float32)
- func Life(particle []float32, format *Format) float32
- func MultiplyScalar(out []float32, scalar float32)
- type Access
- type AccessConstant
- type AccessData
- type AccessDynamic
- type AccessLerp
- type Attribute
- type AttributeFormat
- type BurstEmitter
- type BurstEmitterType
- type Data
- type Dynamic
- type Emitter
- type EmitterType
- type Format
- func (pf Format) Access(attr Attribute) Access
- func (pf *Format) Add(attr AttributeFormat) *Format
- func (pf *Format) AddConstant(attr Attribute, constant ...float32) *Format
- func (pf *Format) AddData(attr Attribute) *Format
- func (pf *Format) AddDynamic(attr Attribute, dynamic Dynamic) *Format
- func (pf *Format) AddLerp(attr Attribute, data [][]float32, easing ease.Easing) *Format
- func (pf *Format) Get(attr Attribute, particle []float32) []float32
- func (pf *Format) HasData(attr Attribute) bool
- type Init
- type InitConstant
- type InitDynamic
- type InitList
- type InitNone
- type InitRandom
- type Inits
- type Modify
- type ModifyAdder
- type ModifyAge
- type ModifyLength
- type ModifyList
- type ModifyNone
- type ModifyScalar
- type Modifys
- type Number
- type Particle2
- type Particle3
- type ParticleRenderer
- type Point2
- type Point3
- type Range
- type Renderer
- type System
- type SystemType
- func (st *SystemType) Create() System
- func (st *SystemType) GetInitializer() Init
- func (st *SystemType) GetModifier() Modify
- func (st SystemType) Init(particle []float32, format *Format)
- func (st SystemType) Inits(attr Attribute) bool
- func (st SystemType) Modifies(attr Attribute) bool
- func (st SystemType) Modify(particle []float32, format *Format, dt float32)
- func (st *SystemType) Setup()
- type Vertex
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Age in seconds Age = NewAttribute(1) // Total lifespan in seconds Lifespan = NewAttribute(1) // A value that can be randomly generated and used in initializers and modifiers. // Useful for generating particles on a shape with a velocity relative to the shape. Seed = NewAttribute(1) // A 2d position Pos2 = NewAttribute(2) // A 2d velocity Vel2 = NewAttribute(2) // A dampening of 2d velocity Vel2Dampen = NewAttribute(1) // A 2d acceleration Acc2 = NewAttribute(2) // A dampening of 2d acceleration Acc2Dampen = NewAttribute(1) // A 3d position Pos3 = NewAttribute(3) // A 3d velocity Vel3 = NewAttribute(3) // A dampening of 3d velocity Vel3Dampen = NewAttribute(1) // A 3d acceleration Acc3 = NewAttribute(3) // A dampening of 3d acceleration Acc3Dampen = NewAttribute(1) // A uniform size (same width & height) Size = NewAttribute(1) // A uniform size velocity SizeVel = NewAttribute(1) // A dampening of uniform size velocity SizeVelDampen = NewAttribute(1) // A uniform size acceleration SizeAcc = NewAttribute(1) // A width & height Size2 = NewAttribute(2) // A width & height velocity SizeVel2 = NewAttribute(2) // A dampening of width & height velocity SizeVel2Dampen = NewAttribute(2) // A width & height acceleration SizeAcc2 = NewAttribute(2) // A uniform scale (both width & height) Scale = NewAttribute(1) // A uniform scale velocity ScaleVel = NewAttribute(1) // A dampening of uniform scale velocity ScaleVelDampen = NewAttribute(1) // A uniform scale acceleration ScaleAcc = NewAttribute(1) // A 2d scale Scale2 = NewAttribute(2) // A 2d scale velocity ScaleVel2 = NewAttribute(2) // A dampening of 2d scale velocity ScaleVel2Dampen = NewAttribute(1) // A 2d scale acceleration ScaleAcc2 = NewAttribute(2) // An angle/rotation in radians Angle = NewAttribute(1) // Angular velocity AngleVel = NewAttribute(1) // A dampening of angular velocity AngleVelDampen = NewAttribute(1) // Angular acceleration AngleAcc = NewAttribute(1) // Rotation anchor, {0,0}=top left, {1,1}=bottom right, {.5,.5}=center Anchor = NewAttribute(2) // An RGB color Shade = NewAttribute(3) // An RGBA color Color = NewAttribute(4) // The alpha Alpha = NewAttribute(1) // Which texture defined in the system format to use. Texture = NewAttribute(1) )
Functions ¶
func MultiplyScalar ¶
Types ¶
type AccessConstant ¶
type AccessConstant struct {
Constant []float32
}
type AccessData ¶
type AccessDynamic ¶
type AccessDynamic struct {
Dynamic Dynamic
}
type AccessLerp ¶
type Attribute ¶
type Attribute struct {
// contains filtered or unexported fields
}
func NewAttribute ¶
type AttributeFormat ¶
type BurstEmitter ¶
type BurstEmitter struct { Delay float32 Frequency Range[float32] Size Range[int] Count int Time float32 Next float32 Bursts int }
func (BurstEmitter) Done ¶
func (e BurstEmitter) Done() bool
func (BurstEmitter) Started ¶
func (e BurstEmitter) Started() bool
type BurstEmitterType ¶
type BurstEmitterType struct { Delay Range[float32] Frequency Range[float32] Size Range[int] Count Range[int] }
func (BurstEmitterType) Create ¶
func (et BurstEmitterType) Create(rnd *rand.Rand) BurstEmitter
type Data ¶
type EmitterType ¶
type EmitterType interface {
Create() Emitter
}
type Format ¶
type Format struct { Size int Attributes []AttributeFormat }
func (*Format) Add ¶
func (pf *Format) Add(attr AttributeFormat) *Format
func (*Format) AddConstant ¶
type InitConstant ¶
func (InitConstant) Init ¶
func (i InitConstant) Init(particle []float32, format *Format)
func (InitConstant) Inits ¶
func (i InitConstant) Inits(attr Attribute) bool
type InitDynamic ¶
func (InitDynamic) Init ¶
func (i InitDynamic) Init(particle []float32, format *Format)
func (InitDynamic) Inits ¶
func (i InitDynamic) Inits(attr Attribute) bool
type InitRandom ¶
func (InitRandom) Init ¶
func (i InitRandom) Init(particle []float32, format *Format)
func (InitRandom) Inits ¶
func (i InitRandom) Inits(attr Attribute) bool
type ModifyAdder ¶
func (ModifyAdder) Modifies ¶
func (m ModifyAdder) Modifies(attr Attribute) bool
type ModifyLength ¶
func (ModifyLength) Modifies ¶
func (m ModifyLength) Modifies(attr Attribute) bool
type ModifyList ¶
type ModifyList struct {
List []Modify
}
func (ModifyList) Modifies ¶
func (m ModifyList) Modifies(attr Attribute) bool
type ModifyNone ¶
type ModifyNone struct{}
func (ModifyNone) Modifies ¶
func (m ModifyNone) Modifies(attr Attribute) bool
type ModifyScalar ¶
func (ModifyScalar) Modifies ¶
func (m ModifyScalar) Modifies(attr Attribute) bool
type Number ¶
type Number interface { constraints.Integer | constraints.Float }
type Particle2 ¶
type Particle3 ¶
type ParticleRenderer ¶
type ParticleRenderer[P any] func(*P)
type System ¶
type SystemType ¶
type SystemType struct { Format *Format Initializers Inits Initializer Init Modifiers Modifys Modifier Modify Emitter EmitterType Random *rand.Rand Renderer Renderer MaxParticles int Trail bool Spread bool Ordered bool }
func (*SystemType) Create ¶
func (st *SystemType) Create() System
func (*SystemType) GetInitializer ¶
func (st *SystemType) GetInitializer() Init
func (*SystemType) GetModifier ¶
func (st *SystemType) GetModifier() Modify
func (SystemType) Init ¶
func (st SystemType) Init(particle []float32, format *Format)
func (SystemType) Inits ¶
func (st SystemType) Inits(attr Attribute) bool
func (SystemType) Modifies ¶
func (st SystemType) Modifies(attr Attribute) bool
func (SystemType) Modify ¶
func (st SystemType) Modify(particle []float32, format *Format, dt float32)
func (*SystemType) Setup ¶
func (st *SystemType) Setup()
Click to show internal directories.
Click to hide internal directories.