Class PointMassGravity#
Defined in File GravityInterface.h
Inheritance Relationships#
Base Type#
public Karana::Models::GravityInterface(Class GravityInterface)
Class Documentation#
-
class PointMassGravity : public Karana::Models::GravityInterface#
A GravityInterface implementation for point-mass gravity.
Public Functions
-
PointMassGravity(std::string_view name, const kc::ks_ptr<kd::SubTree> &st, const kc::ks_ptr<kf::Frame> ¢ral_body)#
UniformGravity 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.
st – The SubTree to get the center of mass from.
central_body – The point mass central body applying the gravitational force
-
virtual void computeGravity(const km::Ktime t, const OutputUpdateType &output_update_type) override#
This is a no-op. It does not modify the value of g.
- Parameters:
t – The time this acceleration was calculated at.
output_update_type – The type of update that updated the gravity.
-
virtual bool isReady() const override#
Used to ensure the params are ready.
- Returns:
trueif the params are ready, `false otherwise.
-
std::array<kc::id_t, 2> getObjIds() const#
Get the IDs of the SubTree and central body used by this PointMassGravity.
- Returns:
The IDs of the SubTree and central body used by this PointMassGravity.
-
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 Members
-
double mu = km::notReadyNaN#
Gravitational constant (units: m^3/(kg s^2) )
Public Static Functions
-
static kc::ks_ptr<PointMassGravity> create(std::string_view name, const kc::ks_ptr<kd::SubTree> &st, const kc::ks_ptr<kf::Frame> ¢ral_body)#
Constructor.
- Parameters:
name – The name of the PointMassGravity interface.
st – The SubTree to get the center of mass from.
central_body – The point mass central body applying the gravitational force
- Returns:
A pointer to the newly created instance of PointMassGravity.
-
PointMassGravity(std::string_view name, const kc::ks_ptr<kd::SubTree> &st, const kc::ks_ptr<kf::Frame> ¢ral_body)#