mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 10:20:26 +01:00
170 lines
6.7 KiB
C++
170 lines
6.7 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
|
|
#include "StdH.h"
|
|
|
|
#include <EntitiesMP/FogMarker.h>
|
|
#include <EntitiesMP/FogMarker_tables.h>
|
|
void CFogMarker::SetDefaultProperties(void) {
|
|
m_fDepth = 10.0f;
|
|
m_fAbove = 20.0f;
|
|
m_fBelow = 20.0f;
|
|
m_fFar = 100.0f;
|
|
m_faType = FA_EXP ;
|
|
m_fDensity = 0.1f;
|
|
m_fgType = FG_CONSTANT ;
|
|
m_fGraduation = 0.1f;
|
|
m_bDensityDirect = TRUE ;
|
|
m_fDensityPercentage = 0.95f;
|
|
m_fDensityDistance = 10.0f;
|
|
m_bGraduationDirect = TRUE ;
|
|
m_fGraduationPercentage = 0.95f;
|
|
m_fGraduationDistance = 10.0f;
|
|
m_iSizeL = 32;
|
|
m_iSizeH = 16;
|
|
m_colColor = (C_WHITE | CT_OPAQUE );
|
|
CMarker::SetDefaultProperties();
|
|
}
|
|
|
|
#line 58 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
const CTString & CFogMarker::GetFogName(void)
|
|
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
{
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
return m_strName ;
|
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
}
|
|
|
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
void CFogMarker::GetFog(class CFogParameters & fpFog)
|
|
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
{
|
|
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
const FLOATmatrix3D & m = GetRotationMatrix ();
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_vFogDir (1) = m (1 , 2);
|
|
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_vFogDir (2) = m (2 , 2);
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_vFogDir (3) = m (3 , 2);
|
|
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
FLOAT fPos = fpFog . fp_vFogDir % GetPlacement () . pl_PositionVector ;
|
|
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_colColor = m_colColor ;
|
|
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_atType = (AttenuationType ) m_faType ;
|
|
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_fDensity = m_fDensity ;
|
|
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_fgtType = (FogGraduationType ) m_fgType ;
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_fGraduation = m_fGraduation ;
|
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_fH0 = fPos - m_fDepth - m_fBelow ;
|
|
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_fH1 = fPos - m_fDepth ;
|
|
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_fH2 = fPos ;
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_fH3 = fPos + m_fAbove ;
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_fFar = m_fFar ;
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_iSizeH = m_iSizeH ;
|
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
fpFog . fp_iSizeL = m_iSizeL ;
|
|
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
}
|
|
BOOL CFogMarker::
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CFogMarker_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CFogMarker::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
InitAsEditorModel ();
|
|
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
SetPhysicsFlags (EPF_MODEL_IMMATERIAL );
|
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
SetCollisionFlags (ECF_IMMATERIAL );
|
|
#line 91 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
SetModel (MODEL_MARKER );
|
|
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
SetModelMainTexture (TEXTURE_MARKER );
|
|
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
if(m_strName == "Marker"){
|
|
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_strName = "Fog marker";
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
}
|
|
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
if(! m_bDensityDirect ){
|
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
switch(m_faType ){
|
|
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
case FA_LINEAR :
|
|
#line 104 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fDensity = m_fDensityPercentage / m_fDensityDistance ;
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
break ;
|
|
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
case FA_EXP :
|
|
#line 107 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fDensity = - log (1 - m_fDensityPercentage ) / m_fDensityDistance ;
|
|
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
break ;
|
|
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
case FA_EXP2 :
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fDensity = Sqrt (- log (1 - m_fDensityPercentage )) / m_fDensityDistance ;
|
|
#line 111 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
break ;
|
|
#line 112 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
}
|
|
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
}
|
|
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
if(! m_bGraduationDirect ){
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
switch(m_fgType ){
|
|
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
case FG_LINEAR :
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fGraduation = m_fGraduationPercentage / m_fGraduationDistance ;
|
|
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
break ;
|
|
#line 122 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
case FG_EXP :
|
|
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fGraduation = - log (1 - m_fGraduationPercentage ) / m_fGraduationDistance ;
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
break ;
|
|
#line 125 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
}
|
|
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
}
|
|
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fDensity = ClampDn (m_fDensity , 1E-6f);
|
|
#line 132 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fDepth = ClampDn (m_fDepth , 0.001f);
|
|
#line 133 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fAbove = ClampDn (m_fAbove , 0.001f);
|
|
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fBelow = ClampDn (m_fBelow , 0.001f);
|
|
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_fFar = ClampDn (m_fFar , 0.001f);
|
|
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_iSizeL = 1 << INDEX (Log2 (m_iSizeL ));
|
|
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_iSizeH = 1 << INDEX (Log2 (m_iSizeH ));
|
|
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_iSizeL = Clamp (m_iSizeL , INDEX (2) , INDEX (256));
|
|
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
m_iSizeH = Clamp (m_iSizeH , INDEX (2) , INDEX (256));
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/FogMarker.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;}; |