本文整理汇总了C++中VisRenderContext_cl::SetCustomProjectionMatrix方法的典型用法代码示例。如果您正苦于以下问题:C++ VisRenderContext_cl::SetCustomProjectionMatrix方法的具体用法?C++ VisRenderContext_cl::SetCustomProjectionMatrix怎么用?C++ VisRenderContext_cl::SetCustomProjectionMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisRenderContext_cl
的用法示例。
在下文中一共展示了VisRenderContext_cl::SetCustomProjectionMatrix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDoRenderLoop
// TODO: This doesn't handle opaque fullbright surfaces correctly yet, and translucent fullbright surfaces are simply ignored.
void MirrorRenderLoop_cl::OnDoRenderLoop(void *pUserData)
{
INSERT_PERF_MARKER_SCOPE("MirrorRenderLoop_cl::OnDoRenderLoop");
#if defined (WIN32) || defined (_VISION_XENON) || defined (_VISION_PS3) || defined(_VISION_PSP2) || defined(_VISION_WIIU)
if (Vision::Editor.GetIgnoreAdvancedEffects())
{
// force a black reflection because it won't work with orthographic views
Vision::RenderLoopHelper.ClearScreen(VisRenderLoopHelper_cl::VCTF_All, V_RGBA_BLACK);
return;
}
#endif
VisRenderContext_cl *pContext = Vision::Contexts.GetCurrentContext();
const int iRenderFlags = pContext->GetRenderFlags();
const float fFarClipDist = m_pMirror->GetActualFarClipDistance();
const VFogParameters &fog = Vision::World.GetFogParameters();
VColorRef clearColor = (fog.depthMode != VFogParameters::Off) ? fog.iDepthColor : Vision::Renderer.GetDefaultClearColor();
Vision::RenderLoopHelper.ClearScreen(VisRenderLoopHelper_cl::VCTF_All, clearColor);
// set the oblique clipping plane...
pContext->SetCustomProjectionMatrix (m_pMirror->GetObliqueClippingProjection().getPointer ());
const VisStaticGeometryInstanceCollection_cl *pVisibleGeoInstancesPrimaryOpaquePass;
const VisStaticGeometryInstanceCollection_cl *pVisibleGeoInstancesSecondaryOpaquePass;
const VisStaticGeometryInstanceCollection_cl *pVisibleGeoInstancesTransparentPass;
const VisEntityCollection_cl *pVisEntities;
// === Visibility Determination ===
IVisVisibilityCollector_cl *pVisColl = VisRenderContext_cl::GetCurrentContext()->GetVisibilityCollector();
if (pVisColl == NULL)
return;
const VisVisibilityObjectCollection_cl *pVisObjectCollection = pVisColl->GetVisibleVisObjects();
hkvAlignedBBox box;
int iVoCount = m_pMirror->GetVisibilityObjectCount();
int iFrustumCount = 0;
bool bUseCommonFrustum = false;
// === Determine Scissor Rect ===
hkvVec2 vMinScreenSpace, vMaxScreenSpace;
const hkvAlignedBBox &worldSpaceBox = m_pMirror->GetBoundingBox();
hkvVec3 vCorners[8];
worldSpaceBox.getCorners (vCorners);
VRectanglef scissorRect;
bool bUseScissorRect = true;
for (int i=0; i<8; i++)
{
float x2d, y2d;
BOOL bInFrontOfCamera = pContext->Project2D(vCorners[i], x2d, y2d);
if (bInFrontOfCamera)
{
scissorRect.Add(hkvVec2(x2d, y2d));
}
else
{
bUseScissorRect = false;
break;
}
}
if (bUseScissorRect)
Vision::RenderLoopHelper.SetScissorRect(&scissorRect);
for (int iVo = 0; iVo < iVoCount; iVo++)
{
VisVisibilityObject_cl *pVisObj = m_pMirror->GetVisibilityObject(iVo);
if (pVisObj != NULL && pVisObj->WasVisibleInAnyLastFrame())
{
if (iFrustumCount <= MAX_SEPARATE_FRUSTA)
{
const hkvAlignedBBox &voBox = pVisObj->GetWorldSpaceBoundingBox();
box.expandToInclude(voBox);
if (m_Frustum[iFrustumCount].Set(pContext->GetCamera()->GetPosition(), voBox, true, fFarClipDist))
{
iFrustumCount++;
}
else
{
bUseCommonFrustum = true;
}
}
else
{
const hkvAlignedBBox &voBox = pVisObj->GetWorldSpaceBoundingBox();
box.expandToInclude(voBox);
bUseCommonFrustum = true;
}
}
}
if (bUseCommonFrustum)
//.........这里部分代码省略.........