Beispiel #1
0
//Generate the height map and stash
void Chunk::generateData()
{
  auto mountain = new noise::module::RidgedMulti();
  mountain->SetOctaveCount(20);
  mountain->SetFrequency(0.2);
  auto baseFlat = new noise::module::Billow();
  baseFlat->SetOctaveCount(20);
  auto flatTerrain = new noise::module::ScaleBias();
  flatTerrain->SetSourceModule(0, *baseFlat);
  flatTerrain->SetScale(0.125);
  flatTerrain->SetBias(-0.96);
  
  //Perlin to control which type of terrain to generate
  auto terrainType = new noise::module::Perlin();
  terrainType->SetOctaveCount(4);
  terrainType->SetFrequency(0.5);
  terrainType->SetPersistence(0.25);
  
  auto select = new noise::module::Select();
  m_noiseModule = select;
  select->SetSourceModule(0, *flatTerrain);
  select->SetSourceModule(1, *mountain);
  select->SetControlModule(*terrainType);
  select->SetBounds(0.0, 1000.0);
  select->SetEdgeFalloff(0.6);
  
  m_modules.push_back(mountain);
  m_modules.push_back(baseFlat);
  m_modules.push_back(flatTerrain);
  m_modules.push_back(terrainType);
}
Beispiel #2
0
EBL::EBL() : ODPath()
{
    m_sTypeString = _T("EBL");
    m_wxcActiveLineColour = g_colourEBLLineColour;
    m_width = g_EBLLineWidth;
    m_style = g_EBLLineStyle;
    m_bDrawArrow = g_bEBLShowArrow;
    m_bVRM = g_bEBLVRM;
    m_bVRM = g_bEBLVRM;
    m_bCentreOnBoat = true;
    m_bFixedEndPosition = g_bEBLFixedEndPosition;
    m_bSaveUpdates = false;
    SetPersistence( g_EBLPersistenceType );
    SetActiveColours();
}
Beispiel #3
0
EBL::EBL() : ODPath()
{
    m_sTypeString = _T("EBL");
    m_wxcActiveLineColour = g_colourEBLLineColour;
    m_width = g_EBLLineWidth;
    m_style = g_EBLLineStyle;
    m_bDrawArrow = g_bEBLShowArrow;
    m_bVRM = g_bEBLVRM;
    m_bVRM = g_bEBLVRM;
    m_bCentreOnBoat = true;
    m_bFixedEndPosition = g_bEBLFixedEndPosition;
    m_bSaveUpdates = false;
    SetPersistence( g_EBLPersistenceType );
    SetActiveColours();
    m_bRotateWithBoat = g_bEBLRotateWithBoat;
    m_iMaintainWith = g_iEBLMaintainWith;
    if(isnan(g_pfFix.Hdt)) m_dBoatHeading = 0.;
    else m_dBoatHeading = g_pfFix.Hdt;
    if(isnan(g_pfFix.Cog)) m_dBoatCOG = 0.;
    else m_dBoatCOG = g_pfFix.Cog;
    m_dEBLAngle = 0.;
    m_dLength = 0.;
    m_bEndPointMoving = false;
}