コード例 #1
0
ファイル: Light.cpp プロジェクト: lejonmcgowan/OpenGLWrapper
//point light constructor
Light::Light(LightType lightType, float intensity, glm::vec3 position):
        lightType(lightType),
        intensity(intensity),
        position(position),
        id(pointID++)
{
    setLightRange();

    ambient = glm::vec3(1.0f,1.0f,1.0f);
    diffuse = glm::vec3(1.0f,1.0f,1.0f);
    specular = glm::vec3(1.0f,1.0f,1.0f);

}
コード例 #2
0
ファイル: Light.cpp プロジェクト: lejonmcgowan/OpenGLWrapper
//spot light constructor
Light::Light(LightType lightType, float intensity, float innerCutoffAngle, float outerCutoffAngle):
lightType(lightType),
intensity(intensity),
innerCutoffAngle(innerCutoffAngle),
outerCutoffAngle(outerCutoffAngle),
id(spotID++)
{
    setLightRange();

    ambient = glm::vec3(1.0f,1.0f,1.0f);
    diffuse = glm::vec3(1.0f,1.0f,1.0f);
    specular = glm::vec3(1.0f,1.0f,1.0f);

}
コード例 #3
0
RenderObjectPtr
Light::clone() const noexcept
{
	auto light = std::make_shared<Light>();
	light->setLightType(this->getLightType());
	light->setLightColor(this->getLightColor());
	light->setLightIntensity(this->getLightIntensity());
	light->setLightRange(this->getLightRange());
	light->setTransform(this->getTransform(), this->getTransformInverse());
	light->setBoundingBox(this->getBoundingBox());

	light->_spotInnerCone = _spotInnerCone;
	light->_spotOuterCone = _spotOuterCone;

	return light;
}