| 234 | } |
| 235 | |
| 236 | List<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 | |
| 251 | WireTool::WireTool(Json const& config, String const& directory, Json const& parameters) |
| 252 | : Item(config, directory, parameters), FireableItem(config), BeamItem(config.setAll(parameters.toObject())) { |
no test coverage detected