mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-15 16:16:14 +00:00
Set up game-neutral collision materials; Jump Not Allowed flag now flags that surface as unstandable; other minor fixes
This commit is contained in:
@@ -329,14 +329,23 @@ void CDrawUtil::UseTextureShader(const CColor& TintColor)
|
||||
CMaterial::KillCachedMaterial();
|
||||
}
|
||||
|
||||
void CDrawUtil::UseCollisionShader(const CColor& TintColor /*= CColor::skWhite*/)
|
||||
void CDrawUtil::UseCollisionShader(bool IsFloor, bool IsUnstandable, const CColor& TintColor /*= CColor::skWhite*/)
|
||||
{
|
||||
Init();
|
||||
mpCollisionShader->SetCurrent();
|
||||
|
||||
// Force blend mode to opaque + set alpha to 0 to ensure collision geometry isn't bloomed
|
||||
glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ZERO, GL_ZERO);
|
||||
|
||||
static GLuint TintColorLoc = mpCollisionShader->GetUniformLocation("TintColor");
|
||||
glUniform4f(TintColorLoc, TintColor.R, TintColor.G, TintColor.B, TintColor.A);
|
||||
|
||||
static GLuint IsFloorLoc = mpCollisionShader->GetUniformLocation("IsFloor");
|
||||
glUniform1i(IsFloorLoc, IsFloor ? 1 : 0);
|
||||
|
||||
static GLuint IsUnstandableLoc = mpCollisionShader->GetUniformLocation("IsUnstandable");
|
||||
glUniform1i(IsUnstandableLoc, IsUnstandable ? 1 : 0);
|
||||
|
||||
CMaterial::KillCachedMaterial();
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
static void UseColorShaderLighting(const CColor& Color);
|
||||
static void UseTextureShader();
|
||||
static void UseTextureShader(const CColor& TintColor);
|
||||
static void UseCollisionShader(const CColor& TintColor = CColor::skWhite);
|
||||
static void UseCollisionShader(bool IsFloor, bool IsUnstandable, const CColor& TintColor = CColor::skWhite);
|
||||
|
||||
static CShader* GetTextShader();
|
||||
static void LoadCheckerboardTexture(u32 GLTextureUnit);
|
||||
|
||||
@@ -6,21 +6,24 @@
|
||||
#include <Math/CMatrix4f.h>
|
||||
#include <Math/CRay.h>
|
||||
|
||||
enum ECollisionDrawMode
|
||||
{
|
||||
eCDM_Default,
|
||||
eCDM_TintSurfaceType
|
||||
};
|
||||
|
||||
struct SCollisionRenderSettings
|
||||
{
|
||||
ECollisionDrawMode DrawMode;
|
||||
u64 HighlightMask;
|
||||
u64 HideMask;
|
||||
bool DrawWireframe;
|
||||
bool DrawBackfaces;
|
||||
bool DrawAreaCollisionBounds;
|
||||
bool TintWithSurfaceColor;
|
||||
bool TintUnwalkableTris;
|
||||
|
||||
SCollisionRenderSettings()
|
||||
: DrawMode(eCDM_TintSurfaceType), HighlightMask(0), HideMask(0), DrawWireframe(false) {}
|
||||
: HighlightMask(0)
|
||||
, HideMask(0)
|
||||
, DrawWireframe(true)
|
||||
, DrawBackfaces(false)
|
||||
, DrawAreaCollisionBounds(true)
|
||||
, TintWithSurfaceColor(true)
|
||||
, TintUnwalkableTris(false) {}
|
||||
};
|
||||
|
||||
struct SViewInfo
|
||||
|
||||
Reference in New Issue
Block a user