improved entities to use sprites when mesh isn't needed

This commit is contained in:
Alexsandro Percy 2024-10-19 20:05:32 -03:00
parent 634f461a1d
commit 8d3cc46215
9 changed files with 26 additions and 38 deletions

View File

@ -38,9 +38,8 @@ initial_properties = {
collide_with_objects=true, collide_with_objects=true,
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5}, collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",},
textures = {"automobiles_black.png",},
}, },
on_activate = function(self,std) on_activate = function(self,std)
@ -64,9 +63,8 @@ initial_properties = {
physical = true, physical = true,
collide_with_objects=true, collide_with_objects=true,
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",},
textures = {"automobiles_black.png",},
}, },
on_activate = function(self,std) on_activate = function(self,std)

View File

@ -17,9 +17,8 @@ initial_properties = {
collide_with_objects=true, collide_with_objects=true,
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5}, collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",},
textures = {"automobiles_black.png",},
}, },
on_activate = function(self,std) on_activate = function(self,std)
@ -43,9 +42,8 @@ initial_properties = {
physical = true, physical = true,
collide_with_objects=true, collide_with_objects=true,
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",},
textures = {"automobiles_black.png",},
}, },
on_activate = function(self,std) on_activate = function(self,std)

View File

@ -173,9 +173,8 @@ initial_properties = {
collide_with_objects=true, collide_with_objects=true,
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5}, collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",},
textures = {"automobiles_black.png",},
}, },
on_activate = function(self,std) on_activate = function(self,std)
@ -199,9 +198,8 @@ initial_properties = {
physical = true, physical = true,
collide_with_objects=true, collide_with_objects=true,
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",},
textures = {"automobiles_black.png",},
}, },
on_activate = function(self,std) on_activate = function(self,std)

View File

@ -3,9 +3,9 @@ initial_properties = {
physical = false, physical = false,
collide_with_objects=false, collide_with_objects=false,
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_alpha.png",}, textures = {"automobiles_alpha.png",},
use_texture_alpha = true,
}, },
on_activate = function(self,std) on_activate = function(self,std)
@ -705,7 +705,7 @@ function automobiles_lib.on_step(self, dtime)
self._last_ground_check = self._last_ground_check + dtime self._last_ground_check = self._last_ground_check + dtime
if self._last_ground_check > 0.18 then if self._last_ground_check > 0.18 then
self._last_ground_check = 0 self._last_ground_check = 0
automobiles_lib.ground_get_distances(self, 0.372, 2.7) automobiles_lib.ground_get_distances(self, 0.372, (self._front_suspension_pos.z)/10)
end end
local newpitch = self._pitch --velocity.y * math.rad(6) local newpitch = self._pitch --velocity.y * math.rad(6)

View File

@ -9,8 +9,7 @@ initial_properties = {
collide_with_objects=true, collide_with_objects=true,
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5}, collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_alpha.png",}, textures = {"automobiles_alpha.png",},
}, },
@ -35,8 +34,7 @@ initial_properties = {
physical = true, physical = true,
collide_with_objects=true, collide_with_objects=true,
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_alpha.png",}, textures = {"automobiles_alpha.png",},
}, },
@ -173,7 +171,7 @@ minetest.register_entity("automobiles_motorcycle:motorcycle", {
_seat_pos = {{x=0.0,y=-1.1,z=5.5},{x=0.0,y=-0.3,z=0.09}}, _seat_pos = {{x=0.0,y=-1.1,z=5.5},{x=0.0,y=-0.3,z=0.09}},
_front_suspension_ent = 'automobiles_motorcycle:front_suspension', _front_suspension_ent = 'automobiles_motorcycle:front_suspension',
_front_suspension_pos = {x=0,y=1.5,z=14.5}, _front_suspension_pos = {x=0,y=1.5,z=17},
--_front_wheel_ent = 'automobiles_lib:wheel', --_front_wheel_ent = 'automobiles_lib:wheel',
_front_wheel_xpos = 0, _front_wheel_xpos = 0,
_front_wheel_frames = {x = 1, y = 49}, _front_wheel_frames = {x = 1, y = 49},

View File

@ -128,7 +128,7 @@ function motorcycle.attach_pax_stand(self, player)
player_api.player_attached[name] = true player_api.player_attached[name] = true
-- makes it "invisible" -- makes it "invisible"
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"}) player:set_properties({mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",} })
--create the dummy mesh --create the dummy mesh
local pos = player:get_pos() local pos = player:get_pos()

View File

@ -32,9 +32,8 @@ initial_properties = {
collide_with_objects=true, collide_with_objects=true,
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5}, collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",},
textures = {"automobiles_black.png",},
}, },
on_activate = function(self,std) on_activate = function(self,std)
@ -58,9 +57,8 @@ initial_properties = {
physical = true, physical = true,
collide_with_objects=true, collide_with_objects=true,
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",},
textures = {"automobiles_black.png",},
}, },
on_activate = function(self,std) on_activate = function(self,std)

View File

@ -9,8 +9,7 @@ initial_properties = {
collide_with_objects=true, collide_with_objects=true,
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5}, collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_alpha.png",}, textures = {"automobiles_alpha.png",},
}, },
@ -35,8 +34,7 @@ initial_properties = {
physical = true, physical = true,
collide_with_objects=true, collide_with_objects=true,
pointable=false, pointable=false,
visual = "mesh", visual = "sprite",
mesh = "automobiles_pivot_mesh.b3d",
textures = {"automobiles_alpha.png",}, textures = {"automobiles_alpha.png",},
}, },

View File

@ -128,7 +128,7 @@ function vespa.attach_pax_stand(self, player)
player_api.player_attached[name] = true player_api.player_attached[name] = true
-- makes it "invisible" -- makes it "invisible"
player:set_properties({mesh = "automobiles_pivot_mesh.b3d"}) player:set_properties({mesh = "automobiles_pivot_mesh.b3d", textures = {"automobiles_alpha.png",}})
--create the dummy mesh --create the dummy mesh
local pos = player:get_pos() local pos = player:get_pos()