2016-02-11 23:05:42 +00:00
|
|
|
#include "CParticleElectric.hpp"
|
2016-02-26 05:38:11 +00:00
|
|
|
#include "CGenDescription.hpp"
|
|
|
|
#include "CSwooshDescription.hpp"
|
|
|
|
#include "CElectricDescription.hpp"
|
|
|
|
#include "CModel.hpp"
|
2016-02-26 03:31:00 +00:00
|
|
|
#include "CGraphics.hpp"
|
2016-02-11 23:05:42 +00:00
|
|
|
|
2016-02-13 09:02:47 +00:00
|
|
|
namespace pshag
|
2016-02-11 23:05:42 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
CParticleElectric::CParticleElectric(const TToken<CElectricDescription>& desc)
|
2016-02-26 03:31:00 +00:00
|
|
|
: x1c_elecDesc(desc)
|
2016-02-13 05:49:59 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-02-26 03:45:36 +00:00
|
|
|
void CParticleElectric::SetupLineGXMaterial()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-02-26 03:31:00 +00:00
|
|
|
void CParticleElectric::RenderLines()
|
|
|
|
{
|
|
|
|
CGraphics::DisableAllLights();
|
|
|
|
CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, false);
|
|
|
|
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::One, ERglLogicOp::Clear);
|
|
|
|
|
|
|
|
Zeus::CTransform viewXfrm = CGraphics::g_ViewMatrix;
|
2016-02-26 03:45:36 +00:00
|
|
|
Zeus::CTransform localScale;
|
|
|
|
localScale.Scale(xec_localScale);
|
2016-02-26 03:31:00 +00:00
|
|
|
Zeus::CTransform globalScale;
|
|
|
|
globalScale.Scale(xe0_globalScale);
|
2016-02-26 03:45:36 +00:00
|
|
|
Zeus::CTransform localTranslation;
|
|
|
|
localTranslation.Translate(x38_translation);
|
|
|
|
Zeus::CTransform globalTranslation;
|
|
|
|
globalTranslation.Translate(xa4_globalTranslation);
|
|
|
|
CGraphics::SetModelMatrix(xb0_globalOrientation * globalTranslation * localTranslation * x44_orientation * globalScale);
|
|
|
|
CGraphics::SetCullMode(ERglCullMode::None);
|
|
|
|
SetupLineGXMaterial();
|
|
|
|
/* Iterate line managers */
|
|
|
|
|
|
|
|
CGraphics::SetCullMode(ERglCullMode::Front);
|
|
|
|
//CGraphics::SetLineWidth(1.f, ERglTexOffset);
|
|
|
|
CGraphics::SetViewPointMatrix(viewXfrm);
|
2016-02-26 03:31:00 +00:00
|
|
|
}
|
|
|
|
|
2016-02-13 05:49:59 +00:00
|
|
|
void CParticleElectric::Update(double)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CParticleElectric::Render()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-02-26 03:31:00 +00:00
|
|
|
void CParticleElectric::SetOrientation(const Zeus::CTransform& orientation)
|
2016-02-13 05:49:59 +00:00
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
x44_orientation = orientation;
|
|
|
|
x438_28 = true;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
2016-02-26 03:31:00 +00:00
|
|
|
void CParticleElectric::SetTranslation(const Zeus::CVector3f& translation)
|
2016-02-13 05:49:59 +00:00
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
x38_translation = translation;
|
|
|
|
x438_28 = true;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
2016-02-26 03:31:00 +00:00
|
|
|
void CParticleElectric::SetGlobalOrientation(const Zeus::CTransform& orientation)
|
2016-02-13 05:49:59 +00:00
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
xb0_globalOrientation = orientation;
|
|
|
|
x438_28 = true;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
2016-02-26 03:31:00 +00:00
|
|
|
void CParticleElectric::SetGlobalTranslation(const Zeus::CVector3f& translation)
|
2016-02-13 05:49:59 +00:00
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
xa4_globalTranslation = translation;
|
|
|
|
x438_28 = true;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
2016-02-26 03:31:00 +00:00
|
|
|
void CParticleElectric::SetGlobalScale(const Zeus::CVector3f& scale)
|
2016-02-13 05:49:59 +00:00
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
xe0_globalScale = scale;
|
|
|
|
x438_28 = true;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
2016-02-26 03:31:00 +00:00
|
|
|
void CParticleElectric::SetLocalScale(const Zeus::CVector3f& scale)
|
2016-02-13 05:49:59 +00:00
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
xec_localScale = scale;
|
|
|
|
x438_28 = true;
|
|
|
|
if (x438_26)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CParticleElectric::SetParticleEmission(bool)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-02-26 03:31:00 +00:00
|
|
|
void CParticleElectric::SetModulationColor(const Zeus::CColor& color)
|
2016-02-13 05:49:59 +00:00
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
if (!x1bc_hasModuColor)
|
|
|
|
x1bc_hasModuColor = true;
|
|
|
|
|
|
|
|
x1b8_moduColor = color;
|
|
|
|
/* TODO: Add child particle systems */
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const Zeus::CTransform& CParticleElectric::GetOrientation() const
|
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
return x44_orientation;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const Zeus::CVector3f& CParticleElectric::GetTranslation() const
|
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
return x38_translation;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const Zeus::CTransform& CParticleElectric::GetGlobalOrientation() const
|
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
return xb0_globalOrientation;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const Zeus::CVector3f& CParticleElectric::GetGlobalTranslation() const
|
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
return xa4_globalTranslation;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const Zeus::CVector3f& CParticleElectric::GetGlobalScale() const
|
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
return xe0_globalScale;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const Zeus::CColor& CParticleElectric::GetModulationColor() const
|
|
|
|
{
|
2016-02-26 03:31:00 +00:00
|
|
|
if (!x1bc_hasModuColor)
|
|
|
|
return Zeus::CColor::skWhite;
|
|
|
|
return x1b8_moduColor;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CParticleElectric::IsSystemDeletable() const
|
|
|
|
{
|
2016-02-17 03:42:27 +00:00
|
|
|
return false;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::pair<Zeus::CAABox, bool> CParticleElectric::GetBounds() const
|
|
|
|
{
|
2016-02-17 03:42:27 +00:00
|
|
|
return std::make_pair(Zeus::CAABox(), false);
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
u32 CParticleElectric::GetParticleCount() const
|
|
|
|
{
|
2016-02-17 03:42:27 +00:00
|
|
|
return 0;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CParticleElectric::SystemHasLight() const
|
|
|
|
{
|
2016-02-17 03:42:27 +00:00
|
|
|
return false;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CLight CParticleElectric::GetLight() const
|
|
|
|
{
|
2016-02-17 03:42:27 +00:00
|
|
|
return CLight();
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CParticleElectric::GetParticleEmission() const
|
|
|
|
{
|
2016-02-17 03:42:27 +00:00
|
|
|
return false;
|
2016-02-13 05:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CParticleElectric::DestroyParticles()
|
2016-02-11 23:05:42 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|