| 270 | } |
| 271 | |
| 272 | List<LightSource> Object::lightSources() const { |
| 273 | List<LightSource> lights; |
| 274 | lights.appendAll(m_networkedAnimator->lightSources(position() + m_animationPosition)); |
| 275 | |
| 276 | auto orientation = currentOrientation(); |
| 277 | if (!m_lightSourceColor.get().isClear() && orientation) { |
| 278 | Color color = m_lightSourceColor.get(); |
| 279 | if (m_lightFlickering) |
| 280 | color.setValue(clamp(color.value() * m_lightFlickering->value(SinWeightOperator<float>()), 0.0f, 1.0f)); |
| 281 | |
| 282 | LightSource lightSource; |
| 283 | lightSource.position = position() + centerOfTile(orientation->lightPosition); |
| 284 | lightSource.color = color.toRgbF(); |
| 285 | lightSource.type = m_config->lightType; |
| 286 | lightSource.pointBeam = m_config->pointBeam; |
| 287 | lightSource.beamAngle = orientation->beamAngle; |
| 288 | lightSource.beamAmbience = m_config->beamAmbience; |
| 289 | |
| 290 | lights.append(lightSource); |
| 291 | } |
| 292 | |
| 293 | return lights; |
| 294 | } |
| 295 | |
| 296 | Vec2F Object::position() const { |
| 297 | return Vec2F(m_xTilePosition.get(), m_yTilePosition.get()); |
no test coverage detected