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

Method lights

source/game/items/StarActiveItem.cpp:267–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267List<LightSource> ActiveItem::lights() const {
268 // Same as pullNewAudios, we translate and flip ourselves.
269 List<LightSource> result;
270 for (auto& light : m_itemAnimator.lightSources()) {
271 light.position = owner()->position() + handPosition(light.position);
272 light.beamAngle += m_armAngle.get();
273 if (owner()->facingDirection() == Direction::Left) {
274 if (light.beamAngle > 0)
275 light.beamAngle = Constants::pi / 2 + constrainAngle(Constants::pi / 2 - light.beamAngle);
276 else
277 light.beamAngle = -Constants::pi / 2 - constrainAngle(light.beamAngle + Constants::pi / 2);
278 }
279 result.append(std::move(light));
280 }
281 result.appendAll(m_scriptedAnimator.lightSources());
282 return result;
283}
284
285List<AudioInstancePtr> ActiveItem::pullNewAudios() {
286 // Because the item animator is in hand-space, and Humanoid does all the

Callers 1

lightSourcesMethod · 0.80

Calls 7

constrainAngleFunction · 0.85
appendAllMethod · 0.80
lightSourcesMethod · 0.45
positionMethod · 0.45
getMethod · 0.45
facingDirectionMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected