Fixed target values bug

This commit is contained in:
Иван Грачёв
2021-09-19 19:51:10 +05:00
parent 8dc9689601
commit d5bbad6f1d
3 changed files with 136 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
Slave = class('Slave')
function Slave:initialize(options)
options = options or {}
self.entity = options.Entity
self.base = options.Base
self.camber = options.Camber
self.caster = options.Caster
self.ackermann = options.Ackermann
self.isLeft = options.IsLeft
end
function Slave:rotate(ang)
if self.entity:isFrozen() == false then
self.entity:setFrozen(1)
end
local angle = Angle(0, ang, 0)
local transformedAngle = self.base:localToWorldAngles(angle)
self.entity:setAngles(transformedAngle)
-- rotate slave here
end