Included missing engine files
This commit is contained in:
parent
191b13f6b4
commit
3b287e5981
@ -1,3 +0,0 @@
|
||||
NULL_ENTITY = entity(0)
|
||||
CURRENT_PLAYER = player()
|
||||
OWNER = owner()
|
||||
@ -1,11 +1,11 @@
|
||||
-- @name Engine
|
||||
-- @author DarkSupah, Opti1337, .hemp
|
||||
-- @shared
|
||||
-- @include ./constants.txt
|
||||
-- @include ../libs/constants.txt
|
||||
-- @include ./engine.txt
|
||||
-- @include ./gearbox.txt
|
||||
-- @include ./input.txt
|
||||
require("./constants.txt")
|
||||
require("../libs/constants.txt")
|
||||
require("./engine.txt")
|
||||
require("./gearbox.txt")
|
||||
require("./input.txt")
|
||||
|
||||
@ -83,7 +83,7 @@ if SERVER then
|
||||
local frac = (RPMfrac * tableCount) % 1
|
||||
local minActiveThrottle = self.config.idleRPM / self.config.maxRPM
|
||||
|
||||
local value = math.max(minActiveThrottle, self.throttle) * math.lerp(frac, lerpFromVal, lerpToVal) * self.peakTq
|
||||
local value = math.lerp(frac, lerpFromVal, lerpToVal) * self.peakTq
|
||||
|
||||
local overdrive = math.clamp(1 - self.gearboxRPM / self.desiredRPM, -1, 0)
|
||||
|
||||
@ -91,11 +91,8 @@ if SERVER then
|
||||
local maxRPM = self.config.maxRPM
|
||||
local brakeTorqueCoeff = self.config.brakeTorqueCoeff
|
||||
|
||||
local brakeTorque = -value * math.max(1 - self.throttle, idleRPM / maxRPM, -overdrive) *
|
||||
(self.gearboxRPM / maxRPM) * brakeTorqueCoeff
|
||||
|
||||
local RPMLimiter = math.clamp(1 - self.throttle * (self.gearboxRPM / self.desiredRPM), self.throttle, 1)
|
||||
local netTq = value * math.max(self.throttle, idleRPM / maxRPM) * RPMLimiter + brakeTorque
|
||||
local netTq = value * math.max(self.throttle, idleRPM / maxRPM) * RPMLimiter
|
||||
|
||||
self.torque = netTq
|
||||
end
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
-- @include ./constants.txt
|
||||
require("./constants.txt")
|
||||
-- @include ../libs/constants.txt
|
||||
require("../libs/constants.txt")
|
||||
|
||||
InputController = class("InputController")
|
||||
|
||||
|
||||
@ -1 +1,3 @@
|
||||
NULL_ENTITY = entity(0)
|
||||
CURRENT_PLAYER = player()
|
||||
OWNER = owner()
|
||||
Loading…
x
Reference in New Issue
Block a user