MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / drawRays

Method drawRays

source/rendering/StarEnvironmentPainter.cpp:352–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352void EnvironmentPainter::drawRays(
353 float pixelRatio, SkyRenderData const& sky, Vec2F start, float length, double time, float alpha) {
354 // All magic constants are either 2PI or arbritrary to allow the Perlin to act
355 // as a PRNG
356 float sectorWidth = 2 * Constants::pi / RayCount; // Radians
357 Vec3B color = sky.topRectColor.toRgb();
358
359 for (int i = 0; i < RayCount; i++)
360 drawRay(pixelRatio,
361 sky,
362 start,
363 sectorWidth * (std::abs(m_rayPerlin.get(i * 25)) * RayWidthVariance + RayMinWidth),
364 length,
365 i * sectorWidth + m_rayPerlin.get(i * 314) * RayAngleVariance,
366 time,
367 color,
368 alpha);
369
370 m_renderer->flush();
371}
372
373void EnvironmentPainter::drawRay(float pixelRatio,
374 SkyRenderData const& sky,

Callers

nothing calls this directly

Calls 3

toRgbMethod · 0.80
getMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected