Commit 8306303d authored by Byurrrer's avatar Byurrrer

сделал основной рефакторинг либы партиклов, поправил последствия в движке и...

сделал основной рефакторинг либы партиклов, поправил последствия в движке и редакторе, немного рефакторил либу постпроцесса, доделал бинарный формат файла растительности
parent 86fe5f9b
......@@ -96,7 +96,7 @@ static const half g_fUnit256 = 1.0/255.0;
//##########################################################################
//! значение для альфа теста растительности
#define GREEN_ALPHATEST_VALUE 0.5
#define GREEN_ALPHATEST_VALUE 0.7
//! значение альфа теста при построении глубины, нужно учитывать что растительность будет отсекаться именно по этому значению, а не по #GREEN_ALPHATEST_VALUE
#define SHADOW_DEPTH_ALPHATEST_VALUE 0.5
......
bullet3 @ b8b67cb6
Subproject commit bfe26aafbe2ce7d3800bb30381674c7e6aea8ef0
Subproject commit b8b67cb64146de7400ea969d4082ee1d6f976715
/***********************************************************
Copyright © Vitaliy Buturlin, Evgeny Danilovich, 2017, 2018
Copyright Vitaliy Buturlin, Evgeny Danilovich, 2017, 2018
See the license in LICENSE
***********************************************************/
......
common @ fb39f037
Subproject commit a4dc88ffd0720991c2689b7b4209b96ee0e2c33e
Subproject commit fb39f0370351b0905f61734f8f78696a44266d42
......@@ -282,7 +282,7 @@ SX_LIB_API void Core_MWaitFor(ID id)
SX_LIB_API int Core_MGetThreadCount()
{
SXCORE_PRECOND(1);
g_pTaskManager->getThreadCount();
return g_pTaskManager->getThreadCount();
}
//##########################################################################
......
......@@ -121,7 +121,7 @@ void CBaseTool::primaryAction(BOOL st)
playAnimation("shoot1");
if(ID_VALID(m_iMuzzleFlash))
{
SPE_EffectEnableSet(m_iMuzzleFlash, true);
SPE_EffectSetEnable(m_iMuzzleFlash, true);
}
if(ID_VALID(m_iSoundAction1))
{
......@@ -224,9 +224,9 @@ void CBaseTool::onSync()
{
//SPE_EffectPlayByID
float3 pos = m_pAnimPlayer->getBoneTransformPos(m_pAnimPlayer->getBone("muzzle_rifle1"));
SPE_EffectPosSet(m_iMuzzleFlash, &pos);
SPE_EffectSetPos(m_iMuzzleFlash, &pos);
//pos = m_vOrientation * float3(0, 0, 1);
SPE_EffectRotSetQ(m_iMuzzleFlash, m_vOrientation);
SPE_EffectSetRotQ(m_iMuzzleFlash, m_vOrientation);
}
}
......
......@@ -466,7 +466,7 @@ void CBaseWeapon::taskShoot(float dt)
playAnimation("shoot1");
if(ID_VALID(m_iMuzzleFlash))
{
SPE_EffectEnableSet(m_iMuzzleFlash, true);
SPE_EffectSetEnable(m_iMuzzleFlash, true);
}
if(ID_VALID(m_idSndShoot))
{
......
......@@ -40,15 +40,15 @@ CSkyBox::CSkyBox()
&m_pIndeces,
0);
float X = 1.0f * 200;
float Y = 1.0f * 200;
float Z = 1.0f * 200;
float tmpy = 45;
float X = SXGC_SKYBOX_SIZE * 0.5;
float Y = SXGC_SKYBOX_SIZE * 0.5;
float Z = SXGC_SKYBOX_SIZE * 0.5;
//float tmpy = 45;
CSkyBoxVertex* tmpVertices;
m_pVertices->Lock(0, 0, (void**)&tmpVertices, 0);
tmpVertices[0] = CSkyBoxVertex( X, Y-tmpy, Z, 1.0f, 1.0f, 1.0f);
/*tmpVertices[0] = CSkyBoxVertex( X, Y-tmpy, Z, 1.0f, 1.0f, 1.0f);
tmpVertices[1] = CSkyBoxVertex(-X, Y-tmpy, Z,-1.0f, 1.0f, 1.0f);
tmpVertices[2] = CSkyBoxVertex( X, -tmpy, Z, 1.0f,-1.0f, 1.0f);
......@@ -57,7 +57,18 @@ CSkyBox::CSkyBox()
tmpVertices[5] = CSkyBoxVertex( X, -tmpy,-Z, 1.0f,-1.0f,-1.0f);
tmpVertices[6] = CSkyBoxVertex(-X, Y-tmpy,-Z,-1.0f, 1.0f,-1.0f);
tmpVertices[7] = CSkyBoxVertex(-X, -tmpy,-Z,-1.0f,-1.0f,-1.0f);
tmpVertices[7] = CSkyBoxVertex(-X, -tmpy,-Z,-1.0f,-1.0f,-1.0f);*/
tmpVertices[0] = CSkyBoxVertex( X, Y, Z, 1.0f, 1.0f, 1.0f);
tmpVertices[1] = CSkyBoxVertex(-X, Y, Z, -1.0f, 1.0f, 1.0f);
tmpVertices[2] = CSkyBoxVertex( X, -Y, Z, 1.0f, -1.0f, 1.0f);
tmpVertices[3] = CSkyBoxVertex( X, Y, -Z, 1.0f, 1.0f, -1.0f);
tmpVertices[4] = CSkyBoxVertex(-X, -Y, Z, -1.0f, -1.0f, 1.0f);
tmpVertices[5] = CSkyBoxVertex( X, -Y, -Z, 1.0f, -1.0f, -1.0f);
tmpVertices[6] = CSkyBoxVertex(-X, Y, -Z, -1.0f, 1.0f, -1.0f);
tmpVertices[7] = CSkyBoxVertex(-X, -Y, -Z, -1.0f, -1.0f, -1.0f);
m_pVertices->Unlock();
......
......@@ -1196,6 +1196,8 @@ SX_LIB_API ICamera* SGCore_CrCamera();
\note Используются кубические текстуры
@{*/
#define SXGC_SKYBOX_SIZE 200.f
//! создание
SX_LIB_API void SGCore_SkyBoxCr();
......
......@@ -1529,6 +1529,10 @@ void CGreen::save(const char *szPath)
FILE *pFile = fopen(szPath, "wb");
fwrite(SX_GREEN_MAGIC_WORD, sizeof(char)* strlen(SX_GREEN_MAGIC_WORD), 1, pFile);
uint32_t uiFmtVersion = SX_GREEN_FILE_FORMAT_VERSION;
fwrite(&uiFmtVersion, sizeof(uint32_t), 1, pFile);
int32_t iCountModel = m_aGreens.size();
fwrite(&iCountModel, sizeof(int32_t), 1, pFile);
......@@ -1583,16 +1587,28 @@ void CGreen::save(const char *szPath)
fwrite(&m_aGreens[i]->m_uiCountObj, sizeof(uint32_t), 1, pFile);
fwrite(&(m_aGreens[i]->m_pAllTrans[0]), sizeof(CGreenDataVertex), m_aGreens[i]->m_uiCountObj, pFile);
uint32_t uiCountBytesAllSplits = 0;
Array<CSegment*> aQueue;
int iCount = 0;
uint32_t uiCountSplits = 0;
aQueue.push_back(m_aGreens[i]->m_pSplitsTree);
while (aQueue.size() > iCount)
while (aQueue.size() > uiCountSplits)
{
saveSplit(aQueue[iCount], pFile, &aQueue);
uiCountBytesAllSplits += getCountBytes4SaveSplit(aQueue[uiCountSplits], pFile, &aQueue);
++uiCountSplits;
}
//aQueue.erase(0);
++iCount;
fwrite(&uiCountBytesAllSplits, sizeof(uint32_t), 1, pFile);
fwrite(&uiCountSplits, sizeof(uint32_t), 1, pFile);
aQueue.clearFast();
uiCountSplits = 0;
aQueue.push_back(m_aGreens[i]->m_pSplitsTree);
while (aQueue.size() > uiCountSplits)
{
saveSplit(aQueue[uiCountSplits], pFile, &aQueue);
++uiCountSplits;
}
}
......@@ -1640,12 +1656,52 @@ void CGreen::saveSplit(const CSegment *pSplit, FILE *pFile, Array<CSegment*> *pQ
}
}
uint32_t CGreen::getCountBytes4SaveSplit(const CSegment *pSplit, FILE *pFile, Array<CSegment*> *pQueue)
{
uint32_t uiCountBytes = (sizeof(float3_t)* 4) + sizeof(uint32_t)+sizeof(int8_t);
if (pSplit->m_idNonEnd)
{
for (int i = 0; i<GREEN_COUNT_TYPE_SEGMENTATION; i++)
{
if (pSplit->m_aSplits[i])
pQueue->push_back(pSplit->m_aSplits[i]);
}
}
else
{
uiCountBytes += sizeof(ID)* pSplit->m_iCountObj;
}
return uiCountBytes;
}
//**************************************************************************
void CGreen::load(const char *szPath)
bool CGreen::load(const char *szPath)
{
FILE *pFile = fopen(szPath, "rb");
uint64_t ui64Magic;
fread(&ui64Magic, sizeof(uint64_t), 1, pFile);
if (ui64Magic != SX_GREEN_MAGIC_NUM)
{
LibReport(REPORT_MSG_LEVEL_ERROR, "file [%s] is not green\n", szPath);
fclose(pFile);
return false;
}
uint32_t uiFmtVersion;
fread(&uiFmtVersion, sizeof(uint32_t), 1, pFile);
if (uiFmtVersion != SX_GREEN_FILE_FORMAT_VERSION)
{
LibReport(REPORT_MSG_LEVEL_ERROR, "file [%s] have unduported version %d\n", szPath, uiFmtVersion);
fclose(pFile);
return false;
}
char aStr[3][1024];
aStr[0][0] = 0;
aStr[1][0] = 0;
......@@ -1750,6 +1806,25 @@ void CGreen::load(const char *szPath)
pGreen->m_pAllTrans.resize(pGreen->m_uiCountObj);
fread(&(pGreen->m_pAllTrans[0]), sizeof(CGreenDataVertex), pGreen->m_uiCountObj, pFile);
uint32_t uiCountBytesAllSplits;
uint32_t uiCountSplits;
fread(&uiCountBytesAllSplits, sizeof(uint32_t), 1, pFile);
fread(&uiCountSplits, sizeof(uint32_t), 1, pFile);
long lCurrPos = ftell(pFile);
fseek(pFile, 0, SEEK_END);
long lLastSize = ftell(pFile) - lCurrPos;
if (lLastSize < uiCountBytesAllSplits)
{
LibReport(REPORT_MSG_LEVEL_ERROR, "file [%s] damaged, lacks %d bytes \n", szPath, uiCountBytesAllSplits - lLastSize);
fclose(pFile);
return false;
}
fseek(pFile, lCurrPos, SEEK_SET);
Array<CSegment**> aQueue;
int iCount = 0;
aQueue.push_back(&(pGreen->m_pSplitsTree));
......@@ -1775,6 +1850,8 @@ void CGreen::load(const char *szPath)
}
fclose(pFile);
return true;
}
void CGreen::loadSplit(CSegment **ppSplit, FILE *pFile, Array<CSegment**> *pQueue)
......
......@@ -104,7 +104,7 @@ public:
void deleteVisCaclObj(ID idVisCaclObj);
void save(const char *szPath);
void load(const char *szPath);
bool load(const char *szPath);
void clear();
void comArrIndeces(const IFrustum *pFrustum, const float3 *pViewPos, ID idArr = 0);
void render(DWORD timeDelta, const float3 *pViewPos, GREEN_TYPE type, ID idArr = 0);
......@@ -320,6 +320,8 @@ protected:
\note Только эта функция должна использоваться для генерации объектов!
*/
void genDataObject(CGreenDataVertex *pGreenData, const float3_t *pPos);
uint32_t getCountBytes4SaveSplit(const CSegment *pSplit, FILE *pFile, Array<CSegment*> *pQueue);
void saveSplit(const CSegment *pSplit, FILE *pFile, Array<CSegment*> *pQueue);
void loadSplit(CSegment **ppSplit, FILE * file, Array<CSegment**> *pQueue);
......
......@@ -37,6 +37,15 @@ See the license in LICENSE
#define SX_LIB_API extern "C" __declspec (dllexport)
#endif
//! магическое слово для записи в бинарный файл растительности, для идентификации
#define SX_GREEN_MAGIC_WORD "sxgreens"
//! магичесок число для илентификации файла растительности
#define SX_GREEN_MAGIC_NUM 8317697048185370739
//! версия формата файла растительности
#define SX_GREEN_FILE_FORMAT_VERSION 1
//##########################################################################
/*! \name Стандартные функции библиотеки
......
......@@ -159,7 +159,7 @@ CWeather::CWeather()
m_aTrackPos = 0;
if (m_idEffRain >= 0)
{
m_iTrackPosCount = SPE_EmitterCountGet(m_idEffRain,0);
m_iTrackPosCount = SPE_EmitterGetCount(m_idEffRain, 0);
m_aTrackPos = new float3[m_iTrackPosCount];
}
else
......@@ -213,10 +213,10 @@ void CWeather::load(const char *szPath)
SGCore_SkyCloudsSetRot(0);
SPE_EffectEnableSet(m_idEffRain, false);
SPE_EffectSetEnable(m_idEffRain, false);
SSCore_SndStop(m_idSndRain);
SPE_EffectEnableSet(m_idEffThunderbolt, false);
SPE_EffectSetEnable(m_idEffThunderbolt, false);
SLight_SetEnable(m_idLightThunderbolt, false);
SSCore_SndStop(m_idSndThunder);
......@@ -571,7 +571,7 @@ void CWeather::update()
{
static float3 campos;
Core_RFloat3Get(G_RI_FLOAT3_OBSERVER_POSITION, &campos);
SPE_EffectPosSet(m_idEffRain, &float3(campos.x, campos.y - WEATHER_RAIN_MIN_Y_OBSERVER, campos.z));
SPE_EffectSetPos(m_idEffRain, &float3(campos.x, campos.y - WEATHER_RAIN_MIN_Y_OBSERVER, campos.z));
updateRainSound();
}
......@@ -582,7 +582,7 @@ void CWeather::update()
{
env_default_rain_density_old = *env_default_rain_density;
if (m_aTimeSections[m_iSectionCurr].m_DataSection.m_fRainDensity > 0.f)
SPE_EmitterSet(m_idEffRain, 0, ReCreateCount, env_default_rain_density_old * m_aTimeSections[m_iSectionCurr].m_DataSection.m_fRainDensity * float(WEATHER_RAIN_RECREATE_COUNT));
SPE_EmitterSet(m_idEffRain, 0, m_iReCreateCount, env_default_rain_density_old * m_aTimeSections[m_iSectionCurr].m_DataSection.m_fRainDensity * float(WEATHER_RAIN_RECREATE_COUNT));
}
//получаем текущую игровую дату
......@@ -642,9 +642,9 @@ void CWeather::update()
//если плотность дожд¤ больше нул¤ тогда включаем дождь
if (m_aTimeSections[m_iSectionCurr].m_DataSection.m_fRainDensity > 0.f)
{
SPE_EmitterSet(m_idEffRain, 0, Color, m_aTimeSections[m_iSectionCurr].m_DataSection.m_vRainColor);
SPE_EmitterSet(m_idEffRain, 0, ReCreateCount, env_default_rain_density_old * m_aTimeSections[m_iSectionCurr].m_DataSection.m_fRainDensity * float(WEATHER_RAIN_RECREATE_COUNT));
SPE_EffectEnableSet(m_idEffRain, true);
SPE_EmitterSet(m_idEffRain, 0, m_vColor, m_aTimeSections[m_iSectionCurr].m_DataSection.m_vRainColor);
SPE_EmitterSet(m_idEffRain, 0, m_iReCreateCount, env_default_rain_density_old * m_aTimeSections[m_iSectionCurr].m_DataSection.m_fRainDensity * float(WEATHER_RAIN_RECREATE_COUNT));
SPE_EffectSetEnable(m_idEffRain, true);
SSCore_SndSetPosPlay(m_idSndRain, 0);
SSCore_SndSetVolume(m_idSndRain, 0);
......@@ -657,7 +657,7 @@ void CWeather::update()
//иначе выключаем
else
{
SPE_EffectEnableSet(m_idEffRain, false);
SPE_EffectSetEnable(m_idEffRain, false);
SSCore_SndStop(m_idSndRain);
}
......@@ -772,8 +772,8 @@ void CWeather::update()
m_vBoltMax = float3_t(campos.x + WEATHER_THUNDERBOLT_WIDTH * 0.5f, m_fLevelMaxY + WEATHER_THUNDERBOLT_HEIGHT, campos.z + WEATHER_THUNDERBOLT_LENGTH * 0.5f);
float3 tpos = float3(randf(m_vBoltMin.x, m_vBoltMax.x), randf(m_vBoltMin.y, m_vBoltMax.y), randf(m_vBoltMin.z, m_vBoltMax.z));
SPE_EffectPosSet(m_idEffThunderbolt, &tpos);
SPE_EffectEnableSet(m_idEffThunderbolt, true);
SPE_EffectSetPos(m_idEffThunderbolt, &tpos);
SPE_EffectSetEnable(m_idEffThunderbolt, true);
SLight_SetPos(m_idLightThunderbolt, &tpos, false);
SLight_SetEnable(m_idLightThunderbolt, true);
m_ulTimeBoltLight = TimeGetMls(Core_RIntGet(G_RI_INT_TIMER_RENDER));
......@@ -837,15 +837,15 @@ void CWeather::updateRainSound()
return;
//если внезапно количество оставл¤ющих след стало больше чем выделено
if (SPE_EmitterTrackCountGet(m_idEffRain, 0) > m_iTrackPosCount)
if (SPE_EmitterGetTrackCount(m_idEffRain, 0) > m_iTrackPosCount)
{
mem_delete(m_aTrackPos);
m_iTrackPosCount = SPE_EmitterCountGet(m_idEffRain, 0);
m_iTrackPosCount = SPE_EmitterGetCount(m_idEffRain, 0);
m_aTrackPos = new float3[m_iTrackPosCount];
}
//получаем массив следов
int tmpcount = SPE_EmitterTrackPosGet(m_idEffRain, 0, &m_aTrackPos, m_iTrackPosCount);
int tmpcount = SPE_EmitterGetTrackPos(m_idEffRain, 0, &m_aTrackPos, m_iTrackPosCount);
m_fRainVolume = 0;
float biger = 0.f;
......
......@@ -2122,6 +2122,19 @@ void CMaterials::render(ID id, const float4x4 *pWorld)
mtrl_data::pDXDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
}
/*if (pMtrl->m_oLightParam.m_fThickness < 1.f)
{
mtrl_data::pDXDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
mtrl_data::pDXDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
mtrl_data::pDXDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
mtrl_data::pDXDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
mtrl_data::pDXDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
}
else
mtrl_data::pDXDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);*/
//почти во всех пиксельных шейдерах материалов есть данна¤ NearFar, необходима¤ д¤л записи глубины
if (pMtrl->m_oMainGraphics.m_idShaderPS != -1)
{
......
This diff is collapsed.
......@@ -34,7 +34,7 @@ if (!(key >= 0 && key < ArrKey.size()))\
{LibReport(REPORT_MSG_LEVEL_ERROR, "%s - sxparticles - uninitialized pool %d", GEN_MSG_LOCATION, id); return retval; }
#define EFFECTS_PARTICLES_PRECOND(id, id_part, retval) \
if (id_part < 0 || id_part >= ArrID[id]->Arr.size() || !(ArrID[id]->Arr[id_part]))\
if (id_part < 0 || id_part >= ArrID[id]->m_aEmitters.size() || !(ArrID[id]->m_aEmitters[id_part]))\
{LibReport(REPORT_MSG_LEVEL_ERROR, "%s - sxparticles - unresolved address to particles %d in effect %d", GEN_MSG_LOCATION, id_part, id); return retval; }
#define EFFECTS_PRECOND(id, id_part, retval) \
......@@ -43,48 +43,49 @@ if (!(key >= 0 && key < ArrKey.size()))\
class Effects
class CEffects
{
public:
Effects();
~Effects();
CEffects();
~CEffects();
SX_ALIGNED_OP_MEM
struct Effect
struct CEffect
{
Effect();
Effect(Effect& eff);
~Effect();
void NullingInit();
CEffect();
CEffect(CEffect& eff);
~CEffect();
void nullingInit();
SX_ALIGNED_OP_MEM
char Name[OBJECT_NAME_MAX_LEN];
char m_szName[OBJECT_NAME_MAX_LEN];
ID Id;
ID Key;
ID m_id;
ID m_idKey;
float3 CurrMin;
float3 CurrMax;
float3 m_vCurrMin;
float3 m_vCurrMax;
float3 CurrMin2;
float3 CurrMax2;
float3 m_vCurrMin2;
float3 m_vCurrMax2;
float3 Position, Direction, Rotation;
float4x4 MatTranslation;
float4x4 MatRotate;
float3 m_vPosition, m_vDirection, m_vRotation;
float4x4 m_mTranslation;
float4x4 m_mRotate;
float ViewDist;
bool ViewRender;
float m_fViewDist;
bool m_isViewRender;
bool Enable;
bool Alife;
Array<Emitter*> Arr;
bool m_isEnable;
bool m_isAlife;
Array<CEmitter*> m_aEmitters;
ID IDPool;
bool Busy;
bool Original;
ID m_idPool;
bool m_isBusy;
bool m_isOriginal;
};
void load(const char* file);
......@@ -94,11 +95,11 @@ public:
void onLostDevice();
void onResetDevice();
ID emitterAdd(ID id, ParticlesData* data);
void emitterReInit(ID id, ID id_part, ParticlesData* data);
ID emitterAdd(ID id, CParticlesData* data);
void emitterReInit(ID id, ID id_part, CParticlesData* data);
int emitterGetCount(ID id);
void emitterDelete(ID id, ID id_part);
ParticlesData* emitterGetData(ID id, ID id_part);
CParticlesData* emitterGetData(ID id, ID id_part);
void emitterSetCount(ID id, ID id_part, int count);
int emitterGetCount(ID id, ID id_part);
......@@ -123,72 +124,72 @@ public:
int emitterGetTrackCount(ID id, ID id_part);
int emitterGetTrackPos(ID id, ID id_part, float3** arr, int count);
ID EffectInstanceByID(ID id);
ID EffectInstanceByName(const char* name);
ID effectInstanceByID(ID id);
ID effectInstanceByName(const char* name);
ID effectGetByName(const char* name);
ID effectAdd(const char* name);
int effectGetCount();
ID effectGetIdOfKey(ID key);
void EffectDelete(ID id);
void EffectNameSet(ID id, const char* name);
void EffectNameGet(ID id, char* name);
void effectDelete(ID id);
void effectSetName(ID id, const char* name);
void effectGetName(ID id, char* name);
void EffectCompute(ID id);
void EffectComputeLighting(ID id);
void EffectRender(ID id, DWORD timeDelta);
void effectCompute(ID id);
void effectComputeLighting(ID id);
void effectRender(ID id, DWORD timeDelta);
void EffectComputeAll();
void EffectComputeLightingAll();
void EffectRenderAll(DWORD timeDelta);
void effectComputeAll();
void effectComputeLightingAll();
void effectRenderAll(DWORD timeDelta);
bool EffectEnableGet(ID id);
void EffectEnableSet(ID id, bool isenable);
bool effectGetEnable(ID id);
void effectSetEnable(ID id, bool isenable);
void EffectPlayByID(ID id, float3* pos, float3* dir);
void EffectPlayByName(const char* name, float3* pos, float3* dir);
void effectPlayByID(ID id, const float3* pos, const float3* dir);
void effectPlayByName(const char* name, const float3* pos, const float3* dir);
bool EffectAlifeGet(ID id);
void EffectAlifeSet(ID id, bool alife);
bool effectGetAlife(ID id);
void effectSetAlife(ID id, bool alife);
void EffectPosSet(ID id, float3* pos);
void EffectDirSet(ID id, float3* dir);
void EffectRotSet(ID id, float3* rot);
void EffectRotSet(ID id, const SMQuaternion & rot);
void effectSetPos(ID id, const float3* pos);
void effectSetDir(ID id, const float3* dir);
void effectSetRot(ID id, const float3* rot);
void effectSetRot(ID id, const SMQuaternion & rot);
void EffectPosGet(ID id, float3* pos);
void EffectDirGet(ID id, float3* dir);
void EffectRotGet(ID id, float3* rot);
void effectGetPos(ID id, float3* pos);
void effectGetDir(ID id, float3* dir);
void effectGetRot(ID id, float3* rot);
bool EffectVisibleCom(ID id, const IFrustum* frustum, float3* view);
void EffectVisibleComAll(const IFrustum* frustum, float3* view);
bool EffectVisibleGet(ID id);
float EffectDistToViewGet(ID id);
bool effectVisibleCom(ID id, const IFrustum* frustum, const float3* view);
void effectVisibleComAll(const IFrustum* frustum, const float3* view);
bool effectGetVisible(ID id);
float effectGetDistToView(ID id);
protected:
struct Pool
struct CPool
{
Pool();
CPool();
Array<ID> arr;
ID ideff;
};
ID EffectCopyName(const char* name);
ID EffectCopyID(ID id);
void EffectDel(ID id);
ID effectCopyName(const char* name);
ID effectCopyID(ID id);
void effectDel(ID id);
ID AddEffect(Effect* obj);
ID PoolAdd(ID ideff);
void PoolDelete(ID id);
void PoolExtend(ID id);
ID PoolGet(ID id);
ID addEffect(CEffect* obj);
ID poolAdd(ID ideff);
void poolDelete(ID id);
void poolExtend(ID id);
ID poolGet(ID id);
Array<Effect*> ArrKey; //массив всех элементов по порядку
Array<Effect*> ArrID; //массив всех элементов, основанный на id
Array<Pool*> Pools;
Array<CEffect*> ArrKey; //массив всех элементов по порядку
Array<CEffect*> ArrID; //массив всех элементов, основанный на id
Array<CPool*> Pools;
Array<ID> ArrSort;
int ArrSortSizeCurr; //текущий размер массива ArrSort
};
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ See the license in LICENSE
#include "sxparticles.h"
#include "pe_data.h"
extern g_particles_phy_collision GParticlesPhyCollision;
extern g_particles_phy_collision g_fnParticlesPhyCollision;
//структура описывающая партикл
struct CommonParticle
......@@ -118,110 +118,119 @@ struct CommonParticleDecl2
//#############################################################################
class Emitter
class CEmitter
{