Commit ce1dd336 authored by Byurrrer's avatar Byurrrer

отрефакторил либу растительности, оптимизировал трассировку путей и...

отрефакторил либу растительности, оптимизировал трассировку путей и обнаружение столкновений бокса с растительностью, внес изменения в генерацию растительности по маске, теперь все фиксированно, поправил несколько багов в растительности, поправил автодокументацию растительности, изменил именование нескольких функций растительности, немного изменился формат файла растительности
parent 9c00f694
......@@ -294,6 +294,7 @@ origin = -3.900000 -2.750000 22.000000
rotation = 0.000000 0.000000 0.000000 1.000000
[ent_22]
skin = 0
playAnimNext = 1
playAnim = 1
is_static = 1
......
[level]
geometry = stalker_atp.geom
green = stalker_atp.green
type = outdoor
entity = stalker_atp.ent
aigrid = stalker_atp.aigrid
......
......@@ -70,10 +70,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxwincreator", "..\..\sxwin
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxleveleditor", "..\..\sxleveleditor\vs2013\sxleveleditor.vcxproj", "{A2B9EACA-69C1-4E9D-AF3C-704608DB57DE}"
ProjectSection(ProjectDependencies) = postProject
{D381001E-C1FF-415F-A269-5264AD9013D5} = {D381001E-C1FF-415F-A269-5264AD9013D5}
{0292BE32-298E-4E18-BC42-5A39F9487EBA} = {0292BE32-298E-4E18-BC42-5A39F9487EBA}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxmaterialeditor", "..\..\sxmaterialeditor\vs2013\sxmaterialeditor.vcxproj", "{9C34362D-7FA6-4BD1-A48B-8FDE541344B0}"
ProjectSection(ProjectDependencies) = postProject
{AFBF200A-9260-4469-AE64-DCB42C796DD6} = {AFBF200A-9260-4469-AE64-DCB42C796DD6}
{D381001E-C1FF-415F-A269-5264AD9013D5} = {D381001E-C1FF-415F-A269-5264AD9013D5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxconsole", "..\..\sxconsole\vs2013\sxconsole.vcxproj", "{CEFD4247-0B36-4268-B455-C1E826173005}"
EndProject
......@@ -150,6 +155,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxdecals", "..\..\sxdecals\
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sxparticleseditor", "..\..\sxparticleseditor\vs2013\sxparticleseditor.vcxproj", "{B66C63CA-62E0-472F-9D24-070CAC7C8B12}"
ProjectSection(ProjectDependencies) = postProject
{AFBF200A-9260-4469-AE64-DCB42C796DD6} = {AFBF200A-9260-4469-AE64-DCB42C796DD6}
{D381001E-C1FF-415F-A269-5264AD9013D5} = {D381001E-C1FF-415F-A269-5264AD9013D5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BulletWorldImporter", "..\..\..\sdks\bullet3\build3\vs2010\BulletWorldImporter.vcxproj", "{F2DD3789-7BC9-D241-8C8D-2179933B30DD}"
ProjectSection(ProjectDependencies) = postProject
......
......@@ -2726,7 +2726,7 @@ void CAIGrid::renderGraphPoints(const float3 * viewpos, float dist)
float4x4 wvp = SMMatrixIdentity() * float4x4(tmpview) * float4x4(tmpproj);
wvp = SMMatrixTranspose(wvp);
SGCore_ShaderSetVRF(SHADER_TYPE_VERTEX, m_idVS, "WorldViewProjection", &wvp);
SGCore_ShaderSetVRF(SHADER_TYPE_VERTEX, m_idVS, "g_mWVP", &wvp);
m_pDXDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 4, 0, 2);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -155,12 +155,13 @@ SX_LIB_API void SGreen_SetFuncIntersect(g_phy_intersect fnFunc)
SX_LIB_API ID SGreen_AddGreen(
const char *szName,
const char *szPathMask,
bool shouldAveragedRGB,
float fCountMax,
const char *szPathLod0, const char *szPathLod1, const char *szPathLod2,
const char *szNavMesh)
{
GEOM_PRECOND(-1);
return g_pGreen->init(szName, szPathMask, fCountMax, szPathLod0, szPathLod1, szPathLod2, szNavMesh);
return g_pGreen->generate(szName, szPathMask, shouldAveragedRGB, fCountMax, szPathLod0, szPathLod1, szPathLod2, szNavMesh);
}
SX_LIB_API ID SGreen_AddObject(ID idGreen, float3 *pPos, ID *pIDsplit)
......@@ -193,22 +194,22 @@ SX_LIB_API void SGreen_DelGreen(ID idGreen)
g_pGreen->deleteGreen(idGreen);
}
SX_LIB_API ID SGreen_AddArrForCom()
SX_LIB_API ID SGreen_AddVisCaclObj()
{
GEOM_PRECOND(-1);
return g_pGreen->addArrForCom();
return g_pGreen->addVisCaclObj();
}
SX_LIB_API bool SGreen_ExistsArrForCom(ID idGreen)
SX_LIB_API bool SGreen_ExistsVisCaclObj(ID idVisCaclObj)
{
GEOM_PRECOND(false);
return g_pGreen->existsArrForCom(idGreen);
return g_pGreen->existsVisCaclObj(idVisCaclObj);
}
SX_LIB_API void SGreen_DelArrForCom(ID idArr)
SX_LIB_API void SGreen_DelVisCaclObj(ID idVisCaclObj)
{
GEOM_PRECOND(_VOID);
g_pGreen->deleteArrForCom(idArr);
g_pGreen->deleteVisCaclObj(idVisCaclObj);
}
SX_LIB_API void SGreen_Save(const char *szPath)
......@@ -229,25 +230,25 @@ SX_LIB_API void SGreen_Clear()
g_pGreen->clear();
}
SX_LIB_API void SGreen_ComVisible(const IFrustum* frustum, float3 *pViewPos, ID idArr)
SX_LIB_API void SGreen_ComVisible(const IFrustum* frustum, const float3 *pViewPos, ID idVisCaclObj)
{
GEOM_PRECOND(_VOID);
g_pGreen->comArrIndeces(frustum, pViewPos, idArr);
g_pGreen->comArrIndeces(frustum, pViewPos, idVisCaclObj);
}
SX_LIB_API void SGreen_Render(DWORD timeDelta, float3 *pViewPos, GREEN_TYPE type, ID idArr)
SX_LIB_API void SGreen_Render(DWORD timeDelta, const float3 *pViewPos, GREEN_TYPE type, ID idVisCaclObj)
{
GEOM_PRECOND(_VOID);
g_pGreen->render(timeDelta, pViewPos, type, idArr);
g_pGreen->render(timeDelta, pViewPos, type, idVisCaclObj);
}
SX_LIB_API void SGreen_RenderSingly(DWORD timeDelta, float3 *pViewPos, ID idGreen, ID idTexture)
SX_LIB_API void SGreen_RenderSingly(DWORD timeDelta, const float3 *pViewPos, ID idGreen, ID idTexture)
{
GEOM_PRECOND(_VOID);
g_pGreen->renderSingly(timeDelta, pViewPos, idGreen, idTexture);
}
SX_LIB_API void SGreen_RenderObject(DWORD timeDelta, float3 *pViewPos, ID idGreen, ID idSplit, ID idObj, ID idTexture)
SX_LIB_API void SGreen_RenderObject(DWORD timeDelta, const float3 *pViewPos, ID idGreen, ID idSplit, ID idObj, ID idTexture)
{
GEOM_PRECOND(_VOID);
g_pGreen->renderObject(timeDelta, pViewPos, idGreen, idSplit, idObj, idTexture);
......@@ -353,13 +354,13 @@ SX_LIB_API void SGreen_ClearNavMeshAndTransform(float3_t **ppArrVertex, int32_t
mem_delete_a(pArrCountIndex);
}
SX_LIB_API bool SGreen_TraceBeam(float3 *pStart, float3 *pDir, float3 *pResult, ID *pIDgreen, ID *pIDsplits, ID *pIDobj, ID *pIDmtl)
SX_LIB_API bool SGreen_TraceBeam(const float3 *pStart, const float3 *pDir, float3 *pResult, ID *pIDgreen, ID *pIDsplits, ID *pIDobj, ID *pIDmtl)
{
GEOM_PRECOND(false);
return g_pGreen->traceBeam(pStart, pDir, pResult, pIDgreen, pIDsplits, pIDobj, pIDmtl);
}
SX_LIB_API bool SGreen_GetOccurencessLeafGrass(float3 *pMin, float3 *pMax, int iPhysicMtl)
SX_LIB_API bool SGreen_GetOccurencessLeafGrass(const float3 *pMin, const float3 *pMax, int iPhysicMtl)
{
GEOM_PRECOND(false);
return g_pGreen->getOccurencessLeafGrass(pMin, pMax, iPhysicMtl);
......
This diff is collapsed.
......@@ -107,6 +107,7 @@ void rfunc::ComDeviceLost(bool isSetWindowSize)
//сбрасываем все что необходимо для восстановления устройства
SGCore_OnLostDevice();
SGeom_OnLostDevice();
SGreen_OnLostDevice();
SLight_OnLostDevice();
SMtrl_OnLostDevice();
SPE_OnLostDevice();
......@@ -129,6 +130,7 @@ void rfunc::ComDeviceLost(bool isSetWindowSize)
SGCore_OnResetDevice();
SLight_OnResetDevice();
SMtrl_OnResetDevice();
SGreen_OnResetDevice();
SGeom_OnResetDevice();
SPE_OnResetDevice();
SXGame_OnResetDevice();
......@@ -155,7 +157,7 @@ void rfunc::ComVisibleForLight()
SLight_SetIDArr(i, RENDER_IDARRCOM_GEOM, k, SGeom_ModelsAddArrForCom());
if (SLight_GetIDArr(i, RENDER_IDARRCOM_GREEN, k) <= -1)
SLight_SetIDArr(i, RENDER_IDARRCOM_GREEN, k, SGreen_AddArrForCom());
SLight_SetIDArr(i, RENDER_IDARRCOM_GREEN, k, SGreen_AddVisCaclObj());
if (SLight_GetIDArr(i, RENDER_IDARRCOM_ANIM, k) <= -1)
SLight_SetIDArr(i, RENDER_IDARRCOM_ANIM, k, SXAnim_ModelsAddArrForCom());
......@@ -177,7 +179,7 @@ void rfunc::ComVisibleForLight()
SLight_SetIDArr(i, RENDER_IDARRCOM_GEOM, 0, SGeom_ModelsAddArrForCom());
if (SLight_GetIDArr(i, RENDER_IDARRCOM_GREEN, 0) <= -1)
SLight_SetIDArr(i, RENDER_IDARRCOM_GREEN, 0, SGreen_AddArrForCom());
SLight_SetIDArr(i, RENDER_IDARRCOM_GREEN, 0, SGreen_AddVisCaclObj());
if (SLight_GetIDArr(i, RENDER_IDARRCOM_ANIM, 0) <= -1)
SLight_SetIDArr(i, RENDER_IDARRCOM_ANIM, 0, SXAnim_ModelsAddArrForCom());
......@@ -197,7 +199,7 @@ void rfunc::ComVisibleForLight()
SLight_SetIDArr(i, RENDER_IDARRCOM_GEOM, k, SGeom_ModelsAddArrForCom());
if (SLight_GetIDArr(i, RENDER_IDARRCOM_GREEN, k) <= -1)
SLight_SetIDArr(i, RENDER_IDARRCOM_GREEN, k, SGreen_AddArrForCom());
SLight_SetIDArr(i, RENDER_IDARRCOM_GREEN, k, SGreen_AddVisCaclObj());
if (SLight_GetIDArr(i, RENDER_IDARRCOM_ANIM, k) <= -1)
SLight_SetIDArr(i, RENDER_IDARRCOM_ANIM, k, SXAnim_ModelsAddArrForCom());
......@@ -225,8 +227,8 @@ void rfunc::ComVisibleForLight()
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GEOM, k)) >= 0 && SGeom_ModelsExistsArrForCom(idTempArr))
SGeom_ModelsDelArrForCom(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GREEN, k)) >= 0 && SGreen_ExistsArrForCom(idTempArr))
SGreen_DelArrForCom(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GREEN, k)) >= 0 && SGreen_ExistsVisCaclObj(idTempArr))
SGreen_DelVisCaclObj(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_ANIM, k)) >= 0)
SXAnim_ModelsDelArrForCom(idTempArr);
......@@ -237,8 +239,8 @@ void rfunc::ComVisibleForLight()
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GEOM, 0)) >= 0 && SGeom_ModelsExistsArrForCom(idTempArr))
SGeom_ModelsDelArrForCom(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GREEN, 0)) >= 0 && SGreen_ExistsArrForCom(idTempArr))
SGreen_DelArrForCom(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GREEN, 0)) >= 0 && SGreen_ExistsVisCaclObj(idTempArr))
SGreen_DelVisCaclObj(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_ANIM, 0)) >= 0)
SXAnim_ModelsDelArrForCom(idTempArr);
......@@ -251,8 +253,8 @@ void rfunc::ComVisibleForLight()
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GEOM, k)) >= 0 && SGeom_ModelsExistsArrForCom(idTempArr))
SGeom_ModelsDelArrForCom(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GREEN, k)) >= 0 && SGreen_ExistsArrForCom(idTempArr))
SGreen_DelArrForCom(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_GREEN, k)) >= 0 && SGreen_ExistsVisCaclObj(idTempArr))
SGreen_DelVisCaclObj(idTempArr);
if ((idTempArr = SLight_DelGetIDArr(iCurrKey, RENDER_IDARRCOM_ANIM, k)) >= 0)
SXAnim_ModelsDelArrForCom(idTempArr);
......@@ -305,7 +307,7 @@ void rfunc::ComVisibleReflection()
if (r_reflection_render && (*r_reflection_render) >= REFLECTION_RENDER_GREEN)
{
if (SMtrl_RefGetIDArr(idMat, RENDER_IDARRCOM_GREEN, 0) < 0)
SMtrl_RefSetIDArr(idMat, RENDER_IDARRCOM_GREEN, 0, SGreen_AddArrForCom());
SMtrl_RefSetIDArr(idMat, RENDER_IDARRCOM_GREEN, 0, SGreen_AddVisCaclObj());
}
if (r_reflection_render && (*r_reflection_render) >= REFLECTION_RENDER_ANIM)
......@@ -341,7 +343,7 @@ void rfunc::ComVisibleReflection()
if (r_reflection_render && (*r_reflection_render) >= REFLECTION_RENDER_GREEN)
{
if (SMtrl_RefGetIDArr(idMat, RENDER_IDARRCOM_GREEN, k) < 0)
SMtrl_RefSetIDArr(idMat, RENDER_IDARRCOM_GREEN, k, SGreen_AddArrForCom());
SMtrl_RefSetIDArr(idMat, RENDER_IDARRCOM_GREEN, k, SGreen_AddVisCaclObj());
}
if (r_reflection_render && (*r_reflection_render) >= REFLECTION_RENDER_ANIM)
......@@ -553,7 +555,7 @@ void rfunc::UpdateView()
gdata::idDefaultGeomArr = SGeom_ModelsAddArrForCom();
if (gdata::idDefaultGreenArr < 0)
gdata::idDefaultGreenArr = SGreen_AddArrForCom();
gdata::idDefaultGreenArr = SGreen_AddVisCaclObj();
if (gdata::idDefaultAnimArr < 0)
gdata::idDefaultAnimArr = SXAnim_ModelsAddArrForCom();
......
......@@ -748,14 +748,7 @@ void SkyXEngine_Frame(DWORD timeDelta)
SGeom_ModelsMSortGroups(&vCamPos, 2);
DelayGeomSortGroup += TimeGetMcsU(Core_RIntGet(G_RI_INT_TIMER_RENDER)) - ttime;
/**/
/*if (SGeom_GreenGetOccurencessLeafGrass(&float3(vCamPos - float3(0.25, 1.8, 0.25)), &float3(vCamPos + float3(0.25, 0, 0.25)), MTLTYPE_PHYSIC_LEAF_GRASS))
SXRenderFunc::Delay::FreeVal = 1;
else
SXRenderFunc::Delay::FreeVal = 0;*/
/**/
SGreen_GetOccurencessLeafGrass(&float3(vCamPos - float3(0.25, 1.8, 0.25)), &float3(vCamPos + float3(0.25, 0, 0.25)), MTLTYPE_PHYSIC_LEAF_GRASS);
SRender_UpdateView();
......
......@@ -254,6 +254,14 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLin
Core_Dbg_Set(SkyXEngine_PrintfLog);
Core_SetOutPtr();
SkyXEngine_CreateLoadCVar();
int *r_win_width = (int*)GET_PCVAR_INT("r_win_width");
int *r_win_height = (int*)GET_PCVAR_INT("r_win_height");
*r_win_width = SKYXENGINE_PREVIEW_SIZE;
*r_win_height = SKYXENGINE_PREVIEW_SIZE;
/*ID idTimerRender = Core_TimeAdd();
Core_RIntSet(G_RI_INT_TIMER_RENDER, idTimerRender);
......
......@@ -346,6 +346,7 @@ LRESULT SXLevelEditor_ButtonGreenGenerate_Click(HWND hwnd, UINT msg, WPARAM wPar
SGreen_AddGreen(tmp_name,
tmp_tex,
false,
pos,
tmp_model,
(tmp_lod1[0] ? tmp_lod1 : 0),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment