Class GravityInterface#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class GravityInterface : public Karana::Core::Base#

Common GravityInterface used for computing gravity with various methods.

Subclassed by Karana::Models::PointMassGravity, Karana::Models::UniformGravity

Public Functions

GravityInterface(std::string_view name)#

GravityInterface 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 GravityInterface.

virtual bool isReady() const override#

Used to ensure the params are ready.

Returns:

true if the params are ready, `false otherwise.

virtual void computeGravity(const km::Ktime t, const OutputUpdateType &output_update_type) = 0#

Compute the acceleration due to gravity and set its value in the GravityOutput.

Parameters:
  • t – The time this acceleration was calculated at.

  • output_update_type – The type of update that updated the gravity.

const GravityOutput &getGravity() const#

Get the GravityOutput data.

Returns:

The GravityOutput data.

void setGravity(const km::Vec3 &g, const km::Ktime t, const OutputUpdateType &output_update_type)#

Set the GravityOutput data.

Parameters:
  • g – The acceleration due to gravity.

  • t – The time this acceleration was calculated at.

  • output_update_type – The type of update that updated the gravity.

Protected Attributes

GravityOutput _g#

The output of the most recent gravity calculation.