Attempts to fix new vehicle system
This commit is contained in:
@@ -6,3 +6,4 @@ TICK_INTERVAL = game.getTickInterval()
|
||||
RAD_TO_RPM = 9.5493
|
||||
RPM_TO_RAD = 0.10472
|
||||
UNITS_PER_METER = 39.37
|
||||
UNITS_TO_METERS = 0.01905
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
--@include ./constants.txt
|
||||
|
||||
require('./constants.txt')
|
||||
|
||||
function getLocalVelocity(entity)
|
||||
if not entity:isValid() then
|
||||
return
|
||||
@@ -11,7 +15,5 @@ function calculateWheelInertia(entity)
|
||||
return Vector(0)
|
||||
end
|
||||
|
||||
local originalInertia = entity:getInertia()
|
||||
|
||||
return Vector(originalInertia)
|
||||
return entity:getInertia():setY(0.5 * entity:getMass() * math.pow(entity:getModelRadius() * UNITS_TO_METERS, 2))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user