Esempio n. 1
0
void RenderableLightEntityItem::updateRenderItemFromEntity(LightPayload& lightPayload) {
    auto entity = this;

    lightPayload.setVisible(entity->getVisible());

    auto light = lightPayload.editLight();
    light->setPosition(entity->getPosition());
    light->setOrientation(entity->getRotation());

    bool success;
    lightPayload.editBound() = entity->getAABox(success);
    if (!success) {
        lightPayload.editBound() = render::Item::Bound();
    }

    glm::vec3 dimensions = entity->getDimensions();
    float largestDiameter = glm::compMax(dimensions);
    light->setMaximumRadius(largestDiameter / 2.0f);

    light->setColor(toGlm(entity->getXColor()));

    float intensity = entity->getIntensity();//* entity->getFadingRatio();
    light->setIntensity(intensity);

    light->setFalloffRadius(entity->getFalloffRadius());


    float exponent = entity->getExponent();
    float cutoff = glm::radians(entity->getCutoff());
    if (!entity->getIsSpotlight()) {
        light->setType(model::Light::POINT);
    } else {
        light->setType(model::Light::SPOT);

        light->setSpotAngle(cutoff);
        light->setSpotExponent(exponent);
    }

}
Esempio n. 2
0
	SourcesManager::SourcesManager(double maximumLimitValue, bool existence)
	{
		setExistence(existence);
		setMaximumRadius(maximumLimitValue);
		m_zoom = 1.;
	}
SourcesManager::SourcesManager(double aMaximumLimitValue, long deadOrAlive)
{
    setExistence(deadOrAlive);
    setMaximumRadius(aMaximumLimitValue);    
}