Class: BulldogPhysics::Particles::Generators::ParticleForceGenerator
- Inherits:
-
Object
- Object
- BulldogPhysics::Particles::Generators::ParticleForceGenerator
- Defined in:
- lib/Particles/particle_force_generator.rb
Overview
A force generator can be asked to add a force to one or more particles.
Direct Known Subclasses
ParticleAnchoredSpring, ParticleDrag, ParticleGravity, ParticleSpring
Instance Attribute Summary collapse
-
#registrations ⇒ Object
Returns the value of attribute registrations.
Instance Method Summary collapse
-
#initialize ⇒ ParticleForceGenerator
constructor
A new instance of ParticleForceGenerator.
-
#update_force(particle, duration) ⇒ Object
Overload this in implementations of the interface to calculate and update the force applied to the given particle.
Constructor Details
#initialize ⇒ ParticleForceGenerator
Returns a new instance of ParticleForceGenerator.
10 11 12 |
# File 'lib/Particles/particle_force_generator.rb', line 10 def initialize @registrations = Array.new # array of ParticleForceRegistration(s) end |
Instance Attribute Details
#registrations ⇒ Object
Returns the value of attribute registrations.
8 9 10 |
# File 'lib/Particles/particle_force_generator.rb', line 8 def registrations @registrations end |
Instance Method Details
#update_force(particle, duration) ⇒ Object
Overload this in implementations of the interface to calculate and update the force applied to the given particle.
16 17 |
# File 'lib/Particles/particle_force_generator.rb', line 16 def update_force(particle, duration) end |