本文整理汇总了C++中PointLight::GetTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ PointLight::GetTransform方法的具体用法?C++ PointLight::GetTransform怎么用?C++ PointLight::GetTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointLight
的用法示例。
在下文中一共展示了PointLight::GetTransform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUniformPointLight
void Shader::SetUniformPointLight(const std::string& uniformName, const PointLight& pointLight) const
{
SetUniformVector3f(uniformName + ".base.color", pointLight.GetColor());
SetUniformf(uniformName + ".base.intensity", pointLight.GetIntensity());
SetUniformf(uniformName + ".atten.constant", pointLight.GetAttenuation().GetConstant());
SetUniformf(uniformName + ".atten.linear", pointLight.GetAttenuation().GetLinear());
SetUniformf(uniformName + ".atten.exponent", pointLight.GetAttenuation().GetExponent());
SetUniformVector3f(uniformName + ".position", pointLight.GetTransform().GetTransformedPos());
SetUniformf(uniformName + ".range", pointLight.GetRange());
}
示例2: UpdateAllPointLights
void Scene::UpdateAllPointLights()
{
int size = m_pointLightList.size();
LowLevelGraphics::ShaderProgram::UpdateGlobalShaderParameter(LowLevelGraphics::POINTLIGHTSSIZE, &size, SHADER_INT);
//PointLight* light = m_pointLightList.at(0)
//LowLevelGraphics::ShaderProgram::UpdateGlobalShaderParameter(LowLevelGraphics::POINTLIGHTSDIFFUSE, &(light->GetDiffuse()), SHADER_LIGHT_DIFFUSE);
for(int i = 0; i<m_pointLightList.size(); i++)
{
PointLight* light = m_pointLightList.at(i);
float rad = light->GetRadius();
LowLevelGraphics::ShaderProgram::UpdateGlobalShaderParameter(LowLevelGraphics::POINTLIGHTSDIFFUSE, &(light->GetDiffuse()), i, SHADER_LIGHT_DIFFUSE);
LowLevelGraphics::ShaderProgram::UpdateGlobalShaderParameter(LowLevelGraphics::POINTLIGHTSAMBIENT, &(light->GetAmbient()), i, SHADER_LIGHT_AMBIENT);
LowLevelGraphics::ShaderProgram::UpdateGlobalShaderParameter(LowLevelGraphics::POINTLIGHTSSPECULAR, &(light->GetSpecular()), i, SHADER_LIGHT_SPECULAR);
LowLevelGraphics::ShaderProgram::UpdateGlobalShaderParameter(LowLevelGraphics::POINTLIGHTSRADIUS, &rad, i, SHADER_LIGHT_RADIUS);
LowLevelGraphics::ShaderProgram::UpdateGlobalShaderParameter(LowLevelGraphics::POINTLIGHTSTRANSFORM, &(light->GetTransform()->GetMatrix()), i, SHADER_LIGHT_TRANSFORM);
}
}