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

Method lightSources

source/game/items/StarTools.cpp:236–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236List<LightSource> Flashlight::lightSources() const {
237 if (!initialized())
238 return {};
239
240 float angle = world()->geometry().diff(owner()->aimPosition(), owner()->position()).angle();
241 LightSource lightSource;
242 lightSource.type = LightType::Point;
243 lightSource.position = owner()->position() + owner()->handPosition(hand(), (m_lightPosition - m_handPosition) / TilePixels);
244 lightSource.color = m_lightColor.toRgbF();
245 lightSource.pointBeam = m_beamWidth;
246 lightSource.beamAngle = angle;
247 lightSource.beamAmbience = m_ambientFactor;
248 return {std::move(lightSource)};
249}
250
251WireTool::WireTool(Json const& config, String const& directory, Json const& parameters)
252 : Item(config, directory, parameters), FireableItem(config), BeamItem(config.setAll(parameters.toObject())) {

Callers 1

lightsMethod · 0.45

Calls 7

toRgbFMethod · 0.80
angleMethod · 0.45
diffMethod · 0.45
geometryMethod · 0.45
aimPositionMethod · 0.45
positionMethod · 0.45
handPositionMethod · 0.45

Tested by

no test coverage detected