Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/ParticleEmitter.cpp
Show First 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | |||||
void CModelParticleEmitter::SetEntityVariable(const std::string& name, float value) | void CModelParticleEmitter::SetEntityVariable(const std::string& name, float value) | ||||
{ | { | ||||
m_Emitter->SetEntityVariable(name, value); | m_Emitter->SetEntityVariable(name, value); | ||||
} | } | ||||
CModelAbstract* CModelParticleEmitter::Clone() const | CModelAbstract* CModelParticleEmitter::Clone() const | ||||
{ | { | ||||
return new CModelParticleEmitter(m_Type); | CModelAbstract* clone = new CModelParticleEmitter(m_Type); | ||||
CModelAbstract::Clone(*clone); | |||||
return clone; | |||||
} | } | ||||
void CModelParticleEmitter::CalcBounds() | void CModelParticleEmitter::CalcBounds() | ||||
{ | { | ||||
// TODO: we ought to compute sensible bounds here, probably based on the | // TODO: we ought to compute sensible bounds here, probably based on the | ||||
// current computed particle positions plus the emitter type's largest | // current computed particle positions plus the emitter type's largest | ||||
// potential bounding box at the current position | // potential bounding box at the current position | ||||
m_WorldBounds = m_Type->CalculateBounds(m_Emitter->GetPosition(), m_Emitter->GetParticleBounds()); | m_WorldBounds = m_Type->CalculateBounds(m_Emitter->GetPosition(), m_Emitter->GetParticleBounds()); | ||||
} | } | ||||
void CModelParticleEmitter::ValidatePosition() | void CModelParticleEmitter::UpdatePositionTransforms() | ||||
{ | { | ||||
// TODO: do we need to do anything here? | // TODO: do we need to do anything here? | ||||
// This is a convenient (though possibly not particularly appropriate) place | // This is a convenient (though possibly not particularly appropriate) place | ||||
// to invalidate bounds so they'll be recomputed from the recent particle data | // to invalidate bounds so they'll be recomputed from the recent particle data | ||||
InvalidateBounds(); | InvalidateBounds(); | ||||
} | } | ||||
void CModelParticleEmitter::InvalidatePosition() | |||||
{ | |||||
} | |||||
void CModelParticleEmitter::SetTransform(const CMatrix3D& transform) | void CModelParticleEmitter::SetTransform(const CMatrix3D& transform) | ||||
{ | { | ||||
if (m_Transform == transform) | if (m_Transform == transform) | ||||
return; | return; | ||||
m_Emitter->SetPosition(transform.GetTranslation()); | m_Emitter->SetPosition(transform.GetTranslation()); | ||||
m_Emitter->SetRotation(transform.GetRotation()); | m_Emitter->SetRotation(transform.GetRotation()); | ||||
// call base class to set transform on this object | // call base class to set transform on this object | ||||
CRenderableObject::SetTransform(transform); | CRenderableObject::SetTransform(transform); | ||||
} | } |
Wildfire Games · Phabricator