MCPcopy Create free account
hub / github.com/chrxh/alien / getRandomPos

Method getRandomPos

source/Gui/CreatorWindow.cpp:369–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369RealVector2D CreatorWindow::getRandomPos() const
370{
371 auto result = Viewport::get().getCenterInWorldPos();
372 result.x += (toFloat(std::rand()) / RAND_MAX - 0.5f) * 8;
373 result.y += (toFloat(std::rand()) / RAND_MAX - 0.5f) * 8;
374 return result;
375}
376
377void CreatorWindow::incExecutionNumber()
378{

Callers

nothing calls this directly

Calls 2

toFloatFunction · 0.85
getCenterInWorldPosMethod · 0.80

Tested by

no test coverage detected