Class: KerbalDyn::Body

Inherits:
Object
  • Object
show all
Includes:
Mixin::OptionsProcessor, Mixin::ParameterAttributes
Defined in:
lib/kerbaldyn/body.rb

Overview

The superclass for all Planetoid and Satellite instances.

Direct Known Subclasses

Planetoid

Constant Summary collapse

DEFAULT_OPTIONS =

Options default. (Unlisted options will be nil)

{
  :mass => 0.0,
  :bounding_sphere_radius => 0.0,
  :angular_velocity => 0.0
}
TEST_PARTICLE =
self.test_particle

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixin::ParameterAttributes

included

Constructor Details

#initialize(name, options = {}) ⇒ Body

Create a body with the given name and options.

The options are:

mass

The mass of the body.

bounding_sphere_radius

The bounding sphere radius.

angular_velocity

The angular velocity around the axis of rotation.



24
25
26
27
# File 'lib/kerbaldyn/body.rb', line 24

def initialize(name, options={})
  @name = name
  process_options(options, DEFAULT_OPTIONS)
end

Instance Attribute Details

#nameObject

The name of the body.



39
40
41
# File 'lib/kerbaldyn/body.rb', line 39

def name
  @name
end

Class Method Details

.test_particleObject



14
15
16
# File 'lib/kerbaldyn/body.rb', line 14

def self.test_particle
  return self.new("Test Particle", :mass => 0.0, :bounding_sphere_radius => 0.0)
end