Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more realistic aerodynamic effects for helicopters #45

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,9 @@ typedef struct {
*/
float center_to_ground_height;

/* Rate of heading change due to torque (radians/cycle) */
float torque_velocity;


/* Moveable parts */
sar_obj_part_struct **part;
Expand Down
18 changes: 17 additions & 1 deletion src/sfm.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
*/
#define SFMDefaultGravity 9.80665


/*
* Effective transactional lift speed value in m/s.
*/
#define SFMETLSpeed 12.35 // 24 knots

/*
* Transverse Flow Effect (TF) values in m/s.
*/
#define SFMTFStart 2.57 // 5 knots
#define SFMTFEnd 12.86 // 25 knots

/*
* Core structure:
*/
Expand All @@ -61,7 +73,11 @@ typedef struct {
SFMPositionStruct actual_wind_vector; /* In meters per Cycle */
unsigned long wind_flags;
SFMBoolean wind_enabled;
/* Callbacks, typical inputs are; realm pointer,

/* Realism setting */
SFMFlightPhysicsLevel flight_physics_level;

/* Callbacks, typical inputs are; realm pointer,
* model pointer, client data
*/

Expand Down
4 changes: 4 additions & 0 deletions src/sfmmodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ SFMBoolean SFMModelChangeValues(
{
model->wingspan = value->wingspan;
}
if(flags & SFMFlagRotorDiameter)
{
model->rotor_diameter = value->rotor_diameter;
}
if(flags & SFMFlagGearState)
{
model->gear_state = value->gear_state;
Expand Down
4 changes: 4 additions & 0 deletions src/sfmmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
#define SFMFlagStopped ((SFMFlags)1 << 41)
#define SFMFlagLength ((SFMFlags)1 << 42)
#define SFMFlagWingspan ((SFMFlags)1 << 43)
#define SFMFlagRotorDiameter ((SFMFlags)1 << 44)
#define SFMFlagSingleMainRotor ((SFMFlags)1 << 45)

/*
* Flight model types:
Expand Down Expand Up @@ -148,6 +150,7 @@ typedef struct {
double service_ceiling; /* Meters. */
double length; /* Meters */
double wingspan; /* Meters */
double rotor_diameter; /* Meters */
double belly_height; /* Undercarrage to center, meters. */
SFMBoolean gear_state; /* True when down. */
int gear_type; /* One of SFMGearType*. */
Expand All @@ -165,6 +168,7 @@ typedef struct {
* ground height,
* in meters.
*/
double torque_velocity; /* Radians/cycle internal */
double heading_control_coeff; /* -1.0 to 1.0. */
double pitch_control_coeff; /* -1.0 to 1.0. */
double bank_control_coeff; /* -1.0 to 1.0. */
Expand Down
Loading
Loading