2022-07-29 22:06:02 +03:00

20 lines
449 B
Plaintext

--@include ./constants.txt
require('./constants.txt')
function getLocalVelocity(entity)
if not entity:isValid() then
return
end
return entity:worldToLocal(entity:getVelocity() + entity:getPos())
end
function calculateWheelInertia(entity)
if not isValid(entity) then
return Vector(0)
end
return entity:getInertia():setY(0.5 * entity:getMass() * math.pow(entity:getModelRadius() * UNITS_TO_METERS, 2))
end