本文整理汇总了C++中Projector::SetFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ Projector::SetFrame方法的具体用法?C++ Projector::SetFrame怎么用?C++ Projector::SetFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projector
的用法示例。
在下文中一共展示了Projector::SetFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _UpdateDirLightCamera
//----------------------------------------------------------------------------
void AmbientRegionActor::_UpdateDirLightCamera()
{
AVector dir = AVector::AnglesToDirection(Mathf::DEG_TO_RAD*mHorAngle,
Mathf::DEG_TO_RAD*mVerAngle);
dir.Normalize();
Scene *scene = DynamicCast<Scene>(GetTopestParent());
if (scene)
{
EnvirParam *envirParam = scene->GetEnvirParam();
Light *lightDir = envirParam->GetLight_Dir();
Projector *projector = envirParam->GetLight_Dir_Projector();
lightDir->Ambient = Float4(mAmbientColor[0], mAmbientColor[1],
mAmbientColor[2], mIntensity);
lightDir->Intensity = mIntensity;
lightDir->Diffuse = Float4(mDiffuseColor[0], mDiffuseColor[1],
mDiffuseColor[2], 1.0f);
lightDir->Specular = Float4(mSpecularColor[0], mSpecularColor[1],
mSpecularColor[2], mSpecularPow);
float upDot = dir.Dot(-AVector::UNIT_Z);
if (upDot >= 0.99f)
{
}
else
{
AVector upTemp = AVector::UNIT_Z;
AVector right = dir.UnitCross(upTemp);
AVector up = right.UnitCross(dir);
lightDir->DVector = dir;
lightDir->UVector = up;
lightDir->RVector = right;
APoint camPos = mLightCameraLookPosition - dir*mLightCameraLookDistance;
projector->SetFrame(camPos, lightDir->DVector,
lightDir->UVector, lightDir->RVector);
}
if (!projector->IsPerspective())
{
projector->SetFrustum(0.1f, 100.0f,
-mLightCameraExtent, mLightCameraExtent, -mLightCameraExtent,
mLightCameraExtent);
}
else
{
projector->SetFrustum(mLightCameraExtent, 1.0f, 1.0f, 100.0f);
}
}
}