mirror of
https://github.com/APercy/automobiles_pck
synced 2025-06-15 13:28:02 +02:00
improved entities to use sprites when mesh isn't needed
This commit is contained in:
parent
634f461a1d
commit
8d3cc46215
@ -38,9 +38,8 @@ initial_properties = {
|
||||
collide_with_objects=true,
|
||||
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
textures = {"automobiles_black.png",},
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
on_activate = function(self,std)
|
||||
@ -64,9 +63,8 @@ initial_properties = {
|
||||
physical = true,
|
||||
collide_with_objects=true,
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
textures = {"automobiles_black.png",},
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
on_activate = function(self,std)
|
||||
|
@ -17,9 +17,8 @@ initial_properties = {
|
||||
collide_with_objects=true,
|
||||
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
textures = {"automobiles_black.png",},
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
on_activate = function(self,std)
|
||||
@ -43,9 +42,8 @@ initial_properties = {
|
||||
physical = true,
|
||||
collide_with_objects=true,
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
textures = {"automobiles_black.png",},
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
on_activate = function(self,std)
|
||||
|
@ -173,9 +173,8 @@ initial_properties = {
|
||||
collide_with_objects=true,
|
||||
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
textures = {"automobiles_black.png",},
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
on_activate = function(self,std)
|
||||
@ -199,9 +198,8 @@ initial_properties = {
|
||||
physical = true,
|
||||
collide_with_objects=true,
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
textures = {"automobiles_black.png",},
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
on_activate = function(self,std)
|
||||
|
@ -3,9 +3,9 @@ initial_properties = {
|
||||
physical = false,
|
||||
collide_with_objects=false,
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
use_texture_alpha = true,
|
||||
},
|
||||
|
||||
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
|
||||
if self._last_ground_check > 0.18 then
|
||||
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
|
||||
local newpitch = self._pitch --velocity.y * math.rad(6)
|
||||
|
||||
|
@ -9,8 +9,7 @@ initial_properties = {
|
||||
collide_with_objects=true,
|
||||
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
@ -35,8 +34,7 @@ initial_properties = {
|
||||
physical = true,
|
||||
collide_with_objects=true,
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
visual = "sprite",
|
||||
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}},
|
||||
|
||||
_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_xpos = 0,
|
||||
_front_wheel_frames = {x = 1, y = 49},
|
||||
|
@ -128,7 +128,7 @@ function motorcycle.attach_pax_stand(self, player)
|
||||
player_api.player_attached[name] = true
|
||||
|
||||
-- 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
|
||||
local pos = player:get_pos()
|
||||
|
@ -32,9 +32,8 @@ initial_properties = {
|
||||
collide_with_objects=true,
|
||||
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
textures = {"automobiles_black.png",},
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
on_activate = function(self,std)
|
||||
@ -58,9 +57,8 @@ initial_properties = {
|
||||
physical = true,
|
||||
collide_with_objects=true,
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
textures = {"automobiles_black.png",},
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
on_activate = function(self,std)
|
||||
|
@ -9,8 +9,7 @@ initial_properties = {
|
||||
collide_with_objects=true,
|
||||
collisionbox = {-0.5, 0, -0.5, 0.5, 1, 0.5},
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
@ -35,8 +34,7 @@ initial_properties = {
|
||||
physical = true,
|
||||
collide_with_objects=true,
|
||||
pointable=false,
|
||||
visual = "mesh",
|
||||
mesh = "automobiles_pivot_mesh.b3d",
|
||||
visual = "sprite",
|
||||
textures = {"automobiles_alpha.png",},
|
||||
},
|
||||
|
||||
|
@ -128,7 +128,7 @@ function vespa.attach_pax_stand(self, player)
|
||||
player_api.player_attached[name] = true
|
||||
|
||||
-- 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
|
||||
local pos = player:get_pos()
|
||||
|
Loading…
Reference in New Issue
Block a user