Class: SFML::ParticleSystem::Particle
- Inherits:
-
Struct
- Object
- Struct
- SFML::ParticleSystem::Particle
- Defined in:
- lib/sfml/graphics/particle_system.rb
Overview
A single particle. Plain Struct so allocations stay cheap;
mutated in-place from #update.
Instance Attribute Summary collapse
-
#a ⇒ Object
Returns the value of attribute a.
-
#age ⇒ Object
Returns the value of attribute age.
-
#b ⇒ Object
Returns the value of attribute b.
-
#g ⇒ Object
Returns the value of attribute g.
-
#lifetime ⇒ Object
Returns the value of attribute lifetime.
-
#r ⇒ Object
Returns the value of attribute r.
-
#size ⇒ Object
Returns the value of attribute size.
-
#vx ⇒ Object
Returns the value of attribute vx.
-
#vy ⇒ Object
Returns the value of attribute vy.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#alive? ⇒ Boolean
trueif alive. -
#normalized_age ⇒ Object
Returns the normalized age.
Instance Attribute Details
#a ⇒ Object
Returns the value of attribute a
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def a @a end |
#age ⇒ Object
Returns the value of attribute age
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def age @age end |
#b ⇒ Object
Returns the value of attribute b
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def b @b end |
#g ⇒ Object
Returns the value of attribute g
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def g @g end |
#lifetime ⇒ Object
Returns the value of attribute lifetime
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def lifetime @lifetime end |
#r ⇒ Object
Returns the value of attribute r
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def r @r end |
#size ⇒ Object
Returns the value of attribute size
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def size @size end |
#vx ⇒ Object
Returns the value of attribute vx
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def vx @vx end |
#vy ⇒ Object
Returns the value of attribute vy
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def vy @vy end |
#x ⇒ Object
Returns the value of attribute x
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def x @x end |
#y ⇒ Object
Returns the value of attribute y
41 42 43 |
# File 'lib/sfml/graphics/particle_system.rb', line 41 def y @y end |
Instance Method Details
#alive? ⇒ Boolean
true if alive.
49 50 |
# File 'lib/sfml/graphics/particle_system.rb', line 49 def alive? = age < lifetime # Returns the normalized age. |
#normalized_age ⇒ Object
Returns the normalized age.
51 |
# File 'lib/sfml/graphics/particle_system.rb', line 51 def normalized_age = age / lifetime |