class KerbalDyn::Body

The superclass for all Planetoid and Satellite instances.

Constants

DEFAULT_OPTIONS

Options default. (Unlisted options will be nil)

TEST_PARTICLE

Attributes

name[RW]

The name of the body.

Public Class Methods

new(name, options={}) click to toggle source

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.

# File lib/kerbaldyn/body.rb, line 24
def initialize(name, options={})
  @name = name
  process_options(options, DEFAULT_OPTIONS)
end
test_particle() click to toggle source
# 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

Public Instance Methods

name=(name) click to toggle source

Sets the name of the body.

# File lib/kerbaldyn/body.rb, line 42
def name=(name)
  @name = name && name.to_s
end