Add two new sets of diamond crossing types

Add two new sets of diamond crossings in addition to the current set
of perpendicular crossings. Also cleans up the inside edges on the
perpendicular set models. All of these varieties have their mirror
images, which was previously a problem with the 45/90 crossing.

The naming convention for all of these rail types is this: when facing
east and param2=0, the angle and direction of the two crossing rails is
indicated. So 30l45r means 30 degrees left and 45 degrees right. The
mirror image of that would be 30r45l.

There is a recipe for each set of crossing types and the trackworker can
change geometry within types with left cick, and rotate between two 90
degree rotations with right-click. When left-clicking, the angles move
in an intuitive fashion like rotating rails.

* The perpendicular set (already existing) has rails that cross at 90
degrees.
* The 90+x set has 90 degree (straight, node aligned) rails plus a rail
intersecting that at 30, 45 or 60 degrees.
* The diagonal set has both rails not axis-aligned, for example 30r-45l,
60l60r. The latter is quite useful for scissors crossovers.
master
Blockhead 2020-08-16 02:39:58 +10:00 committed by Gabriel Pérez-Cerezo
parent b75752a3e0
commit b707f20ba2
23 changed files with 48611 additions and 10307 deletions

View File

@ -225,20 +225,133 @@ advtrains.ap.t_perpcrossing={
tpdefault="st",
rotation={"", "_30", "_45", "_60"},
}
advtrains.ap.t_9045crossing={
advtrains.ap.t_90plusx_crossing={
regstep = 1,
variant={
st={
conns = { {c=0}, {c=8}, {c=2}, {c=10} },
desc = "45/90 degree crossing",
["30l"]={
conns = { {c=0}, {c=8}, {c=1}, {c=9} },
desc = "30/90 degree crossing (left)",
tpdouble = true,
tpsingle = true,
trackworker = "st",
trackworker = "45l"
},
["45l"]={
conns = { {c=0}, {c=8}, {c=2}, {c=10} },
desc = "45/90 degree crossing (left)",
tpdouble = true,
tpsingle = true,
trackworker = "60l",
},
["60l"]={
conns = { {c=0}, {c=8}, {c=3}, {c=11}},
desc = "60/90 degree crossing (left)",
tpdouble = true,
tpsingle = true,
trackworker = "60r",
},
["60r"]={
conns = { {c=0}, {c=8}, {c=7}, {c=15} },
desc = "60/90 degree crossing (right)",
tpdouble = true,
tpsingle = true,
trackworker = "45r"
},
["45r"]={
conns = { {c=0}, {c=8}, {c=6}, {c=14} },
desc = "45/90 degree crossing (right)",
tpdouble = true,
tpsingle = true,
trackworker = "30r",
},
["30r"]={
conns = { {c=0}, {c=8}, {c=7}, {c=15}},
desc = "30/90 degree crossing (right)",
tpdouble = true,
tpsingle = true,
trackworker = "30l",
},
},
regtp=true,
tpdefault="st",
tpdefault="30l",
rotation={""},
trackworker = {
["30l"] = "45l",
["45l"] = "60l",
["60l"] = "60r",
["60r"] = "45r",
["45r"] = "30r",
["30r"] = "30l",
}
}
advtrains.ap.t_diagonalcrossing = {
regstep=1,
variant={
["30l45r"]={
conns = {{c=1}, {c=9}, {c=6}, {c=14}},
desc = "30left-45right diagonal crossing",
tpdouble=true,
tpsingle=true,
trackworker="60l30l",
},
["60l30l"]={
conns = {{c=3}, {c=11}, {c=1}, {c=9}},
desc = "30left-60right diagonal crossing",
tpdouble=true,
tpsingle=true,
trackworker="60l45r"
},
["60l45r"]={
conns = {{c=3}, {c=11}, {c=6}, {c=14}},
desc = "60left-45right diagonal crossing",
tpdouble=true,
tpsingle=true,
trackworker="60l60r"
},
["60l60r"]={
conns = {{c=3}, {c=11}, {c=5}, {c=13}},
desc = "60left-60right diagonal crossing",
tpdouble=true,
tpsingle=true,
trackworker="60r45l",
},
--If 60l60r had a mirror image, it would be here, but it's symmetric.
-- 60l60r is also equivalent to 30l30r but rotated 90 degrees.
["60r45l"]={
conns = {{c=5}, {c=13}, {c=2}, {c=10}},
desc = "60right-45left diagonal crossing",
tpdouble=true,
tpsingle=true,
trackworker="60r30r",
},
["60r30r"]={
conns = {{c=5}, {c=13}, {c=7}, {c=15}},
desc = "60right-30right diagonal crossing",
tpdouble=true,
tpsingle=true,
trackworker="30r45l",
},
["30r45l"]={
conns = {{c=7}, {c=15}, {c=2}, {c=10}},
desc = "30right-45left diagonal crossing",
tpdouble=true,
tpsingle=true,
trackworker="30l45r",
},
},
regtp=true,
tpdefault="30l45r",
rotation={""},
trackworker = {
["30l45r"] = "60l30l",
["60l30l"] = "60l45r",
["60l45r"] = "60l60r",
["60l60r"] = "60r45l",
["60r45l"] = "60r30r",
["60r30r"] = "30r45l",
["30r45l"] = "30l45r",
}
}
advtrains.trackpresets = advtrains.ap

View File

@ -41,18 +41,21 @@ minetest.register_craft({
{'', 'advtrains:dtrack_placer', ''}
}
})
-- 45-90(
-- 90plusx
-- When you face east and param2=0, then this set of rails has a rail at 90
-- degrees to the viewer, plus another rail crossing at 30, 45 or 60 degrees.
advtrains.register_tracks("default", {
nodename_prefix="advtrains:dtrack_xing4590",
nodename_prefix="advtrains:dtrack_xing90plusx",
texture_prefix="advtrains_dtrack_xing4590",
models_prefix="advtrains_dtrack_xing4590",
models_prefix="advtrains_dtrack_xing90plusx",
models_suffix=".obj",
shared_texture="advtrains_dtrack_shared.png",
description=attrans("45/90 Degree Diamond Crossing Track"),
description=attrans("90+Angle Diamond Crossing Track"),
formats = {}
}, advtrains.ap.t_9045crossing)
}, advtrains.ap.t_90plusx_crossing)
minetest.register_craft({
output = 'advtrains:dtrack_xing4590_placer 2',
output = 'advtrains:dtrack_xing90plusx_placer 2',
recipe = {
{'advtrains:dtrack_placer', '', ''},
{'advtrains:dtrack_placer', 'advtrains:dtrack_placer', 'advtrains:dtrack_placer'},
@ -60,6 +63,32 @@ minetest.register_craft({
}
})
-- Diagonal
-- This set of rail crossings is named based on the angle of each intersecting
-- direction when facing east and param2=0. Rails with l/r swapped are mirror
-- images. For example, 30r45l is the mirror image of 30l45r.
advtrains.register_tracks("default", {
nodename_prefix="advtrains:dtrack_xingdiag",
texture_prefix="advtrains_dtrack_xingdiag",
models_prefix="advtrains_dtrack_xingdiag",
models_suffix=".obj",
shared_texture="advtrains_dtrack_shared.png",
description=attrans("Diagonal Diamond Crossing Track"),
formats = {},
}, advtrains.ap.t_diagonalcrossing)
minetest.register_craft({
output = 'advtrains:dtrack_xingdiag_placer 2',
recipe = {
{'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'},
{'', 'advtrains:dtrack_placer', ''},
{'advtrains:dtrack_placer', '', 'advtrains:dtrack_placer'}
}
})
---- Not included: very shallow crossings like (30/60)+45.
---- At an angle of only 18.4 degrees, the models would not
---- translate well to a block game.
-- END crossings
--slopes
advtrains.register_tracks("default", {
nodename_prefix="advtrains:dtrack",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B