1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Merge branch 'master' of https://github.com/erlehmann/minetest-delta.git into upstream_merge

Conflicts:
	.gitignore
	CMakeLists.txt
	data/heart.png
	src/CMakeLists.txt
	src/game.cpp
	src/guiMainMenu.cpp
	src/inventory.cpp
	src/map.cpp
	src/mapblock.cpp
	src/mapnode.cpp
	src/mapnode.h
	src/materials.cpp
	src/server.cpp

Signed-off-by: Sebastian Rühl <bahamada_basti@yahoo.de>
This commit is contained in:
Sebastian Rühl 2011-06-26 12:24:32 +02:00
commit 9d09103e48
44 changed files with 1312 additions and 60 deletions

View file

@ -534,6 +534,43 @@ void getPointedNode(Client *client, v3f player_position,
}
}
}
else if(n.d == CONTENT_RAIL)
{
v3s16 dir = unpackDir(n.dir);
v3f dir_f = v3f(dir.X, dir.Y, dir.Z);
dir_f *= BS/2 - BS/6 - BS/20;
v3f cpf = npf + dir_f;
f32 distance = (cpf - camera_position).getLength();
float d = (float)BS/16;
v3f vertices[4] =
{
v3f(BS/2, -BS/2+d, -BS/2),
v3f(-BS/2, -BS/2, BS/2),
};
for(s32 i=0; i<2; i++)
{
vertices[i] += npf;
}
core::aabbox3d<f32> box;
box = core::aabbox3d<f32>(vertices[0]);
box.addInternalPoint(vertices[1]);
if(distance < mindistance)
{
if(box.intersectsWithLine(shootline))
{
nodefound = true;
nodepos = np;
neighbourpos = np;
mindistance = distance;
nodehilightbox = box;
}
}
}
/*
Regular blocks
*/