Class: BulldogPhysics::Particles::Generators::ParticleForceGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/Particles/particle_force_generator.rb

Overview

A force generator can be asked to add a force to one or more particles.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParticleForceGenerator

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

#registrationsObject

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