//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); }
//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); }
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; }