12 m_FluidBlock(a_Fluid),
13 m_StationaryFluidBlock(a_StationaryFluid)
106 if ((a_Meta1 & 0x08) != 0)
117 if ((a_Meta2 & 0x08) != 0)
124 return (a_Meta1 < a_Meta2);
146 return ((a_BlockMeta & 0x08) != 0) ? 0 : a_BlockMeta;
150 NIBBLETYPE CentralPoint = HeightFromMeta(BlockMeta);
156 { a_X + 1, a_Y, a_Z },
157 { a_X, a_Y, a_Z + 1 },
158 { a_X - 1, a_Y, a_Z },
159 { a_X, a_Y, a_Z - 1 }
162 for (
size_t i = 0; i <
ARRAYCOUNT(LevelPoint); i++)
170 LevelPoint[i] = CentralPoint;
178 Direction.
x = (LevelPoint[0] - LevelPoint[2]) / 2.0f;
179 Direction.
z = (LevelPoint[1] - LevelPoint[3]) / 2.0f;
181 if ((BlockMeta & 0x08) != 0)
virtual bool IsAllowedBlock(BLOCKTYPE a_BlockType) override
Returns true if the specified block type is "interesting" for this simulator.
BLOCKTYPE GetBlock(Vector3i a_BlockPos)
Returns the block type at the specified position.
bool IsSolidBlock(BLOCKTYPE a_BlockType)
unsigned char BLOCKTYPE
The datatype used by blockdata.
bool IsPassableForFluid(BLOCKTYPE a_BlockType)
BLOCKTYPE m_StationaryFluidBlock
static bool IsValidHeight(int a_Height)
Validates a height-coordinate.
bool IsHigherMeta(NIBBLETYPE a_Meta1, NIBBLETYPE a_Meta2)
Returns true if a_Meta1 is a higher fluid than a_Meta2.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
NIBBLETYPE GetBlockMeta(Vector3i a_BlockPos)
Returns the block meta at the specified position.
virtual Vector3f GetFlowingDirection(int a_X, int a_Y, int a_Z)
Returns a unit vector in the direction the fluid is flowing or a zero-vector if not flowing...
Base class for all block-based physics simulators (such as fluid, fire, falling blocks etc...
static bool CanWashAway(BLOCKTYPE a_BlockType)
cFluidSimulator(cWorld &a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid)
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)