mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
VoxelArea: add_{x,y,z,p} must be static
Fix some documentations issues Use getNodeNoCheck(v3s16, ...) in some cases instead of getNodeNoCheck(x, y, z, ...)
This commit is contained in:
parent
3b27cf30d9
commit
12d1e4ff04
11 changed files with 72 additions and 61 deletions
31
src/voxel.h
31
src/voxel.h
|
@ -277,25 +277,36 @@ public:
|
|||
return index(p.X, p.Y, p.Z);
|
||||
}
|
||||
|
||||
// Translate index in the X coordinate
|
||||
void add_x(const v3s16 &extent, u32 &i, s16 a)
|
||||
/**
|
||||
* Translate index in the X coordinate
|
||||
*/
|
||||
static void add_x(const v3s16 &extent, u32 &i, s16 a)
|
||||
{
|
||||
i += a;
|
||||
}
|
||||
// Translate index in the Y coordinate
|
||||
void add_y(const v3s16 &extent, u32 &i, s16 a)
|
||||
|
||||
/**
|
||||
* Translate index in the Y coordinate
|
||||
*/
|
||||
static void add_y(const v3s16 &extent, u32 &i, s16 a)
|
||||
{
|
||||
i += a * extent.X;
|
||||
}
|
||||
// Translate index in the Z coordinate
|
||||
void add_z(const v3s16 &extent, u32 &i, s16 a)
|
||||
|
||||
/**
|
||||
* Translate index in the Z coordinate
|
||||
*/
|
||||
static void add_z(const v3s16 &extent, u32 &i, s16 a)
|
||||
{
|
||||
i += a * extent.X*extent.Y;
|
||||
i += a * extent.X * extent.Y;
|
||||
}
|
||||
// Translate index in space
|
||||
void add_p(const v3s16 &extent, u32 &i, v3s16 a)
|
||||
|
||||
/**
|
||||
* Translate index in space
|
||||
*/
|
||||
static void add_p(const v3s16 &extent, u32 &i, v3s16 a)
|
||||
{
|
||||
i += a.Z*extent.X*extent.Y + a.Y*extent.X + a.X;
|
||||
i += a.Z * extent.X * extent.Y + a.Y * extent.X + a.X;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue