Included missing engine files

This commit is contained in:
Иван Грачёв 2021-03-28 19:28:45 +05:00
parent 191b13f6b4
commit 3b287e5981
5 changed files with 9 additions and 13 deletions

View File

@ -1,3 +0,0 @@
NULL_ENTITY = entity(0)
CURRENT_PLAYER = player()
OWNER = owner()

View File

@ -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")

View File

@ -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

View File

@ -1,5 +1,5 @@
-- @include ./constants.txt
require("./constants.txt")
-- @include ../libs/constants.txt
require("../libs/constants.txt")
InputController = class("InputController")

View File

@ -1 +1,3 @@
NULL_ENTITY = entity(0)
NULL_ENTITY = entity(0)
CURRENT_PLAYER = player()
OWNER = owner()