本文整理汇总了C++中PointLight::getBeacon方法的典型用法代码示例。如果您正苦于以下问题:C++ PointLight::getBeacon方法的具体用法?C++ PointLight::getBeacon怎么用?C++ PointLight::getBeacon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointLight
的用法示例。
在下文中一共展示了PointLight::getBeacon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: excludeListLeave
Action::ResultE MergeGraphOp::excludeListLeave(Node * const node, Action::ResultE res)
{
DirectionalLight *dlight = dynamic_cast<DirectionalLight *>(node->getCore());
if (dlight!=NULL)
addToExcludeList(dlight->getBeacon());
Light *light = dynamic_cast<Light *>(node->getCore());
if (light!=NULL)
addToExcludeList(light->getBeacon());
PointLight *plight = dynamic_cast<PointLight *>(node->getCore());
if (plight!=NULL)
addToExcludeList(plight->getBeacon());
SpotLight *slight = dynamic_cast<SpotLight *>(node->getCore());
if (slight!=NULL)
addToExcludeList(slight->getBeacon());
return res;
}
示例2: createShadowMapsFBO
void VarianceShadowMapHandler::createShadowMapsFBO(RenderAction *a,
DrawEnv *pEnv)
{
UInt32 mSize = _pStage->getMapSize();
if(mSize > 2048)
mSize = 2048;
//------Setting up Window to fit size of ShadowMap----------------
// disable all lights more speed
std::vector<bool> vLocalLightStates;
const ShadowStageData::LightStore &vLights =
_pStageData->getLights();
const ShadowStageData::LStateStore &vLightStates =
_pStageData->getLightStates();
const ShadowStageData::CamStore &vLCams =
_pStageData->getLightCameras();
const ShadowStageData::StatusStore &vExclActive =
_pStageData->getExcludeNodeActive();
for(UInt32 i = 0;i < vLights.size();++i)
{
// store old states.
vLocalLightStates.push_back(vLights[i].second->getOn());
vLights[i].second->setOn(false);
}
// activate exclude nodes:
for(UInt32 i = 0;i < _pStage->getMFExcludeNodes()->size();++i)
{
Node *exnode = _pStage->getExcludeNodes(i);
if(exnode != NULL)
{
if(vExclActive[i])
{
exnode->setTravMask(0);
}
}
}
UInt32 uiActiveLightCount = 0;
ShadowStageData::ShadowMapStore &vShadowMaps = _pStageData->getShadowMaps();
for(UInt32 i = 0;i < vLights.size();++i)
{
if(vLightStates[i] != 0)
{
if(_pStage->getGlobalShadowIntensity() != 0.0 ||
vLights[i].second->getShadowIntensity() != 0.0)
{
GLenum *buffers = NULL;
buffers = new GLenum[1];
buffers[0] = GL_COLOR_ATTACHMENT0_EXT;
Pnt3f lPos;
bool isDirLight;
Real32 sceneDiagLength;
if(vLights[i].second->getType() == PointLight::getClassType())
{
PointLight *tmpPoint;
tmpPoint =
dynamic_cast<PointLight *>(vLights[i].second.get());
lPos = tmpPoint->getPosition();
if(tmpPoint->getBeacon() != NULL)
{
Matrix m = tmpPoint->getBeacon()->getToWorld();
m.mult(lPos, lPos);
}
isDirLight = false;
Pnt3f center;
_pStageData->getLightRoot(i)->getVolume().getCenter(center);
Vec3f dir = lPos - center;
Real32 dirLength = dir.length();
Vec3f diff =
(_pStageData->getLightRoot(i)->getVolume().getMax() -
center);
Real32 diffLength = diff.length();
sceneDiagLength = dirLength + diffLength;
}
else if(vLights[i].second->getType() ==
SpotLight::getClassType())
{
SpotLight *tmpSpot;
//.........这里部分代码省略.........
示例3: createShadowFactorMapFBO
//.........这里部分代码省略.........
vLights[num].second->getType() == PointLight::getClassType())
{
texFactor = Real32(_width) / Real32(_height);
}
else
{
texFactor = 1.0;
}
Matrix shadowMatrix = LPM;
shadowMatrix.mult(LVM);
shadowMatrix.mult(iCVM);
Matrix shadowMatrix2 = LVM;
shadowMatrix2.mult(iCVM);
Real32 xFactor = 1.0;
Real32 yFactor = 1.0;
Pnt3f lPos;
bool isDirLight;
Real32 sceneDiagLength;
if(vLights[num].second->getType() == PointLight::getClassType())
{
PointLight *tmpPoint;
tmpPoint = dynamic_cast<PointLight *>(
vLights[num].second.get());
lPos = tmpPoint->getPosition();
if(tmpPoint->getBeacon() != NULL)
{
Matrix m = tmpPoint->getBeacon()->getToWorld();
m.mult(lPos, lPos);
}
isDirLight = false;
Pnt3f center;
_pStageData->getLightRoot(num)->getVolume().getCenter(center);
Vec3f dir = lPos - center;
Real32 dirLength = dir.length();
Vec3f diff = (_pStageData->getLightRoot(num)->getVolume
().getMax() - center);
Real32 diffLength = diff.length();
sceneDiagLength = dirLength + diffLength;
}
else if(vLights[num].second->getType() == SpotLight::getClassType())
{
SpotLight *tmpSpot;
tmpSpot = dynamic_cast<SpotLight *>(
vLights[num].second.get());
lPos = tmpSpot->getPosition();
if(tmpSpot->getBeacon() != NULL)
{
Matrix m = tmpSpot->getBeacon()->getToWorld();
m.mult(lPos, lPos);