This commit is contained in:
Nikita Kruglickiy 2023-05-22 21:27:08 +03:00
parent aa596db8b7
commit 97403a249a
2 changed files with 8 additions and 6 deletions

View File

@ -9,7 +9,7 @@ local Vehicle, POWERTRAIN_COMPONENT = unpack(require('/koptilnya/engine_remaster
local WheelConfig = {
BrakePower = 800,
CustomWheel = {},
Offset = 90,
Offset = 180,
Model = 'models/sprops/trans/wheel_d/t_wheel25.mdl'
}
local FrontWheelsConfig = table.merge(table.copy(WheelConfig), { SteerLock = 10 })

View File

@ -32,7 +32,7 @@ function Wheel:initialize(vehicle, name, config)
self.entity = config.Entity or NULL_ENTITY
self.holo = self:createHolo(self.entity, config.Model or 'models/sprops/trans/wheel_b/t_wheel15.mdl', self.offset)
self.holo = self:createHolo(self.entity)
self.customWheel = CustomWheel:new(config.CustomWheel)
@ -62,14 +62,16 @@ function Wheel:getEntityRadius()
return self.entity:getModelRadius() * UNITS_TO_METERS
end
function Wheel:createHolo(entity, model, offset)
function Wheel:createHolo(entity)
if not isValid(entity) then
return NULL_ENTITY
end
print(model)
local holo = holograms.create(entity:getPos(), entity:getAngles() + Angle(0, offset, 0), model)
local holo = holograms.create(
entity:getPos(),
entity:getAngles() + Angle(0, self.offset, 0),
self.CONFIG.Model or 'models/sprops/trans/wheel_b/t_wheel15.mdl'
)
holo:setParent(entity)
entity:setColor(Color(0,0,0,0))