Rotation is far too buggy

This commit is contained in:
Ciaran Gultnieks 2014-03-05 17:57:06 +00:00
parent 9fd255edf3
commit 0886cc41a9

View File

@ -217,22 +217,7 @@ function heli:on_step(dtime)
--Set speed to entity
self.object:setvelocity({x=self.vx, y=self.vy,z=self.vz})
--Model rotation
--[[if self.driver then
self.model:set_attach(self.object,"Root",
{x=-(self.driver:getpos().x-self.object:getpos().x)*dtime,
y=-(self.driver:getpos().z-self.object:getpos().z)*dtime,
z=-(self.driver:getpos().y-self.object:getpos().y)*dtime}, {
x=-90+self.vz*5*math.cos(self.yaw)-self.vx*5*math.sin(self.yaw),
y=0-self.vz*5*math.sin(self.yaw)-self.vx*5*math.cos(self.yaw),
z=self.yaw*57})
else]]--
if self.model then
self.model:set_attach(self.object,"Root", {x=0,y=0,z=0}, {
x=-90+self.vz*4*math.cos(self.yaw)-self.vx*4*math.sin(self.yaw),
y=0-self.vz*4*math.sin(self.yaw)-self.vx*4*math.cos(self.yaw),
z=self.yaw*57})
end
end
--