Skip to content

Commit

Permalink
[stable] 0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
ravo10 committed Jun 14, 2021
1 parent c0038b9 commit 837eb64
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 81 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

### You can find the stand alone tool under: **Weapons => Tools => Fin OS Tool**

**Made from scratch, and based on the modern lift equation: https://wright.nasa.gov/airplane/lifteq.html**
**Made from scratch, and based on the modern lift/drag equations: https://wright.nasa.gov/airplane/lifteq.html & ( https://www.grc.nasa.gov/www/k-12/airplane/sized.html, https://www.grc.nasa.gov/www/k-12/airplane/dragco.html, https://www.grc.nasa.gov/www/k-12/airplane/drageq.html, https://www.grc.nasa.gov/www/k-12/airplane/presar.html )**


### Quick start:
**Left-Click** to add two vector points for the forward direction vector. (this should normally be in the direction the creations forward reference is) After that, create the area of the fin. Done. You can also add a flap if you want with **( IN_USE + Left-Click )** on a fin and prop. Reload will remove fin and flap, or flap. **Right-Click** will track selected fin (real-time physics). **( IN_USE + Sroll Wheel )** will increase/decrease the scalar value of the fin you are looking at. The server admin can adjust server settings with the console variables underneath.

### How to use:
* You can find the stand alone tool under: ***Weapons => Tools => Fin OS Tool***
Expand All @@ -17,7 +21,7 @@
* **( IN_USE + MIDDLE_MOUSE ) to open** the client settings panel

### How it works:
* It uses **real physics** to calculate lift from the center of the prop, and real life formula for calculating lift: *Force[LIFT] = .5 * rho[AIR] * Velocity[m/s]^2 * Area[m^2] * C[L - angle of attack]*
* It uses **real physics** to calculate lift from the center of the prop, and real life formula for calculating lift: *Force[LIFT] = .5 * rho[AIR] * Velocity[m/s]^2 * Area[m^2] * C[L - angle of attack]* - also about uses the same logic for the drag

### Features:
* Supports duplication
Expand All @@ -28,12 +32,14 @@
* Supports Wiremod input/output ( *Physics => FIN OS Tool* )

### Console Variables
*Server*
* ```finos_maxfin_os_ent ( def. = 20 ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Amount of Fin OS fin's possible for each Player to spawn ( only for multiplayer ).
* ```finos_rhodensistyfluidvalue ( def. = 1.29 ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Mass density ( rho ) that will be applied to Fin OS fin.
* ```finos_maxscalarvalue ( def. = 69 ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Maximum scalar value a player can apply to a Fin OS fin.
* ```finos_disablestrictmode ( def. = 0 ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Disables checking for angle of prop and crossing vector lines, if you just want to be joking around ( other servers might not accept the duplicate tho ).
* ```finos_disableprintchatmessages ( def. = 1 ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Disables printing messages in chat ( only legacy ).

*Client*
* ```finos_cl_enableHoverRingBall_fin ( def. = 1 ) [ FCVAR_ARCHIVE ]``` - Clientside. Activate or deactivate the markers for a fin.
* ```finos_cl_enableHoverRingBall_flap ( def. = 1 ) [ FCVAR_ARCHIVE ]``` - Clientside. Activate or deactivate the markers for a flap.
* ```finos_cl_enableAlignAngleHelpers ( def. = 1 ) [ FCVAR_ARCHIVE ]``` - Clientside. Activate or deactivate the "Correct Start Angle Helpers".
Expand All @@ -47,6 +53,9 @@
* ```finos_cl_gridColorB ( def. = 241 ) [ FCVAR_ARCHIVE ]``` - Clientside. Change the Blue channel for the grid color.

**WIND Settings:**
*Server*
* ```finos_wind_disableAllServerLimits ( def. = 0 ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Disables all wind limits set by server.

* ```finos_wind_maxForcePerSquareMeterAreaAllowed ( def. = 6000 => ( -6000 - 6000 ) ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Max. Allowed Wind Force Per. Square Meter of Area.
* ```finos_wind_minWindScaleAllowed ( def. = 0.1 ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Min. Allowed Wild Wind Scale.
* ```finos_wind_maxWindScaleAllowed ( def. = 6 ) [ FCVAR_PROTECTED, FCVAR_ARCHIVE ]``` - Max. Allowed Wild Wind Scale.
Expand Down
8 changes: 5 additions & 3 deletions lua/entities/fin_os_brain/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ function ENT:ApplyForceLiftToFinWing( entFinParentProp )
local timeDeltaTime = ( tonumber( self:GetVelocityTimeB() ) - tonumber( self:GetVelocityTimeA() ) )

-- 1 foot = 12 units = 0.3048 meter
local CURRENT_VELOCITY_UnitsSecond = ( ( vectorDeltaDistanceABLength_Units / timeDeltaTime ) / 3 ) -- The actual velocity in Units/s ( fraction by 3, to get it more realistic ( based on normal walking speed of humans 5 km/h ) )
local CURRENT_VELOCITY_MeterSecond = ( ( CURRENT_VELOCITY_UnitsSecond / 12 * 0.3048 ) ) -- The actual velocity in m/s
local CURRENT_VELOCITY_KmHour = ( CURRENT_VELOCITY_MeterSecond * 3.6 ) -- The actual velocity in km/h
local CURRENT_VELOCITY_UnitsSecond = ( ( vectorDeltaDistanceABLength_Units / timeDeltaTime ) / 3 ) -- The actual velocity in Units/s ( fraction by 3, to get it more realistic ( based on normal walking speed of humans 5 km/h ) )
local CURRENT_VELOCITY_MeterSecond = ( ( CURRENT_VELOCITY_UnitsSecond / 12 * 0.3048 ) ) -- The actual velocity in m/s
local CURRENT_VELOCITY_KmHour = ( CURRENT_VELOCITY_MeterSecond * 3.6 ) -- The actual velocity in km/h
local CURRENT_VELOCITY_MilesPerHour = ( CURRENT_VELOCITY_MeterSecond * 2.24 ) -- The actual velocity in mph
local CURRENT_VELOCITY_Knots = ( CURRENT_VELOCITY_KmHour * 1.852 ) -- The actual velocity in knots [1 knot = 1.85200 km/h]

local entPhysicsObject = entFinParentProp:GetPhysicsObject()

Expand Down Expand Up @@ -415,6 +416,7 @@ function ENT:ApplyForceLiftToFinWing( entFinParentProp )

FIN_FinBeingTracked = entBeingTracked,
FIN_AttackAngle_Pitch = FINATTACKANGLE,
FIN_VelocityKnots = CURRENT_VELOCITY_Knots,
FIN_VelocityKmH = CURRENT_VELOCITY_KmHour,
FIN_VelocityMpH = CURRENT_VELOCITY_MeterSecond,
FIN_VelocityMps = CURRENT_VELOCITY_MilesPerHour,
Expand Down
Loading

0 comments on commit 837eb64

Please sign in to comment.