mirror of
https://github.com/APercy/ap_airship.git
synced 2025-03-21 18:21:21 +00:00
improved 3d model, added a door
This commit is contained in:
parent
4889d8dd58
commit
3302726d85
3 changed files with 9 additions and 7 deletions
14
entities.lua
14
entities.lua
|
@ -435,12 +435,6 @@ minetest.register_entity("ap_airship:airship", {
|
||||||
|
|
||||||
if colinfo then
|
if colinfo then
|
||||||
self.isonground = colinfo.touching_ground
|
self.isonground = colinfo.touching_ground
|
||||||
else
|
|
||||||
if self.lastvelocity.y==0 and vel.y==0 then
|
|
||||||
self.isonground = true
|
|
||||||
else
|
|
||||||
self.isonground = false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self:physics()
|
self:physics()
|
||||||
|
@ -554,7 +548,7 @@ minetest.register_entity("ap_airship:airship", {
|
||||||
local wind_yaw = minetest.dir_to_yaw(wind)
|
local wind_yaw = minetest.dir_to_yaw(wind)
|
||||||
--minetest.chat_send_all("x: "..wind.x.. " - z: "..wind.z.." - yaw: "..math.deg(wind_yaw).. " - orig: "..wind_yaw)
|
--minetest.chat_send_all("x: "..wind.x.. " - z: "..wind.z.." - yaw: "..math.deg(wind_yaw).. " - orig: "..wind_yaw)
|
||||||
|
|
||||||
if self.anchored == false then
|
if self.anchored == false and self.isonground == false then
|
||||||
accel = vector.add(accel, wind)
|
accel = vector.add(accel, wind)
|
||||||
else
|
else
|
||||||
accel = vector.new()
|
accel = vector.new()
|
||||||
|
@ -573,6 +567,12 @@ minetest.register_entity("ap_airship:airship", {
|
||||||
self.object:set_bone_position("timao", {x=0,y=-22.562,z=176.018}, {x=0,y=0,z=self._rudder_angle*8})
|
self.object:set_bone_position("timao", {x=0,y=-22.562,z=176.018}, {x=0,y=0,z=self._rudder_angle*8})
|
||||||
self.object:set_bone_position("compass_axis", {x=0,y=-21.8,z=178.757}, {x=0, y=S_angle, z=0})
|
self.object:set_bone_position("compass_axis", {x=0,y=-21.8,z=178.757}, {x=0, y=S_angle, z=0})
|
||||||
|
|
||||||
|
if self.isonground then
|
||||||
|
self.object:set_bone_position("door", {x=0,y=-13.1266,z=54.1922}, {x=-18,y=0,z=0})
|
||||||
|
else
|
||||||
|
self.object:set_bone_position("door", {x=0,y=-13.1266,z=54.1922}, {x=0,y=0,z=0})
|
||||||
|
end
|
||||||
|
|
||||||
--saves last velocy for collision detection (abrupt stop)
|
--saves last velocy for collision detection (abrupt stop)
|
||||||
self._last_vel = self.object:get_velocity()
|
self._last_vel = self.object:get_velocity()
|
||||||
self._last_accell = accel
|
self._last_accell = accel
|
||||||
|
|
Binary file not shown.
|
@ -267,6 +267,8 @@ function ap_airship.destroy(self, overload)
|
||||||
if self._passengers_base[3] then self._passengers_base[3]:remove() end
|
if self._passengers_base[3] then self._passengers_base[3]:remove() end
|
||||||
if self._passengers_base[4] then self._passengers_base[4]:remove() end
|
if self._passengers_base[4] then self._passengers_base[4]:remove() end
|
||||||
if self._passengers_base[5] then self._passengers_base[5]:remove() end
|
if self._passengers_base[5] then self._passengers_base[5]:remove() end
|
||||||
|
if self._cabin_interactor then self._cabin_interactor:remove() end
|
||||||
|
if self._control_interactor then self._control_interactor:remove() end
|
||||||
|
|
||||||
airutils.destroy_inventory(self)
|
airutils.destroy_inventory(self)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
|
|
Loading…
Add table
Reference in a new issue