Skip to content

Commit

Permalink
update prefab, readme, 1.37
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacchan-VRC committed Nov 23, 2020
1 parent dd2eb4b commit 9ccf5c8
Show file tree
Hide file tree
Showing 7 changed files with 22,356 additions and 22,258 deletions.
Binary file modified AoALiftCurve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 18 additions & 5 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ https://twitter.com/Sacchan_VRC
Feel free to give feedback or ask questions
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Small Update 1.37
�Gun Lead Indicator smoother
�Missiles reverted to 1.35 because they were much more consistant
�Animator events for firing weapons
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Small Update 1.36
�Many small tweaks and bugfixes
Expand Down Expand Up @@ -148,6 +150,16 @@ Implemented (unrealistic) increased lift at higher speeds, you can now fall down
the two above combined should allow for more boring plane physics
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

!!!
in 1.37 EngineController:
High Aoa Min Control Pitch
High Aoa Min Control Yaw
have been renamed to:
High Pitch Aoa Min Control
High Yaw Aoa Min Control
You must remember and re-enter the values if updating
!!!

On first run there may be a compile problem that causes the plane to not function, try running it a second time before checking anything else.

If the VRChat world upload screen becomes unresponsive, it means you've messed up your Inputs page on your project settings.
Expand Down Expand Up @@ -594,7 +606,7 @@ How long it takes for the rotational inputs to reach max after you press and hol
Reversing Pitch Strength Multi (new in 1.2)
Reversing Yaw Strength Multi
Reversing Roll Strength Multi
When moving backwards through the air, your plane's rotational inputs can but multiplied. Does'nt effect axis with thrust vectoring enabled.
When moving backwards through the air, your plane's rotational input strengths can but multiplied. Doesn't effect any axis with thrust vectoring value above 0.

Pitch Down Str Multi
Allows you to set a seperate rotation speed for pulling down.
Expand All @@ -619,10 +631,11 @@ Aoa Curve Strength (new in 1.2)
Shape of the angle of attack lift curve.
See this to understand (the 2 in the input represents this value): https://www.wolframalpha.com/input/?i=-%28%281-x%29%5E2%29%2B1

High Aoa Mine Control Pitch (new in 1.2)
High Aoa Mine Control Yaw
High Pitch Aoa Min Control (new in 1.2)
High Yaw Aoa Min Control
The angle of attack curve is augmented by being MAX'd(taking the higher value) with a linear curve that is multiplied by this number.
Use this value to decide how much control the plane has when beyond it's 'max' angle of attack.
Use this value to decide how much control the plane has when beyond it's 'max' angle of attack. See AoALiftCurve.png
Pitch AoA and Yaw AoA are calculated seperately, and whichever value is lower is used.

High Pitch Aoa Min Lift (new in 1.2)
High Yaw Aoa Min Lift
Expand Down
8 changes: 4 additions & 4 deletions SF-1/Scripts/EngineController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public class EngineController : UdonSharpBehaviour
public float MaxAngleOfAttackPitch = 25f;
public float MaxAngleOfAttackYaw = 40f;
public float AoaCurveStrength = 2f;//1 = linear, >1 = convex, <1 = concave
public float HighAoaMinControlPitch = 0.2f;
public float HighAoaMinControlYaw = 0.2f;
public float HighPitchAoaMinControl = 0.2f;
public float HighYawAoaMinControl = 0.2f;
public float HighPitchAoaMinLift = 0.2f;
public float HighYawAoaMinLift = 0.2f;
public float TaxiRotationSpeed = 35f;
Expand Down Expand Up @@ -489,15 +489,15 @@ private void LateUpdate()
AoALiftPitch = -Mathf.Pow((1 - AoALiftPitch), AoaCurveStrength) + 1;//give it a curve

float AoALiftPitchMin = Mathf.Min(Mathf.Abs(AngleOfAttackPitch) / 90, Mathf.Abs(Mathf.Abs(AngleOfAttackPitch) - 180) / 90);//linear version to 90 for high aoa
AoALiftPitchMin = Mathf.Clamp((-AoALiftPitchMin + 1) * HighAoaMinControlPitch, 0, 1);
AoALiftPitchMin = Mathf.Clamp((-AoALiftPitchMin + 1) * HighPitchAoaMinControl, 0, 1);
AoALiftPitch = Mathf.Clamp(AoALiftPitch, AoALiftPitchMin, 1);

AoALiftYaw = Mathf.Min(Mathf.Abs(AngleOfAttackYaw) / MaxAngleOfAttackYaw, Mathf.Abs((Mathf.Abs(AngleOfAttackYaw) - 180)) / MaxAngleOfAttackYaw);
AoALiftYaw = -AoALiftYaw + 1;
AoALiftYaw = -Mathf.Pow((1 - AoALiftYaw), AoaCurveStrength) + 1;//give it a curve

float AoALiftYawMin = Mathf.Min(Mathf.Abs(AngleOfAttackYaw) / 90, Mathf.Abs(Mathf.Abs(AngleOfAttackYaw) - 180) / 90);//linear version to 90 for high aoa
AoALiftYawMin = Mathf.Clamp((-AoALiftPitchMin + 1) * HighAoaMinControlYaw, 0, 1);
AoALiftYawMin = Mathf.Clamp((-AoALiftPitchMin + 1) * HighYawAoaMinControl, 0, 1);
AoALiftYaw = Mathf.Clamp(AoALiftYaw, AoALiftYawMin, 1);

AngleOfAttack = Mathf.Max(AngleOfAttackPitch, AngleOfAttackYaw);
Expand Down
8 changes: 7 additions & 1 deletion SF-1/Scripts/SoundController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class SoundController : UdonSharpBehaviour
[System.NonSerializedAttribute] public float PlaneDistantVolume;
private float PlaneThrustPitch;
[System.NonSerializedAttribute] public float PlaneThrustVolume;
private float PlaneInsideInitialVolume;
private float LastFramePlaneIdlePitch;
private float LastFramePlaneThrustPitch;
private float LastFrameGunPitch;
Expand Down Expand Up @@ -147,6 +148,11 @@ private void Start()
BulletHitNull = (BulletHit.Length < 1) ? true : false;


if (!PlaneInsideNull)
{
PlaneInsideInitialVolume = PlaneInside.volume;
}

//used to make it so that changing the volume in unity will do something //set 0 to avoid ear destruction
if (!PlaneIdleNull)
{
Expand Down Expand Up @@ -357,7 +363,7 @@ private void Update()
if (!PlaneInsideNull)
{
PlaneInside.pitch = Mathf.Lerp(PlaneInside.pitch, (EngineControl.Throttle * .4f) + .8f, 2.25f * DeltaTime);
PlaneInside.volume = Mathf.Lerp(PlaneInside.volume, .4f, .72f * DeltaTime);
PlaneInside.volume = Mathf.Lerp(PlaneInside.volume, PlaneInsideInitialVolume, .72f * DeltaTime);
}
PlaneThrustVolume = Mathf.Lerp(PlaneThrustVolume, (EngineControl.Throttle * PlaneThrustInitialVolume) * InVehicleThrustVolumeFactor, 1.08f * DeltaTime);
}
Expand Down
Loading

0 comments on commit 9ccf5c8

Please sign in to comment.