GPUParticles: Use an ugly hack to get correct position
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14837 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
88f39e4186
commit
ebb45f8de6
@ -4,6 +4,7 @@
|
||||
#include "io/file_manager.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include <ICameraSceneNode.h>
|
||||
#include <IParticleSystemSceneNode.h>
|
||||
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
#define IRR_OGL_LOAD_EXTENSION(X) wglGetProcAddress(reinterpret_cast<const char*>(X))
|
||||
@ -303,7 +304,7 @@ void PointEmitter::draw()
|
||||
glEnable(GL_BLEND);
|
||||
core::matrix4 matrix = irr_driver->getVideoDriver()->getTransform(video::ETS_PROJECTION);
|
||||
matrix *= irr_driver->getVideoDriver()->getTransform(video::ETS_VIEW);
|
||||
matrix *= getAbsoluteTransformation();
|
||||
matrix *= m_node->getAbsoluteTransformation();
|
||||
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||
glEnable(GL_POINT_SPRITE);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
|
@ -36,6 +36,7 @@ protected:
|
||||
unsigned duration, count;
|
||||
core::vector3df direction;
|
||||
core::aabbox3d<f32> box;
|
||||
scene::IParticleSystemSceneNode *m_node;
|
||||
|
||||
virtual void simulate();
|
||||
virtual void draw();
|
||||
@ -52,6 +53,7 @@ public:
|
||||
// const core::dimension2df& minStartSize,
|
||||
// const core::dimension2df& maxStartSize
|
||||
);
|
||||
void set_m_node(scene::IParticleSystemSceneNode *nd) { m_node = nd; }
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const { return box; }
|
||||
virtual u32 getMaterialCount() const { return 1; }
|
||||
};
|
||||
|
@ -345,8 +345,6 @@ int ParticleEmitter::getCreationRate()
|
||||
*/
|
||||
void ParticleEmitter::setPosition(const Vec3 &pos)
|
||||
{
|
||||
if (PE)
|
||||
PE->setPosition(pos.toIrrVector());
|
||||
m_node->setPosition(pos.toIrrVector());
|
||||
} // setPosition
|
||||
|
||||
@ -457,6 +455,7 @@ void ParticleEmitter::setParticleType(const ParticleKind* type)
|
||||
lifeTimeMin, lifeTimeMax,
|
||||
m_particle_type->getAngleSpread());
|
||||
PE->setPosition(m_node->getPosition());
|
||||
PE->set_m_node(m_node);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user