toe fix
This commit is contained in:
parent
baa8ffd07a
commit
e441999c17
@ -39,7 +39,9 @@ local FrontWheelsConfig = table.merge(
|
|||||||
{
|
{
|
||||||
SteerLock = 33,
|
SteerLock = 33,
|
||||||
CustomWheel = {
|
CustomWheel = {
|
||||||
CasterAngle = 3
|
CasterAngle = 3,
|
||||||
|
CamberAngle = -3,
|
||||||
|
ToeAngle = 0.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -47,7 +49,11 @@ local FrontWheelsConfig = table.merge(
|
|||||||
local RearWheelsConfig = table.merge(
|
local RearWheelsConfig = table.merge(
|
||||||
table.copy(WheelConfig),
|
table.copy(WheelConfig),
|
||||||
{
|
{
|
||||||
HandbrakePower = 2200
|
HandbrakePower = 2200,
|
||||||
|
CustomWheel = {
|
||||||
|
CamberAngle = -1,
|
||||||
|
ToeAngle = 0.5
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -113,13 +119,13 @@ Vehicle:new({
|
|||||||
Name = 'WheelFL',
|
Name = 'WheelFL',
|
||||||
Type = POWERTRAIN_COMPONENT.Wheel,
|
Type = POWERTRAIN_COMPONENT.Wheel,
|
||||||
Input = 'AxleFront',
|
Input = 'AxleFront',
|
||||||
Config = table.merge(table.copy(FrontWheelsConfig), { Offset = 0, CustomWheel = { CamberAngle = -3, ToeAngle = 0.5 } })
|
Config = table.merge(table.copy(FrontWheelsConfig), { Offset = 0 })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name = 'WheelFR',
|
Name = 'WheelFR',
|
||||||
Type = POWERTRAIN_COMPONENT.Wheel,
|
Type = POWERTRAIN_COMPONENT.Wheel,
|
||||||
Input = 'AxleFront',
|
Input = 'AxleFront',
|
||||||
Config = table.merge(table.copy(FrontWheelsConfig), { Offset = 180, CustomWheel = { CamberAngle = -3, ToeAngle = 0.5 } })
|
Config = table.merge(table.copy(FrontWheelsConfig), { Offset = 180 })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name = 'AxleBack',
|
Name = 'AxleBack',
|
||||||
@ -155,12 +161,12 @@ Vehicle:new({
|
|||||||
Name = 'WheelRL',
|
Name = 'WheelRL',
|
||||||
Input = 'AxleBack',
|
Input = 'AxleBack',
|
||||||
Type = POWERTRAIN_COMPONENT.Wheel,
|
Type = POWERTRAIN_COMPONENT.Wheel,
|
||||||
Config = table.merge(table.copy(RearWheelsConfig), { Offset = 0, CustomWheel = { CamberAngle = -1, ToeAngle = 0.5 } })
|
Config = table.merge(table.copy(RearWheelsConfig), { Offset = 0 })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name = 'WheelRR',
|
Name = 'WheelRR',
|
||||||
Input = 'AxleBack',
|
Input = 'AxleBack',
|
||||||
Type = POWERTRAIN_COMPONENT.Wheel,
|
Type = POWERTRAIN_COMPONENT.Wheel,
|
||||||
Config = table.merge(table.copy(RearWheelsConfig), { Offset = 180, CustomWheel = { CamberAngle = -1, ToeAngle = 0.5 } })
|
Config = table.merge(table.copy(RearWheelsConfig), { Offset = 180 })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -21,7 +21,6 @@ function Wheel:initialize(vehicle, name, config)
|
|||||||
local font = render.createFont("Roboto", 256, 400, true)
|
local font = render.createFont("Roboto", 256, 400, true)
|
||||||
local mat = render.createMaterial('models/debug/debugwhite')
|
local mat = render.createMaterial('models/debug/debugwhite')
|
||||||
|
|
||||||
|
|
||||||
hook.add("PostDrawTranslucentRenderables", "DEBUG_RENDER_" .. self.name, function()
|
hook.add("PostDrawTranslucentRenderables", "DEBUG_RENDER_" .. self.name, function()
|
||||||
if next(self.DEBUG_DATA) == nil then return end
|
if next(self.DEBUG_DATA) == nil then return end
|
||||||
if not isValid(self.DEBUG_DATA.entity) then return end
|
if not isValid(self.DEBUG_DATA.entity) then return end
|
||||||
@ -67,7 +66,7 @@ function Wheel:initialize(vehicle, name, config)
|
|||||||
|
|
||||||
self.holo = self:createHolo(self.entity)
|
self.holo = self:createHolo(self.entity)
|
||||||
|
|
||||||
self.customWheel = CustomWheel:new(config.CustomWheel)
|
self.customWheel = CustomWheel:new(table.merge(table.copy(config.CustomWheel), { Direction = self.direction }))
|
||||||
|
|
||||||
hook.add('input', 'vehicle_wheel_update' .. self.name, function(name, value)
|
hook.add('input', 'vehicle_wheel_update' .. self.name, function(name, value)
|
||||||
if name == self.name then
|
if name == self.name then
|
||||||
|
|||||||
@ -12,6 +12,7 @@ local Wheel = class('Wheel')
|
|||||||
function Wheel:initialize(config)
|
function Wheel:initialize(config)
|
||||||
config = config or {}
|
config = config or {}
|
||||||
|
|
||||||
|
self.direction = config.Direction or 1
|
||||||
self.mass = config.Mass or 20
|
self.mass = config.Mass or 20
|
||||||
self.radius = config.Radius or 0.27
|
self.radius = config.Radius or 0.27
|
||||||
self.rollingResistance = config.RollingResistance or 20
|
self.rollingResistance = config.RollingResistance or 20
|
||||||
@ -19,7 +20,7 @@ function Wheel:initialize(config)
|
|||||||
self.slipCircleShape = config.SlipCircleShape or 1.05
|
self.slipCircleShape = config.SlipCircleShape or 1.05
|
||||||
self.casterAngle = math.rad(config.CasterAngle or 0)
|
self.casterAngle = math.rad(config.CasterAngle or 0)
|
||||||
self.camberAngle = math.rad(config.CamberAngle or 0)
|
self.camberAngle = math.rad(config.CamberAngle or 0)
|
||||||
self.toeAngle = math.rad(config.ToeAngle or 0)
|
self.toeAngle = math.rad(config.ToeAngle or 0) * -self.direction
|
||||||
|
|
||||||
self.forwardFriction = Friction:new(config.ForwardFriction)
|
self.forwardFriction = Friction:new(config.ForwardFriction)
|
||||||
self.sideFriction = Friction:new(config.SideFriction)
|
self.sideFriction = Friction:new(config.SideFriction)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user