本文整理汇总了C++中CameraPtr::GetDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ CameraPtr::GetDirection方法的具体用法?C++ CameraPtr::GetDirection怎么用?C++ CameraPtr::GetDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CameraPtr
的用法示例。
在下文中一共展示了CameraPtr::GetDirection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDirection
const Vec3 GetDirection() const
{
if (mOverridingCamera){
return mOverridingCamera->GetDirection();
}
return mTransformation.GetMatrix().Column(1);
}
示例2: EditThisParticle
void EditThisParticle(const char* file){
if (mEditingParticle)
mEditingParticle->StopImmediate();
bool numeric = IsNumeric(file);
std::string fullpath;
if (numeric)
{
fullpath = FindParticleNameWithID("data/particles", StringConverter::ParseInt(file));
}
else
{
fullpath = file;
fullpath += ".particle";
}
ParticleEmitterPtr pnew = 0;
if (strcmp(file, "0"))
pnew = GetParticleEmitter(fullpath.c_str());
auto& renderer = Renderer::GetInstance();
if (pnew)
{
mEditingParticle = pnew;
Logger::Log(FB_DEFAULT_LOG_ARG, FormatString("Editing : %s", fullpath.c_str()).c_str());
auto rt = renderer.GetMainRenderTarget();
assert(rt);
if (!mOriginalCamera){
mOriginalCamera = rt->ReplaceCamera(mOverridingCamera);
*mOverridingCamera = *mOriginalCamera;
}
mEditingParticle->SetPosition(mOverridingCamera->GetPosition() + mOverridingCamera->GetDirection() * 4.f);
mEditingParticle->Active(true);
mOverridingCamera->SetTarget(mEditingParticle);
mOverridingCamera->SetEnalbeInput(true);
}
else if (strcmp(file, "0") == 0)
{
mEditingParticle->StopImmediate();
mEditingParticle = 0;
auto rt = renderer.GetMainRenderTarget();
assert(rt);
if (mOriginalCamera){
rt->ReplaceCamera(mOriginalCamera);
mOriginalCamera = 0;
}
Logger::Log(FB_ERROR_LOG_ARG, "Exit particle editor");
}
else
{
Logger::Log(FB_ERROR_LOG_ARG, FormatString("Cannot find the particle %s", fullpath.c_str()).c_str());
}
}
示例3: Draw
//----------------------------------------------------------------------------
void ConvexRegionManager::Draw (Renderer& rkRenderer)
{
CameraPtr spCamera = rkRenderer.GetCamera();
Vector3f kEye = spCamera->GetLocation();
if ( m_bUseEyePlusNear )
kEye += spCamera->GetFrustumNear()*spCamera->GetDirection();
ConvexRegion* pkRegion = GetContainingRegion(kEye);
if ( pkRegion )
{
// inside the set of regions, start drawing with region of camera
pkRegion->Draw(rkRenderer);
}
else
{
// outside the set of regions, draw the outside scene (if it exists)
if ( GetOutside() )
GetOutside()->Draw(rkRenderer);
}
}