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

merged the content type extension and delta

This commit is contained in:
Perttu Ahola 2011-07-23 19:04:37 +03:00
commit 2587bb361c
69 changed files with 3756 additions and 159 deletions

View file

@ -538,6 +538,43 @@ void getPointedNode(Client *client, v3f player_position,
}
}
}
else if(n.getContent() == CONTENT_RAIL)
{
v3s16 dir = unpackDir(n.param0);
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
*/
@ -1915,15 +1952,9 @@ void the_game(
*/
if(farmesh)
{
farmesh_range = draw_control.wanted_range * 10;
if(draw_control.range_all && farmesh_range < 500)
farmesh_range = 500;
if(farmesh_range > 1000)
farmesh_range = 1000;
farmesh->step(dtime);
farmesh->update(v2f(player_position.X, player_position.Z),
0.05+brightness*0.95, farmesh_range);
0.05+brightness*0.95);
}
// Store brightness value
@ -1990,7 +2021,7 @@ void the_game(
endscenetime_avg = endscenetime_avg * 0.95 + (float)endscenetime*0.05;
char temptext[300];
snprintf(temptext, 300, "Minetest-c55 %s ("
snprintf(temptext, 300, "Minetest-delta %s ("
"R: range_all=%i"
")"
" drawtime=%.0f, beginscenetime=%.0f"