A model's surfaces are now depth sorted together (except on world geometry)
This commit is contained in:
parent
af59009b56
commit
f64ee6b3b7
|
@ -67,11 +67,11 @@ void CRenderBucket::CSubBucket::Draw(const SViewInfo& rkViewInfo)
|
|||
{
|
||||
const SRenderablePtr& rkPtr = mRenderables[iPtr];
|
||||
|
||||
if (rkPtr.Command == eDrawMesh)
|
||||
rkPtr.pRenderable->Draw(Options, rkPtr.ComponentIndex, rkViewInfo);
|
||||
|
||||
else if (rkPtr.Command == eDrawSelection)
|
||||
// todo: DrawSelection probably shouldn't be a separate function anymore.
|
||||
if (rkPtr.Command == eDrawSelection)
|
||||
rkPtr.pRenderable->DrawSelection();
|
||||
else
|
||||
rkPtr.pRenderable->Draw(Options, rkPtr.ComponentIndex, rkPtr.Command, rkViewInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
enum ERenderCommand
|
||||
{
|
||||
eDrawMesh,
|
||||
eDrawOpaqueParts,
|
||||
eDrawTransparentParts,
|
||||
eDrawSelection
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef IRENDERABLE_H
|
||||
#define IRENDERABLE_H
|
||||
|
||||
#include "ERenderCommand.h"
|
||||
#include "FRenderOptions.h"
|
||||
#include "SViewInfo.h"
|
||||
#include <Common/types.h>
|
||||
|
@ -13,7 +14,7 @@ public:
|
|||
IRenderable() {}
|
||||
virtual ~IRenderable() {}
|
||||
virtual void AddToRenderer(CRenderer* pRenderer, const SViewInfo& rkViewInfo) = 0;
|
||||
virtual void Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, const SViewInfo& /*rkViewInfo*/) {}
|
||||
virtual void Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, ERenderCommand /*Command*/, const SViewInfo& /*rkViewInfo*/) {}
|
||||
virtual void DrawSelection() {}
|
||||
};
|
||||
|
||||
|
|
|
@ -35,26 +35,21 @@ void CCharacterNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkView
|
|||
CSkeleton *pSkel = mpCharacter->NodeSkeleton(mActiveCharSet);
|
||||
|
||||
if (pModel && rkViewInfo.ShowFlags.HasFlag(eShowObjectGeometry))
|
||||
{
|
||||
if (!pModel->HasTransparency(0))
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawMesh);
|
||||
else
|
||||
AddSurfacesToRenderer(pRenderer, pModel, 0, rkViewInfo, eMidground, false);
|
||||
}
|
||||
AddModelToRenderer(pRenderer, pModel, 0);
|
||||
|
||||
if (pSkel)
|
||||
{
|
||||
if (rkViewInfo.ShowFlags.HasFlag(eShowSkeletons))
|
||||
pRenderer->AddMesh(this, -2, AABox(), false, eDrawMesh, eForeground);
|
||||
pRenderer->AddMesh(this, 0, AABox(), false, eDrawMesh, eForeground);
|
||||
}
|
||||
}
|
||||
|
||||
void CCharacterNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo)
|
||||
void CCharacterNode::Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
CSkeleton *pSkel = mpCharacter->NodeSkeleton(mActiveCharSet);
|
||||
|
||||
// Draw skeleton
|
||||
if (ComponentIndex == -2)
|
||||
if (ComponentIndex == 0)
|
||||
{
|
||||
LoadModelMatrix();
|
||||
pSkel->Draw(Options, &mTransformData);
|
||||
|
@ -79,11 +74,7 @@ void CCharacterNode::Draw(FRenderOptions Options, int ComponentIndex, const SVie
|
|||
CGraphics::LoadIdentityBoneTransforms();
|
||||
|
||||
CModel *pModel = mpCharacter->NodeModel(mActiveCharSet);
|
||||
|
||||
if (ComponentIndex < 0)
|
||||
pModel->Draw(Options, 0);
|
||||
else
|
||||
pModel->DrawSurface(Options, ComponentIndex, 0);
|
||||
DrawModelParts(pModel, Options, 0, Command);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
virtual ENodeType NodeType();
|
||||
virtual void PostLoad();
|
||||
virtual void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
virtual void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
virtual void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
virtual SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo);
|
||||
|
||||
CVector3f BonePosition(u32 BoneID);
|
||||
|
|
|
@ -27,7 +27,7 @@ void CCollisionNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkView
|
|||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawSelection);
|
||||
}
|
||||
|
||||
void CCollisionNode::Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, const SViewInfo& rkViewInfo)
|
||||
void CCollisionNode::Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, ERenderCommand /*Command*/, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
if (!mpCollision) return;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ public:
|
|||
CCollisionNode(CScene *pScene, u32 NodeID, CSceneNode *pParent = 0, CCollisionMeshGroup *pCollision = 0);
|
||||
ENodeType NodeType();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo);
|
||||
void SetCollision(CCollisionMeshGroup *pCollision);
|
||||
};
|
||||
|
|
|
@ -41,7 +41,7 @@ void CLightNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo
|
|||
}
|
||||
}
|
||||
|
||||
void CLightNode::Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, const SViewInfo& rkViewInfo)
|
||||
void CLightNode::Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, ERenderCommand /*Command*/, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
CDrawUtil::DrawLightBillboard(mpLight->Type(), mpLight->Color(), mPosition, BillboardScale(), TintColor(rkViewInfo));
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ public:
|
|||
CLightNode(CScene *pScene, u32 NodeID, CSceneNode *pParent = 0, CLight *Light = 0);
|
||||
ENodeType NodeType();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& ViewInfo);
|
||||
void DrawSelection();
|
||||
void RayAABoxIntersectTest(CRayCollisionTester& Tester, const SViewInfo& ViewInfo);
|
||||
SRayIntersection RayNodeIntersectTest(const CRay &Ray, u32 AssetID, const SViewInfo& ViewInfo);
|
||||
|
|
|
@ -35,16 +35,27 @@ void CModelNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo
|
|||
if (!rkViewInfo.ViewFrustum.BoxInFrustum(AABox())) return;
|
||||
if (rkViewInfo.GameMode) return;
|
||||
|
||||
if (!mpModel->HasTransparency(mActiveMatSet))
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawMesh);
|
||||
// Transparent world models should have each surface processed separately
|
||||
if (mWorldModel && mpModel->HasTransparency(mActiveMatSet))
|
||||
{
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawOpaqueParts);
|
||||
|
||||
for (u32 iSurf = 0; iSurf < mpModel->GetSurfaceCount(); iSurf++)
|
||||
{
|
||||
if (mpModel->IsSurfaceTransparent(iSurf, mActiveMatSet))
|
||||
pRenderer->AddMesh(this, iSurf, mpModel->GetSurfaceAABox(iSurf).Transformed(Transform()), true, eDrawTransparentParts);
|
||||
}
|
||||
}
|
||||
|
||||
// Other models should just draw all transparent surfaces sequentially
|
||||
else
|
||||
AddSurfacesToRenderer(pRenderer, mpModel, mActiveMatSet, rkViewInfo);
|
||||
AddModelToRenderer(pRenderer, mpModel, mActiveMatSet);
|
||||
|
||||
if (mSelected)
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawSelection);
|
||||
}
|
||||
|
||||
void CModelNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo)
|
||||
void CModelNode::Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
if (!mpModel) return;
|
||||
if (mForceAlphaOn) Options = (FRenderOptions) (Options & ~eNoAlpha);
|
||||
|
@ -86,8 +97,8 @@ void CModelNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewInf
|
|||
if (mpModel->IsSkinned())
|
||||
CGraphics::LoadIdentityBoneTransforms();
|
||||
|
||||
if (ComponentIndex < 0)
|
||||
mpModel->Draw(Options, mActiveMatSet);
|
||||
if (ComponentIndex == -1)
|
||||
DrawModelParts(mpModel, Options, mActiveMatSet, Command);
|
||||
else
|
||||
mpModel->DrawSurface(Options, ComponentIndex, mActiveMatSet);
|
||||
|
||||
|
@ -96,11 +107,7 @@ void CModelNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewInf
|
|||
CDrawUtil::UseColorShader(mScanOverlayColor);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ZERO);
|
||||
Options |= eNoMaterialSetup;
|
||||
|
||||
if (ComponentIndex < 0)
|
||||
mpModel->Draw(Options, 0);
|
||||
else
|
||||
mpModel->DrawSurface(Options, ComponentIndex, mActiveMatSet);
|
||||
DrawModelParts(mpModel, Options, 0, Command);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
virtual ENodeType NodeType();
|
||||
virtual void PostLoad();
|
||||
virtual void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
virtual void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
virtual void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
virtual void DrawSelection();
|
||||
virtual void RayAABoxIntersectTest(CRayCollisionTester& Tester, const SViewInfo& rkViewInfo);
|
||||
virtual SRayIntersection RayNodeIntersectTest(const CRay &Ray, u32 AssetID, const SViewInfo& rkViewInfo);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "Core/Render/CDrawUtil.h"
|
||||
#include "Core/Resource/CGameArea.h"
|
||||
#include "Core/Resource/CResCache.h"
|
||||
#include <Common/Assert.h>
|
||||
#include <Math/CTransform4f.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -213,6 +214,43 @@ void CSceneNode::LoadLights(const SViewInfo& rkViewInfo)
|
|||
CGraphics::UpdateLightBlock();
|
||||
}
|
||||
|
||||
void CSceneNode::AddModelToRenderer(CRenderer *pRenderer, CModel *pModel, u32 MatSet)
|
||||
{
|
||||
ASSERT(pModel);
|
||||
|
||||
if (!pModel->HasTransparency(MatSet))
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawMesh);
|
||||
|
||||
else
|
||||
{
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawOpaqueParts);
|
||||
pRenderer->AddMesh(this, -1, AABox(), true, eDrawTransparentParts);
|
||||
}
|
||||
}
|
||||
|
||||
void CSceneNode::DrawModelParts(CModel *pModel, FRenderOptions Options, u32 MatSet, ERenderCommand RenderCommand)
|
||||
{
|
||||
// Common rendering functionality
|
||||
if (RenderCommand == eDrawMesh)
|
||||
pModel->Draw(Options, MatSet);
|
||||
|
||||
else
|
||||
{
|
||||
bool DrawOpaque = (RenderCommand == eDrawMesh || RenderCommand == eDrawOpaqueParts);
|
||||
bool DrawTransparent = (RenderCommand == eDrawMesh || RenderCommand == eDrawTransparentParts);
|
||||
|
||||
for (u32 iSurf = 0; iSurf < pModel->GetSurfaceCount(); iSurf++)
|
||||
{
|
||||
bool ShouldRender = ( (DrawOpaque && DrawTransparent) ||
|
||||
(DrawOpaque && !pModel->IsSurfaceTransparent(iSurf, MatSet)) ||
|
||||
(DrawTransparent && pModel->IsSurfaceTransparent(iSurf, MatSet)) );
|
||||
|
||||
if (ShouldRender)
|
||||
pModel->DrawSurface(Options, iSurf, MatSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSceneNode::DrawBoundingBox() const
|
||||
{
|
||||
CDrawUtil::DrawWireCube(AABox(), CColor::skWhite);
|
||||
|
@ -224,21 +262,6 @@ void CSceneNode::DrawRotationArrow() const
|
|||
spArrowModel->Draw(eNoRenderOptions, 0);
|
||||
}
|
||||
|
||||
void CSceneNode::AddSurfacesToRenderer(CRenderer *pRenderer, CModel *pModel, u32 MatSet, const SViewInfo& rkViewInfo, EDepthGroup DepthGroup /*= eMidground*/, bool DoFrustumTest /*= true*/)
|
||||
{
|
||||
u32 SurfaceCount = pModel->GetSurfaceCount();
|
||||
|
||||
for (u32 iSurf = 0; iSurf < SurfaceCount; iSurf++)
|
||||
{
|
||||
CAABox TransformedBox = pModel->GetSurfaceAABox(iSurf).Transformed(Transform());
|
||||
|
||||
if (!DoFrustumTest || rkViewInfo.ViewFrustum.BoxInFrustum(TransformedBox))
|
||||
{
|
||||
pRenderer->AddMesh(this, (int) iSurf, TransformedBox, pModel->IsSurfaceTransparent(iSurf, MatSet), eDrawMesh, DepthGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ************ TRANSFORM ************
|
||||
void CSceneNode::Translate(const CVector3f& rkTranslation, ETransformSpace TransformSpace)
|
||||
{
|
||||
|
|
|
@ -78,9 +78,10 @@ public:
|
|||
void LoadModelMatrix();
|
||||
void BuildLightList(CGameArea *pArea);
|
||||
void LoadLights(const SViewInfo& rkViewInfo);
|
||||
void AddModelToRenderer(CRenderer *pRenderer, CModel *pModel, u32 MatSet);
|
||||
void DrawModelParts(CModel *pModel, FRenderOptions Options, u32 MatSet, ERenderCommand RenderCommand);
|
||||
void DrawBoundingBox() const;
|
||||
void DrawRotationArrow() const;
|
||||
void AddSurfacesToRenderer(CRenderer *pRenderer, CModel *pModel, u32 MatSet, const SViewInfo& rkViewInfo, EDepthGroup DepthGroup = eMidground, bool DoFrustumTest = true);
|
||||
|
||||
// Transform
|
||||
void Translate(const CVector3f& rkTranslation, ETransformSpace TransformSpace);
|
||||
|
|
|
@ -77,17 +77,14 @@ void CScriptAttachNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkV
|
|||
|
||||
if (rkViewInfo.ViewFrustum.BoxInFrustum(AABox()))
|
||||
{
|
||||
if (pModel->HasTransparency(0))
|
||||
AddSurfacesToRenderer(pRenderer, pModel, 0, rkViewInfo);
|
||||
else
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawMesh);
|
||||
AddModelToRenderer(pRenderer, pModel, 0);
|
||||
|
||||
if (mpParent->IsSelected() && !rkViewInfo.GameMode)
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawSelection);
|
||||
}
|
||||
}
|
||||
|
||||
void CScriptAttachNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo)
|
||||
void CScriptAttachNode::Draw(FRenderOptions Options, int /*ComponentIndex*/, ERenderCommand Command, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
LoadModelMatrix();
|
||||
mpParent->LoadLights(rkViewInfo);
|
||||
|
@ -98,11 +95,7 @@ void CScriptAttachNode::Draw(FRenderOptions Options, int ComponentIndex, const S
|
|||
CGraphics::sPixelBlock.TintColor = mpParent->TintColor(rkViewInfo);
|
||||
CGraphics::sPixelBlock.TevColor = CColor::skWhite;
|
||||
CGraphics::UpdatePixelBlock();
|
||||
|
||||
if (ComponentIndex < 0)
|
||||
Model()->Draw(Options, 0);
|
||||
else
|
||||
Model()->DrawSurface(Options, ComponentIndex, 0);
|
||||
DrawModelParts(Model(), Options, 0, Command);
|
||||
}
|
||||
|
||||
void CScriptAttachNode::DrawSelection()
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
|
||||
ENodeType NodeType() { return eScriptAttachNode; }
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
void DrawSelection();
|
||||
void RayAABoxIntersectTest(CRayCollisionTester& rTester, const SViewInfo& rkViewInfo);
|
||||
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo);
|
||||
|
|
|
@ -151,14 +151,8 @@ void CScriptNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInf
|
|||
|
||||
if (!pModel)
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawMesh);
|
||||
|
||||
else
|
||||
{
|
||||
if (!pModel->HasTransparency(0))
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawMesh);
|
||||
else
|
||||
AddSurfacesToRenderer(pRenderer, pModel, 0, rkViewInfo);
|
||||
}
|
||||
AddModelToRenderer(pRenderer, pModel, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -175,9 +169,9 @@ void CScriptNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInf
|
|||
}
|
||||
}
|
||||
|
||||
void CScriptNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo)
|
||||
void CScriptNode::Draw(FRenderOptions Options, int /*ComponentIndex*/, ERenderCommand Command, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
if (!mpInstance || !mpDisplayAsset) return;
|
||||
if (!mpInstance) return;
|
||||
|
||||
// Draw model
|
||||
if (UsesModel())
|
||||
|
@ -219,11 +213,7 @@ void CScriptNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewIn
|
|||
|
||||
CGraphics::sPixelBlock.TintColor = TintColor(rkViewInfo);
|
||||
CGraphics::UpdatePixelBlock();
|
||||
|
||||
if (ComponentIndex < 0)
|
||||
pModel->Draw(Options, 0);
|
||||
else
|
||||
pModel->DrawSurface(Options, ComponentIndex, 0);
|
||||
DrawModelParts(pModel, Options, 0, Command);
|
||||
}
|
||||
|
||||
// If no model or billboard, default to drawing a purple box
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
void PostLoad();
|
||||
void OnTransformed();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
void DrawSelection();
|
||||
void RayAABoxIntersectTest(CRayCollisionTester& rTester, const SViewInfo& rkViewInfo);
|
||||
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo);
|
||||
|
|
|
@ -52,7 +52,7 @@ void CStaticNode::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInf
|
|||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawSelection);
|
||||
}
|
||||
|
||||
void CStaticNode::Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo)
|
||||
void CStaticNode::Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand /*Command*/, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
if (!mpModel) return;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
ENodeType NodeType();
|
||||
void PostLoad();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
void DrawSelection();
|
||||
void RayAABoxIntersectTest(CRayCollisionTester& rTester, const SViewInfo& rkViewInfo);
|
||||
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo);
|
||||
|
|
|
@ -234,7 +234,7 @@ void CDamageableTriggerExtra::AddToRenderer(CRenderer *pRenderer, const SViewInf
|
|||
}
|
||||
}
|
||||
|
||||
void CDamageableTriggerExtra::Draw(FRenderOptions Options, int /*ComponentIndex*/, const SViewInfo& rkViewInfo)
|
||||
void CDamageableTriggerExtra::Draw(FRenderOptions Options, int /*ComponentIndex*/, ERenderCommand /*Command*/, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
LoadModelMatrix();
|
||||
CGraphics::sPixelBlock.TintColor = mpParent->TintColor(rkViewInfo);
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
void PropertyModified(IProperty *pProperty);
|
||||
bool ShouldDrawNormalAssets();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
void DrawSelection();
|
||||
void RayAABoxIntersectTest(CRayCollisionTester& rTester, const SViewInfo& rkViewInfo);
|
||||
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
|
|
|
@ -64,17 +64,14 @@ void CDoorExtra::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo
|
|||
|
||||
if (mpParent->IsVisible() && rkViewInfo.ViewFrustum.BoxInFrustum(AABox()))
|
||||
{
|
||||
if (mpShieldModel->HasTransparency(0))
|
||||
AddSurfacesToRenderer(pRenderer, mpShieldModel, 0, rkViewInfo);
|
||||
else
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawMesh);
|
||||
AddModelToRenderer(pRenderer, mpShieldModel, 0);
|
||||
|
||||
if (mpParent->IsSelected() && !rkViewInfo.GameMode)
|
||||
pRenderer->AddMesh(this, -1, AABox(), false, eDrawSelection);
|
||||
}
|
||||
}
|
||||
|
||||
void CDoorExtra::Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo)
|
||||
void CDoorExtra::Draw(FRenderOptions Options, int /*ComponentIndex*/, ERenderCommand Command, const SViewInfo& rkViewInfo)
|
||||
{
|
||||
LoadModelMatrix();
|
||||
mpParent->LoadLights(rkViewInfo);
|
||||
|
@ -87,11 +84,7 @@ void CDoorExtra::Draw(FRenderOptions Options, int ComponentIndex, const SViewInf
|
|||
CGraphics::sPixelBlock.TintColor = Tint;
|
||||
CGraphics::sPixelBlock.TevColor = CColor::skWhite;
|
||||
CGraphics::UpdatePixelBlock();
|
||||
|
||||
if (ComponentIndex < 0)
|
||||
mpShieldModel->Draw(Options, 0);
|
||||
else
|
||||
mpShieldModel->DrawSurface(Options, ComponentIndex, 0);
|
||||
DrawModelParts(mpShieldModel, Options, 0, Command);
|
||||
}
|
||||
|
||||
void CDoorExtra::DrawSelection()
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
explicit CDoorExtra(CScriptObject *pInstance, CScene *pScene, CScriptNode *pParent = 0);
|
||||
void PropertyModified(IProperty *pProperty);
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
void DrawSelection();
|
||||
void RayAABoxIntersectTest(CRayCollisionTester& rTester, const SViewInfo& rkViewInfo);
|
||||
SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo);
|
||||
|
|
|
@ -36,7 +36,7 @@ void CRadiusSphereExtra::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rk
|
|||
}
|
||||
}
|
||||
|
||||
void CRadiusSphereExtra::Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, const SViewInfo& /*rkViewInfo*/)
|
||||
void CRadiusSphereExtra::Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, ERenderCommand /*Command*/, const SViewInfo& /*rkViewInfo*/)
|
||||
{
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
|
|
|
@ -12,7 +12,7 @@ class CRadiusSphereExtra : public CScriptExtra
|
|||
public:
|
||||
explicit CRadiusSphereExtra(CScriptObject *pInstance, CScene *pScene, CScriptNode *pParent = 0);
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
CColor Color() const;
|
||||
CAABox Bounds() const;
|
||||
};
|
||||
|
|
|
@ -172,7 +172,7 @@ void CWaypointExtra::AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkView
|
|||
}
|
||||
}
|
||||
|
||||
void CWaypointExtra::Draw(FRenderOptions /*Options*/, int ComponentIndex, const SViewInfo& /*rkViewInfo*/)
|
||||
void CWaypointExtra::Draw(FRenderOptions /*Options*/, int ComponentIndex, ERenderCommand /*Command*/, const SViewInfo& /*rkViewInfo*/)
|
||||
{
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
void OnTransformed();
|
||||
void LinksModified();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
CColor TevColor();
|
||||
};
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ void CGizmo::AddToRenderer(CRenderer *pRenderer, const SViewInfo&)
|
|||
}
|
||||
}
|
||||
|
||||
void CGizmo::Draw(FRenderOptions /*Options*/, int ComponentIndex, const SViewInfo& /*rkViewInfo*/)
|
||||
void CGizmo::Draw(FRenderOptions /*Options*/, int ComponentIndex, ERenderCommand /*Command*/, const SViewInfo& /*rkViewInfo*/)
|
||||
{
|
||||
// Determine which SModelPart array to use
|
||||
if (ComponentIndex >= (int) mNumCurrentParts) return;
|
||||
|
|
|
@ -128,7 +128,7 @@ public:
|
|||
~CGizmo();
|
||||
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo);
|
||||
|
||||
void IncrementSize();
|
||||
void DecrementSize();
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
pRenderer->AddMesh(this, 0, CAABox::skOne, false, eDrawMesh);
|
||||
}
|
||||
|
||||
void Draw(FRenderOptions, int, const SViewInfo&)
|
||||
void Draw(FRenderOptions, int, ERenderCommand, const SViewInfo&)
|
||||
{
|
||||
CDrawUtil::DrawGrid();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue