![]() |
WarpTwin
Documentation for WarpTwin models and classes.
|
/******************************************************************************
* Copyright (c) ATTX INC 2025. All Rights Reserved.
*
* This software and associated documentation (the "Software") are the
* proprietary and confidential information of ATTX INC. The Software is
* furnished under a license agreement between ATTX and the user organization
* and may be used or copied only in accordance with the terms of the agreement.
* Refer to 'license/attx_license.adoc' for standard license terms.
*
* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
* transmitted in any form or by any means, for any purpose, without the express
* written permission of ATTX INC.
******************************************************************************/
/*
Point mass gravity model header file
Author: Alex Reynolds
*/
/*
Metadata for MS GUI:
imdata = {"exclude" : True}
*/
#ifndef MODELS_ENVIRONMENT_POINT_MASS_GRAVITY_MODEL
#define MODELS_ENVIRONMENT_POINT_MASS_GRAVITY_MODEL
#include "simulation/Model.h"
#include "frames/Frame.h"
#include "frames/Node.h"
#include "frames/frameutils.h"
#include "constants/planetdefaults.h"
namespace warptwin {
/**
* @brief Point mass gravity model
*
* This model generates forces acting on a body under the influence of a
* simple point mass gravity field.
*/
MODEL(PointMassGravityModel)
public:
// TODO: Replace need for mass with direct acceleration calculation when
// body accel methods are implemented
// Model params
// NAME TYPE DEFAULT VALUE
START_PARAMS
/** This is the gravitational parameter of our parent planet. Defaults to
* Earth's gravitational parameter for ease of use */
SIGNAL(mu, double, warpos::earth_wgs84.mu)
/** This is the mass of the body, which will be multiplied by our force
* to get the force calculation... TODO to replace this with accel methods */
SIGNAL(body_mass, double, 1.0)
END_PARAMS
// Model inputs
// NAME TYPE DEFAULT VALUE
START_INPUTS
/** The position of the object body in the reference frame f */
SIGNAL(pos_body__f, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
END_INPUTS
// Model outputs
// NAME TYPE DEFAULT VALUE
START_OUTPUTS
/** This is the acceleration due to gravity calculated in the same reference frame as pos_body__f */
SIGNAL(grav_force__f, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
END_OUTPUTS
protected:
int16 execute() override;
// Temporary vectors and variables to carry out our calculations
double _r;
double _multiplier;
CartesianVector3 _grav_force__planet;
};
}
#endif