From accacbd84e754b026eb03f0e4da2139d0ce236f0 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Wed, 1 Jun 2022 20:00:38 +0200 Subject: [PATCH] Carts: Get rid of animation hack --- mods/carts/cart_entity.lua | 15 ++---- mods/carts/models/carts_cart.b3d | Bin 2387 -> 0 bytes mods/carts/models/carts_cart.obj | 76 +++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 12 deletions(-) delete mode 100644 mods/carts/models/carts_cart.b3d create mode 100644 mods/carts/models/carts_cart.obj diff --git a/mods/carts/cart_entity.lua b/mods/carts/cart_entity.lua index 3015409ef9..6a76985b76 100644 --- a/mods/carts/cart_entity.lua +++ b/mods/carts/cart_entity.lua @@ -6,10 +6,9 @@ local S = carts.get_translator local cart_entity = { initial_properties = { physical = false, -- otherwise going uphill breaks - collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, visual = "mesh", - mesh = "carts_cart.b3d", - visual_size = {x=1, y=1}, + mesh = "carts_cart.obj", textures = {"carts_cart.png"}, }, @@ -352,15 +351,7 @@ local function rail_on_step(self, dtime) elseif dir.z < 0 then yaw = 1 end - self.object:set_yaw(yaw * math.pi) - - local anim = {x=0, y=0} - if dir.y == -1 then - anim = {x=1, y=1} - elseif dir.y == 1 then - anim = {x=2, y=2} - end - self.object:set_animation(anim, 1, 0) + self.object:set_rotation(vector.new(math.sign(dir.y) * 0.25 * math.pi, yaw * math.pi, 0)) if update.vel then self.object:set_velocity(vel) diff --git a/mods/carts/models/carts_cart.b3d b/mods/carts/models/carts_cart.b3d deleted file mode 100644 index b8b7c3a1c1a5fde54ee3c490f917114c34f9350b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2387 zcma)-%T5$Q6owB7c)u&&6}(>&#mj1@$B{`S1W1_C=!%HkOo$SYg)2L8$4fA;VB*?z z;wuSC9lV{6*`-CR%1>PeT?OLAjDEn?S`W^-MP--;3UejIf; zyPo`UHCW63eyz{LZ>`;2uiNL9ezo?npU$qAdR$$%R(-qvO1>_&w)E`w$oAs*)i))q z^WW&}W%u=YY0thtVsX@VE-seSOO(@dl-<{I`Xk0Z?PnE7b8~A6n3-GCH(SB1QJj@e z?({~?Y$3!J9XE=~wRzdBeZ3KD6y=wQF{hNYUWt0X1~D^VyI#^>n)CJOfwk1|u|{!g z%nBiAQ_oh&_Tu-Y4!OP;_QE37WhQ9}S_44wv_tdS;)2NVhR)xH^ZFhG_{aMbL7V=_kYxy?I``+yN`E#jF zj#O(rHX5BmFl}4#iT4P4qEyptd+@P$33_BrZ=UTAKK4FgudqkhAAIaX!a?DHa5(tb zy~0u9h;S_U*e8V(!g1kL@UhPdXN1$jx!_};7y5-h;evpVeOb69TokSZAN#s+O}HxX z3xSW#(|=32DclY|_FaLWfk6R*@Ub5V_l0}H!{B2-8Xp>{kMt{9iPhpb1`5p1w2}LQT;3n zJ%XIE%rH{zVK?GHL1)7+sSb#m%?}QWG2-4IU%yO!Tnu+%BRBa+ZjoGnU;Z!mFF8!* AqW}N^ diff --git a/mods/carts/models/carts_cart.obj b/mods/carts/models/carts_cart.obj new file mode 100644 index 0000000000..01c50abd88 --- /dev/null +++ b/mods/carts/models/carts_cart.obj @@ -0,0 +1,76 @@ +o Cart +v -5.000000 -5.000000 5.000000 +v -5.000000 -5.000000 -5.000000 +v 5.000000 -5.000000 -4.999999 +v 4.999998 -5.000000 5.000002 +v -5.000002 5.000000 4.999997 +v -4.999997 5.000000 -5.000003 +v 5.000002 5.000000 -4.999998 +v 5.000000 5.000000 5.000000 +v -4.324999 5.000000 -4.325001 +v -4.325000 -4.325000 -4.325000 +v 4.325001 5.000000 -4.325003 +v 4.324999 5.000000 4.324998 +v 4.325000 -4.325000 -4.325001 +v 4.325000 -4.325000 4.324999 +v -4.324998 5.000000 4.324999 +v -4.324999 -4.325000 4.325000 +vt 0.500000 -0.000000 +vt -0.000000 0.000000 +vt -0.000000 0.500000 +vt 0.500000 0.500000 +vt 1.000000 0.500000 +vt 0.500000 1.000000 +vt 1.000000 1.000000 +vt 0.500000 1.000000 +vt 0.500000 0.500000 +vt 1.000000 0.500000 +vt 1.000000 1.000000 +vt 0.500000 -0.000000 +vt 0.500000 0.500000 +vt 1.000000 0.500000 +vt 1.000000 0.000000 +vt 1.000000 0.500000 +vt 0.500000 0.500000 +vt 0.500000 -0.000000 +vt 1.000000 0.000000 +vt 0.031250 0.531250 +vt 0.031250 1.000000 +vt 0.468750 1.000000 +vt 0.468750 0.531250 +vt 0.031250 0.531250 +vt 0.031250 1.000000 +vt 0.468750 1.000000 +vt 0.468750 0.531250 +vt 0.468750 0.968750 +vt 0.031250 0.968750 +vt 0.031250 0.531250 +vt 0.468750 0.531250 +vt 0.468750 0.531250 +vt 0.031250 0.531250 +vt -0.000000 0.500000 +vt 0.500000 0.500000 +vt 0.468750 0.968750 +vt 0.000000 1.000000 +vt 0.031250 0.968750 +vn 0.0000 -1.0000 -0.0000 +vn -1.0000 0.0000 -0.0000 +vn 1.0000 -0.0000 0.0000 +vn -0.0000 0.0000 1.0000 +vn 0.0000 -0.0000 -1.0000 +vn 0.0000 1.0000 0.0000 +s off +f 2/1/1 3/2/1 4/3/1 1/4/1 +f 2/5/2 1/4/2 5/6/2 6/7/2 +f 8/8/3 4/9/3 3/10/3 7/11/3 +f 4/12/4 8/13/4 5/14/4 1/15/4 +f 6/16/5 7/17/5 3/18/5 2/19/5 +f 14/20/2 12/21/2 11/22/2 13/23/2 +f 10/24/3 9/25/3 15/26/3 16/27/3 +f 16/28/6 14/29/6 13/30/6 10/31/6 +f 16/27/5 15/26/5 12/21/5 14/20/5 +f 9/25/4 10/24/4 13/23/4 11/22/4 +f 9/32/6 11/33/6 7/34/6 6/35/6 +f 9/32/6 6/35/6 5/6/6 15/36/6 +f 15/36/6 5/6/6 8/37/6 12/38/6 +f 12/38/6 8/37/6 7/34/6 11/33/6