AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
AirControl.AC_Airplane_GroundEffect Class Reference
Inheritance diagram for AirControl.AC_Airplane_GroundEffect:
Collaboration diagram for AirControl.AC_Airplane_GroundEffect:

Protected Member Functions

virtual void HandleGroundEffect ()
 Creates the Ground effect - https://en.wikipedia.org/wiki/Ground_effect_(aerodynamics) More...
 

Detailed Description

Definition at line 7 of file AC_Airplane_GroundEffect.cs.

Member Function Documentation

◆ HandleGroundEffect()

virtual void AirControl.AC_Airplane_GroundEffect.HandleGroundEffect ( )
inlineprotectedvirtual

Creates the Ground effect - https://en.wikipedia.org/wiki/Ground_effect_(aerodynamics)

Definition at line 45 of file AC_Airplane_GroundEffect.cs.

46  {
47  RaycastHit hit;
48  if(Physics.Raycast(transform.position, Vector3.down, out hit))
49  {
50  if(hit.distance < groundDistance && hit.transform.tag=="Ground")
51  {
52 
53  float currentSpeed = rb.velocity.magnitude;
54  float normalizedSpeed = currentSpeed/maxSpeed;
55  normalizedSpeed = Mathf.Clamp01(normalizedSpeed);
56 
57  float distance = groundDistance - hit.distance;
58  float finalForce = liftForce *distance *normalizedSpeed;
59  rb.AddForce(Vector3.up*finalForce);
60  }
61  }
62 
63  }

The documentation for this class was generated from the following file: