Class Gravity#

Inheritance Relationships#

Base Type#

Class Documentation#

class Gravity : public Karana::Models::KModel<Gravity>#

Apply uniform gravitational acceleration to each body in the provided multibody.

Public Functions

Gravity(std::string_view name, const kc::ks_ptr<kd::ModelManager> &mm, const kc::ks_ptr<GravityInterface> gravity_interface, const kc::ks_ptr<kd::SubTree> &st)#

Gravity constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.

Parameters:
  • name – The name of the model.

  • mm – The ModelManager to register this model with.

  • gravity_interface – The GravityInterface used to compute gravity.

  • st – The SubTree to apply uniform gravity to.

~Gravity()#

Destructor for Gravity.

void preDeriv(const km::Ktime &t, const km::Vec &x)#

Calculate and apply the aerodynamic force.

Parameters:
  • t – Current time.

  • x – Current state. Not used.

const kc::ks_ptr<GravityInterface> &getGravityInterface() const#

Get the gravity interface used by this KModel.

Returns:

The gravity interface used by this KModel.

virtual bool isReady() const override#

Used to ensure this Gravity model is ready.

Returns:

true if this is ready, `false otherwise.

std::string dumpString(std::string_view prefix = "", const Base::DumpOptions *options = nullptr) const override#

Return a formatted string containing information about this object.

Parameters:
  • prefix – String prefix to use for formatting.

  • options – Dump options (if null, defaults will be used).

Returns:

A string representation of the object.

Public Static Functions

static kc::ks_ptr<Gravity> create(std::string_view name, const kc::ks_ptr<kd::ModelManager> &mm, const kc::ks_ptr<GravityInterface> gravity_interface, const kc::ks_ptr<kd::SubTree> &st)#

Constructor.

Parameters:
  • name – The name of the model.

  • mm – The ModelManager to register this model with.

  • gravity_interface – The GravityInterface used to compute gravity.

  • st – The SubTree to apply uniform gravity to.

Returns:

A ks_ptr to the newly created instance of the Gravity model.