Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/SimulationModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ SimulationModel::SimulationModel(irr::IrrlichtDevice* dev,
ownShip.setSpeed(0); //Don't start moving if in secondary mode
}

//add water
bool waterReflection = true;
if (modelParameters.vrMode == true) {
waterReflection = false;
}
water.load(smgr,ownShip.getSceneNode(),weather,modelParameters.disableShaders,waterReflection,modelParameters.waterSegments);

/* To be replaced by getting information and passing into gui load method.
//Tell gui to hide the second engine scroll bar if we have a single engine
if (ownShip.isSingleEngine()) {
Expand Down Expand Up @@ -262,6 +255,14 @@ SimulationModel::SimulationModel(irr::IrrlichtDevice* dev,
//Hide the man overboard model
manOverboard.setVisible(false);

//add water
// Note that water.load resets the srand() seed to a fixed value.
bool waterReflection = true;
if (modelParameters.vrMode == true) {
waterReflection = false;
}
water.load(smgr,ownShip.getSceneNode(),weather,modelParameters.disableShaders,waterReflection,modelParameters.waterSegments);

//initialise offset
offsetPosition = irr::core::vector3d<int64_t>(0,0,0);

Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ int main(int argc, char ** argv)
driver->endScene();

//seed random number generator
std::srand(device->getTimer()->getTime());
std::srand(device->getTimer()->getRealTime());
// Note that this gets reset to a constant seed in water.load() in SimulationModel constructor.

//create GUI
GUIMain guiMain;
Expand Down
Loading