Cuberite
A lightweight, fast and extensible game server for Minecraft
DungeonRoomsFinisher.cpp
Go to the documentation of this file.
1 
2 // DungeonRoomsFinisher.cpp
3 
4 // Declares the cDungeonRoomsFinisher class representing the finisher that generates dungeon rooms
5 
6 #include "Globals.h"
7 #include "DungeonRoomsFinisher.h"
8 #include "../BlockInfo.h"
9 #include "../FastRandom.h"
10 #include "../BlockEntities/ChestEntity.h"
11 #include "../BlockEntities/MobSpawnerEntity.h"
12 
13 
14 
15 
16 
18 static const int ROOM_HEIGHT = 4;
19 
20 
21 
22 
23 
25 // cDungeonRoom:
26 
29 {
31 
32 public:
33 
35  int a_GridX, int a_GridZ,
36  int a_OriginX, int a_OriginZ,
37  int a_HalfSizeX, int a_HalfSizeZ,
38  int a_FloorHeight,
39  cNoise & a_Noise
40  ):
41  Super(a_GridX, a_GridZ, a_OriginX, a_OriginZ),
42  m_StartX(a_OriginX - a_HalfSizeX),
43  m_EndX(a_OriginX + a_HalfSizeX),
44  m_StartZ(a_OriginZ - a_HalfSizeZ),
45  m_EndZ(a_OriginZ + a_HalfSizeZ),
46  m_FloorHeight(a_FloorHeight)
47  {
48  /*
49  Pick coords next to the wall for the chests.
50  This is done by indexing the possible coords, picking any one for the first chest
51  and then picking another position for the second chest that is not adjacent to the first pos
52  */
53  int rnd = a_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 7;
54  int SizeX = m_EndX - m_StartX - 1;
55  int SizeZ = m_EndZ - m_StartZ - 1;
56  int NumPositions = 2 * SizeX + 2 * SizeZ;
57  int FirstChestPos = rnd % NumPositions; // The corner positions are a bit more likely, but we don't mind
58  rnd = rnd / 512;
59  int SecondChestPos = (FirstChestPos + 2 + (rnd % (NumPositions - 3))) % NumPositions;
60  m_Chest1 = DecodeChestCoords(FirstChestPos, SizeX, SizeZ);
61  m_Chest2 = DecodeChestCoords(SecondChestPos, SizeX, SizeZ);
62 
63  // Choose what the mobspawner will spawn.
64  // 25% chance for a spider, 25% for a skeleton and 50% chance to get a zombie spawer.
65  int MobType = (a_Noise.IntNoise3DInt(a_OriginX, m_FloorHeight, a_OriginZ) / 7) % 100;
66  if (MobType <= 25)
67  {
69  }
70  else if (MobType <= 50)
71  {
73  }
74  else
75  {
77  }
78  }
79 
80 protected:
81 
82  // The X range of the room, start inclusive, end exclusive:
84 
85  // The Z range of the room, start inclusive, end exclusive:
87 
90 
93 
96 
99 
100 
103  Vector3i DecodeChestCoords(int a_PosIdx, int a_SizeX, int a_SizeZ)
104  {
105  if (a_PosIdx < a_SizeX)
106  {
107  // Return a coord on the ZM side of the room:
108  return Vector3i(m_StartX + a_PosIdx + 1, E_META_CHEST_FACING_ZP, m_StartZ + 1);
109  }
110  a_PosIdx -= a_SizeX;
111  if (a_PosIdx < a_SizeZ)
112  {
113  // Return a coord on the XP side of the room:
114  return Vector3i(m_EndX - 1, E_META_CHEST_FACING_XM, m_StartZ + a_PosIdx + 1);
115  }
116  a_PosIdx -= a_SizeZ;
117  if (a_PosIdx < a_SizeX)
118  {
119  // Return a coord on the ZP side of the room:
120  return Vector3i(m_StartX + a_PosIdx + 1, E_META_CHEST_FACING_ZM, m_StartZ + 1);
121  }
122  a_PosIdx -= a_SizeX;
123  // Return a coord on the XM side of the room:
124  return Vector3i(m_StartX + 1, E_META_CHEST_FACING_XP, m_StartZ + a_PosIdx + 1);
125  }
126 
127 
128 
131  void ReplaceCuboid(cChunkDesc & a_ChunkDesc, int a_StartX, int a_StartY, int a_StartZ, int a_EndX, int a_EndY, int a_EndZ, BLOCKTYPE a_DstBlockType)
132  {
133  int BlockX = a_ChunkDesc.GetChunkX() * cChunkDef::Width;
134  int BlockZ = a_ChunkDesc.GetChunkZ() * cChunkDef::Width;
135  int RelStartX = Clamp(a_StartX - BlockX, 0, cChunkDef::Width);
136  int RelStartZ = Clamp(a_StartZ - BlockZ, 0, cChunkDef::Width);
137  int RelEndX = Clamp(a_EndX - BlockX, 0, cChunkDef::Width);
138  int RelEndZ = Clamp(a_EndZ - BlockZ, 0, cChunkDef::Width);
139  for (int y = a_StartY; y < a_EndY; y++)
140  {
141  for (int z = RelStartZ; z < RelEndZ; z++)
142  {
143  for (int x = RelStartX; x < RelEndX; x++)
144  {
145  if (cBlockInfo::CanBeTerraformed(a_ChunkDesc.GetBlockType(x, y, z)))
146  {
147  a_ChunkDesc.SetBlockType(x, y, z, a_DstBlockType);
148  }
149  } // for x
150  } // for z
151  } // for z
152  }
153 
154 
155 
158  void ReplaceCuboidRandom(cChunkDesc & a_ChunkDesc, int a_StartX, int a_StartY, int a_StartZ, int a_EndX, int a_EndY, int a_EndZ, BLOCKTYPE a_DstBlockType1, BLOCKTYPE a_DstBlockType2)
159  {
160  int BlockX = a_ChunkDesc.GetChunkX() * cChunkDef::Width;
161  int BlockZ = a_ChunkDesc.GetChunkZ() * cChunkDef::Width;
162  int RelStartX = Clamp(a_StartX - BlockX, 0, cChunkDef::Width - 1);
163  int RelStartZ = Clamp(a_StartZ - BlockZ, 0, cChunkDef::Width - 1);
164  int RelEndX = Clamp(a_EndX - BlockX, 0, cChunkDef::Width);
165  int RelEndZ = Clamp(a_EndZ - BlockZ, 0, cChunkDef::Width);
166  auto & rnd = GetRandomProvider();
167  for (int y = a_StartY; y < a_EndY; y++)
168  {
169  for (int z = RelStartZ; z < RelEndZ; z++)
170  {
171  for (int x = RelStartX; x < RelEndX; x++)
172  {
173  if (cBlockInfo::CanBeTerraformed(a_ChunkDesc.GetBlockType(x, y, z)))
174  {
175  BLOCKTYPE BlockType = rnd.RandBool(0.75) ? a_DstBlockType1 : a_DstBlockType2;
176  a_ChunkDesc.SetBlockType(x, y, z, BlockType);
177  }
178  } // for x
179  } // for z
180  } // for z
181  }
182 
183 
184 
187  void TryPlaceChest(cChunkDesc & a_ChunkDesc, const Vector3i & a_Chest)
188  {
189  int RelX = a_Chest.x - a_ChunkDesc.GetChunkX() * cChunkDef::Width;
190  int RelZ = a_Chest.z - a_ChunkDesc.GetChunkZ() * cChunkDef::Width;
191  if (
192  (RelX < 0) || (RelX >= cChunkDef::Width) || // The X coord is not in this chunk
193  (RelZ < 0) || (RelZ >= cChunkDef::Width) // The Z coord is not in this chunk
194  )
195  {
196  return;
197  }
198  a_ChunkDesc.SetBlockTypeMeta(RelX, m_FloorHeight + 1, RelZ, E_BLOCK_CHEST, static_cast<NIBBLETYPE>(a_Chest.y));
199 
200  // Fill the chest with random loot
201  static const cLootProbab LootProbab[] =
202  {
203  // Item, MinAmount, MaxAmount, Weight
204  { cItem(E_ITEM_GOLDEN_APPLE), 1, 1, 1 },
205  { cItem(E_ITEM_DIAMOND_HORSE_ARMOR), 1, 1, 1 },
206  { cItem(E_ITEM_GOLD_HORSE_ARMOR), 1, 1, 2 },
207  { cItem(E_ITEM_GOLD), 1, 4, 2 },
208  { cItem(E_ITEM_13_DISC), 1, 1, 4 },
209  { cItem(E_ITEM_CAT_DISC), 1, 1, 4 },
210  { cItem(E_ITEM_IRON_HORSE_ARMOR), 1, 1, 5 },
211  { cItem(E_ITEM_IRON), 1, 4, 10 },
212  { cItem(E_ITEM_WHEAT), 1, 4, 10 },
213  { cItem(E_ITEM_GUNPOWDER), 1, 4, 10 },
214  { cItem(E_ITEM_STRING), 1, 4, 10 },
215  { cItem(E_ITEM_REDSTONE_DUST), 1, 4, 10 },
216  { cItem(E_ITEM_COAL), 1, 4, 10 },
217  { cItem(E_ITEM_BONE), 1, 4, 10 },
218  { cItem(E_ITEM_ROTTEN_FLESH), 1, 4, 10 },
219  { cItem(E_ITEM_SADDLE), 1, 1, 10 },
220  { cItem(E_ITEM_BUCKET), 1, 1, 10 },
221  { cItem(E_ITEM_BREAD), 1, 1, 10 },
222  { cItem(E_ITEM_NAME_TAG), 1, 1, 10 },
223  { cItem(E_ITEM_BEETROOT_SEEDS), 2, 4, 10 },
224  { cItem(E_ITEM_MELON_SEEDS), 2, 4, 10 },
225  { cItem(E_ITEM_PUMPKIN_SEEDS), 2, 4, 10 },
226  } ;
227 
228  cChestEntity * ChestEntity = static_cast<cChestEntity *>(a_ChunkDesc.GetBlockEntity(RelX, m_FloorHeight + 1, RelZ));
229  ASSERT((ChestEntity != nullptr) && (ChestEntity->GetBlockType() == E_BLOCK_CHEST));
230  cNoise Noise(a_ChunkDesc.GetChunkX() ^ a_ChunkDesc.GetChunkZ());
231  int NumSlots = 3 + ((Noise.IntNoise3DInt(a_Chest.x, a_Chest.y, a_Chest.z) / 11) % 4);
232  int Seed = Noise.IntNoise2DInt(RelX, RelZ);
233  ChestEntity->GetContents().GenerateRandomLootWithBooks(LootProbab, ARRAYCOUNT(LootProbab), NumSlots, Seed);
234  }
235 
236 
237 
238  // cGridStructGen::cStructure override:
239  virtual void DrawIntoChunk(cChunkDesc & a_ChunkDesc) override
240  {
241  if (
242  (m_EndX < a_ChunkDesc.GetChunkX() * cChunkDef::Width) ||
243  (m_StartX >= a_ChunkDesc.GetChunkX() * cChunkDef::Width + cChunkDef::Width) ||
244  (m_EndZ < a_ChunkDesc.GetChunkZ() * cChunkDef::Width) ||
245  (m_StartZ >= a_ChunkDesc.GetChunkZ() * cChunkDef::Width + cChunkDef::Width)
246  )
247  {
248  // The chunk is not intersecting the room at all, bail out
249  return;
250  }
251 
252  int b = m_FloorHeight + 1; // Bottom
253  int t = m_FloorHeight + 1 + ROOM_HEIGHT; // Top
255  ReplaceCuboid(a_ChunkDesc, m_StartX + 1, b, m_StartZ + 1, m_EndX, t, m_EndZ, E_BLOCK_AIR); // Insides
256 
257  // Walls:
258  ReplaceCuboid(a_ChunkDesc, m_StartX, b, m_StartZ, m_StartX + 1, t, m_EndZ, E_BLOCK_COBBLESTONE); // XM wall
259  ReplaceCuboid(a_ChunkDesc, m_EndX, b, m_StartZ, m_EndX + 1, t, m_EndZ, E_BLOCK_COBBLESTONE); // XP wall
260  ReplaceCuboid(a_ChunkDesc, m_StartX, b, m_StartZ, m_EndX + 1, t, m_StartZ + 1, E_BLOCK_COBBLESTONE); // ZM wall
261  ReplaceCuboid(a_ChunkDesc, m_StartX, b, m_EndZ, m_EndX + 1, t, m_EndZ + 1, E_BLOCK_COBBLESTONE); // ZP wall
262 
263  // Place chests:
264  TryPlaceChest(a_ChunkDesc, m_Chest1);
265  TryPlaceChest(a_ChunkDesc, m_Chest2);
266 
267  // Place the spawner:
268  int CenterX = (m_StartX + m_EndX) / 2 - a_ChunkDesc.GetChunkX() * cChunkDef::Width;
269  int CenterZ = (m_StartZ + m_EndZ) / 2 - a_ChunkDesc.GetChunkZ() * cChunkDef::Width;
270  if (
271  (CenterX >= 0) && (CenterX < cChunkDef::Width) &&
272  (CenterZ >= 0) && (CenterZ < cChunkDef::Width)
273  )
274  {
275  a_ChunkDesc.SetBlockTypeMeta(CenterX, b, CenterZ, E_BLOCK_MOB_SPAWNER, 0);
276  cMobSpawnerEntity * MobSpawner = static_cast<cMobSpawnerEntity *>(a_ChunkDesc.GetBlockEntity(CenterX, b, CenterZ));
277  ASSERT((MobSpawner != nullptr) && (MobSpawner->GetBlockType() == E_BLOCK_MOB_SPAWNER));
278  MobSpawner->SetEntity(m_MonsterType);
279  }
280  }
281 } ;
282 
283 
284 
285 
286 
288 // cDungeonRoomsFinisher:
289 
290 cDungeonRoomsFinisher::cDungeonRoomsFinisher(cTerrainShapeGen & a_ShapeGen, int a_Seed, int a_GridSize, int a_MaxSize, int a_MinSize, const AString & a_HeightDistrib) :
291  Super(a_Seed + 100, a_GridSize, a_GridSize, a_GridSize, a_GridSize, a_MaxSize, a_MaxSize, 1024),
292  m_ShapeGen(a_ShapeGen),
293  m_MaxHalfSize((a_MaxSize + 1) / 2),
294  m_MinHalfSize((a_MinSize + 1) / 2),
295  m_HeightProbability(cChunkDef::Height)
296 {
297  // Initialize the height probability distribution:
298  m_HeightProbability.SetDefString(a_HeightDistrib);
299 
300  // Normalize the min and max size:
302  {
303  std::swap(m_MinHalfSize, m_MaxHalfSize);
304  }
305 }
306 
307 
308 
309 
310 
311 cDungeonRoomsFinisher::cStructurePtr cDungeonRoomsFinisher::CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ)
312 {
313  // Select a random room size in each direction:
314  int rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 7;
315  int HalfSizeX = m_MinHalfSize + (rnd % (m_MaxHalfSize - m_MinHalfSize + 1));
316  rnd = rnd / 32;
317  int HalfSizeZ = m_MinHalfSize + (rnd % (m_MaxHalfSize - m_MinHalfSize + 1));
318  rnd = rnd / 32;
319 
320  // Select a random floor height for the room, based on the height generator:
321  int ChunkX, ChunkZ;
322  int RelX = a_OriginX, RelY = 0, RelZ = a_OriginZ;
323  cChunkDef::AbsoluteToRelative(RelX, RelY, RelZ, ChunkX, ChunkZ);
324  cChunkDesc::Shape shape;
325  m_ShapeGen.GenShape({ChunkX, ChunkZ}, shape);
326  int height = 0;
327  int idx = RelX * 256 + RelZ * 16 * 256;
328  for (int y = 6; y < cChunkDef::Height; y++)
329  {
330  if (shape[idx + y] != 0)
331  {
332  continue;
333  }
334  height = Clamp(m_HeightProbability.MapValue(rnd % m_HeightProbability.GetSum()), 10, y - 5);
335  }
336 
337  // Create the dungeon room descriptor:
338  return cStructurePtr(new cDungeonRoom(a_GridX, a_GridZ, a_OriginX, a_OriginZ, HalfSizeX, HalfSizeZ, height, m_Noise));
339 }
@ E_META_CHEST_FACING_XP
Definition: BlockType.h:600
@ E_META_CHEST_FACING_ZM
Definition: BlockType.h:597
@ E_META_CHEST_FACING_XM
Definition: BlockType.h:599
@ E_META_CHEST_FACING_ZP
Definition: BlockType.h:598
@ E_BLOCK_AIR
Definition: BlockType.h:10
@ E_BLOCK_MOSSY_COBBLESTONE
Definition: BlockType.h:58
@ E_BLOCK_CHEST
Definition: BlockType.h:64
@ E_BLOCK_MOB_SPAWNER
Definition: BlockType.h:62
@ E_BLOCK_COBBLESTONE
Definition: BlockType.h:14
@ E_ITEM_IRON
Definition: BlockType.h:309
@ E_ITEM_ROTTEN_FLESH
Definition: BlockType.h:412
@ E_ITEM_GOLD
Definition: BlockType.h:310
@ E_ITEM_COAL
Definition: BlockType.h:307
@ E_ITEM_GOLDEN_APPLE
Definition: BlockType.h:366
@ E_ITEM_WHEAT
Definition: BlockType.h:340
@ E_ITEM_IRON_HORSE_ARMOR
Definition: BlockType.h:463
@ E_ITEM_CAT_DISC
Definition: BlockType.h:507
@ E_ITEM_GOLD_HORSE_ARMOR
Definition: BlockType.h:464
@ E_ITEM_REDSTONE_DUST
Definition: BlockType.h:375
@ E_ITEM_MELON_SEEDS
Definition: BlockType.h:407
@ E_ITEM_STRING
Definition: BlockType.h:331
@ E_ITEM_BEETROOT_SEEDS
Definition: BlockType.h:482
@ E_ITEM_DIAMOND_HORSE_ARMOR
Definition: BlockType.h:465
@ E_ITEM_SADDLE
Definition: BlockType.h:373
@ E_ITEM_GUNPOWDER
Definition: BlockType.h:333
@ E_ITEM_BREAD
Definition: BlockType.h:341
@ E_ITEM_BONE
Definition: BlockType.h:397
@ E_ITEM_NAME_TAG
Definition: BlockType.h:468
@ E_ITEM_13_DISC
Definition: BlockType.h:506
@ E_ITEM_BUCKET
Definition: BlockType.h:369
@ E_ITEM_PUMPKIN_SEEDS
Definition: BlockType.h:406
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
MTRand & GetRandomProvider()
Returns the current thread's random number source.
Definition: FastRandom.cpp:12
static const int ROOM_HEIGHT
Height, in blocks, of the internal dungeon room open space.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
Definition: Globals.h:231
T Clamp(T a_Value, T a_Min, T a_Max)
Clamp X to the specified range.
Definition: Globals.h:336
#define ASSERT(x)
Definition: Globals.h:276
eMonsterType
Identifies individual monster type.
Definition: MonsterTypes.h:11
@ mtSkeleton
Definition: MonsterTypes.h:59
@ mtZombie
Definition: MonsterTypes.h:79
@ mtSpider
Definition: MonsterTypes.h:63
BlockType
Definition: BlockTypes.h:4
std::string AString
Definition: StringUtils.h:11
Vector3< int > Vector3i
Definition: Vector3.h:487
BLOCKTYPE GetBlockType() const
Definition: BlockEntity.h:97
cItemGrid & GetContents(void)
Returns the ItemGrid used for storing the contents.
void SetEntity(eMonsterType a_EntityType)
static bool CanBeTerraformed(BLOCKTYPE Block)
Can a finisher change it?
Definition: BlockInfo.cpp:575
Constants used throughout the code, useful typedefs and utility functions.
Definition: ChunkDef.h:120
static void AbsoluteToRelative(int &a_X, int &a_Y, int &a_Z, int &a_ChunkX, int &a_ChunkZ)
Converts absolute block coords into relative (chunk + block) coords:
Definition: ChunkDef.h:147
static const int Width
Definition: ChunkDef.h:124
static const int Height
Definition: ChunkDef.h:125
cBlockEntity * GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
Returns the block entity at the specified coords.
Definition: ChunkDesc.cpp:573
void SetBlockType(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType)
Definition: ChunkDesc.cpp:81
Byte Shape[256 *16 *16]
The datatype used to represent the entire chunk worth of shape.
Definition: ChunkDesc.h:36
int GetChunkX() const
Definition: ChunkDesc.h:49
void SetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Definition: ChunkDesc.cpp:63
BLOCKTYPE GetBlockType(int a_RelX, int a_RelY, int a_RelZ) const
Definition: ChunkDesc.cpp:90
int GetChunkZ() const
Definition: ChunkDesc.h:50
The interface that a terrain shape generator must implement A terrain shape generator takes chunk coo...
virtual void GenShape(cChunkCoords a_ChunkCoords, cChunkDesc::Shape &a_Shape)=0
Generates the shape for the given chunk.
Vector3i m_Chest1
The (absolute) coords of the first chest.
virtual void DrawIntoChunk(cChunkDesc &a_ChunkDesc) override
Draws self into the specified chunk.
void ReplaceCuboid(cChunkDesc &a_ChunkDesc, int a_StartX, int a_StartY, int a_StartZ, int a_EndX, int a_EndY, int a_EndZ, BLOCKTYPE a_DstBlockType)
Fills the specified area of blocks in the chunk with the specified blocktype if they are one of the o...
eMonsterType m_MonsterType
The monster type for the mobspawner entity.
Vector3i DecodeChestCoords(int a_PosIdx, int a_SizeX, int a_SizeZ)
Decodes the position index along the room walls into a proper 2D position for a chest.
int m_FloorHeight
The Y coord of the floor of the room.
cDungeonRoom(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ, int a_HalfSizeX, int a_HalfSizeZ, int a_FloorHeight, cNoise &a_Noise)
void ReplaceCuboidRandom(cChunkDesc &a_ChunkDesc, int a_StartX, int a_StartY, int a_StartZ, int a_EndX, int a_EndY, int a_EndZ, BLOCKTYPE a_DstBlockType1, BLOCKTYPE a_DstBlockType2)
Fills the specified area of blocks in the chunk with a random pattern of the specified blocktypes,...
Vector3i m_Chest2
The (absolute) coords of the second chest.
void TryPlaceChest(cChunkDesc &a_ChunkDesc, const Vector3i &a_Chest)
Tries to place a chest at the specified (absolute) coords.
virtual cStructurePtr CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) override
Create a new structure at the specified gridpoint.
cProbabDistrib m_HeightProbability
The height probability distribution to make the spawners more common in layers 10 - 40,...
cDungeonRoomsFinisher(cTerrainShapeGen &a_ShapeGen, int a_Seed, int a_GridSize, int a_MaxSize, int a_MinSize, const AString &a_HeightDistrib)
Creates a new dungeon room finisher.
cTerrainShapeGen & m_ShapeGen
The shape gen that is used for limiting the rooms' Y coords.
int m_MaxHalfSize
Maximum half-size (from center to wall) of the dungeon room's inner (air) area.
int m_MinHalfSize
Minimum half-size (from center to wall) of the dungeon room's inner (air) area.
Generates structures in a semi-random grid.
Definition: GridStructGen.h:46
std::shared_ptr< cStructure > cStructurePtr
Definition: GridStructGen.h:77
cNoise m_Noise
The noise used for generating grid offsets.
Represents a single structure that occupies the grid point.
Definition: GridStructGen.h:50
Definition: Item.h:37
Used to store loot probability tables.
Definition: Item.h:260
void GenerateRandomLootWithBooks(const cLootProbab *a_LootProbabs, size_t a_CountLootProbabs, int a_NumSlots, int a_Seed)
Generates random loot from the specified loot probability table, with a chance of enchanted books add...
Definition: ItemGrid.cpp:752
Definition: Noise.h:20
int IntNoise3DInt(int a_X, int a_Y, int a_Z) const
Definition: Noise.h:254
int IntNoise2DInt(int a_X, int a_Y) const
Definition: Noise.h:243
bool SetDefString(const AString &a_DefString)
Sets the distribution curve using a definition string; returns true on successful parse.
int GetSum(void) const
Definition: ProbabDistrib.h:62
int MapValue(int a_OrigValue) const
Maps value in range [0, m_Sum] into the range [0, m_MaxValue] using the stored probability.
T x
Definition: Vector3.h:17
T y
Definition: Vector3.h:17
T z
Definition: Vector3.h:17