mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
fix ailerons pos
This commit is contained in:
parent
f0c72e6e74
commit
91ac05ee71
1 changed files with 11 additions and 13 deletions
|
@ -317,6 +317,17 @@ function airutils.logic(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--adjust elevator pitch (3d model)
|
||||||
|
self.object:set_bone_position("elevator", self._elevator_pos, {x=-self._elevator_angle*2 - 90, y=0, z=0})
|
||||||
|
--adjust rudder
|
||||||
|
self.object:set_bone_position("rudder", self._rudder_pos, {x=0,y=self._rudder_angle,z=0})
|
||||||
|
--adjust ailerons
|
||||||
|
if self._aileron_r_pos and self._aileron_l_pos then
|
||||||
|
local ailerons = self._rudder_angle
|
||||||
|
if self._invert_ailerons then ailerons = ailerons * -1 end
|
||||||
|
self.object:set_bone_position("aileron.r", self._aileron_r_pos, {x=-ailerons - 90,y=0,z=0})
|
||||||
|
self.object:set_bone_position("aileron.l", self._aileron_l_pos, {x=ailerons - 90,y=0,z=0})
|
||||||
|
end
|
||||||
|
|
||||||
if (math.abs(velocity.x) < 0.1 and math.abs(velocity.z) < 0.1) and is_flying == false and is_attached == false and self._engine_running == false then
|
if (math.abs(velocity.x) < 0.1 and math.abs(velocity.z) < 0.1) and is_flying == false and is_attached == false and self._engine_running == false then
|
||||||
if self._ground_friction then
|
if self._ground_friction then
|
||||||
|
@ -591,19 +602,6 @@ function airutils.logic(self)
|
||||||
self._flap = false
|
self._flap = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--adjust elevator pitch (3d model)
|
|
||||||
self.object:set_bone_position("elevator", self._elevator_pos, {x=-self._elevator_angle*2 - 90, y=0, z=0})
|
|
||||||
--adjust rudder
|
|
||||||
self.object:set_bone_position("rudder", self._rudder_pos, {x=0,y=self._rudder_angle,z=0})
|
|
||||||
--adjust ailerons
|
|
||||||
if self._aileron_r_pos and self._aileron_l_pos then
|
|
||||||
local ailerons = self._rudder_angle
|
|
||||||
if self._invert_ailerons then ailerons = ailerons * -1 end
|
|
||||||
self.object:set_bone_position("aileron.r", self._aileron_r_pos, {x=-ailerons - 90,y=0,z=0})
|
|
||||||
self.object:set_bone_position("aileron.l", self._aileron_l_pos, {x=ailerons - 90,y=0,z=0})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- calculate energy consumption --
|
-- calculate energy consumption --
|
||||||
airutils.consumptionCalc(self, accel)
|
airutils.consumptionCalc(self, accel)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue