Class: KerbalDyn::Body
- Inherits:
-
Object
- Object
- KerbalDyn::Body
- Defined in:
- lib/kerbaldyn/body.rb
Overview
The superclass for all Planetoid and Satellite instances.
Direct Known Subclasses
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
-
#name ⇒ Object
The name of the body.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Body
constructor
Create a body with the given name and options.
Methods included from Mixin::ParameterAttributes
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, ={}) @name = name (, DEFAULT_OPTIONS) end |
Instance Attribute Details
#name ⇒ Object
The name of the body.
39 40 41 |
# File 'lib/kerbaldyn/body.rb', line 39 def name @name end |
Class Method Details
.test_particle ⇒ Object
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 |