However, when the player rotated, the shape of the particles in the cloud distorted. Admittedly, a somewhat minor bug.[/end of bug report]
After looking into a bit, I spotted some code that seemed unnecessarily complicated, which I'll point out just for the heck of it.
CParticleSystemSceneNode.cpp
Code: Select all
// Hmm, this code seems a bit wordy? (not being critical, just thinking out loud)
core::vector3df campos = camera->getAbsolutePosition();
core::vector3df target = camera->getTarget();
core::vector3df up = camera->getUpVector();
core::vector3df view = target - campos;
view.normalize();
core::vector3df horizontal = up.crossProduct(view);
horizontal.normalize();
core::vector3df vertical = horizontal.crossProduct(view);
vertical.normalize();
Code: Select all
core::matrix4 matrix = camera->getViewMatrix();
core::vector3df horizontal = matrix.getColumn(0);
core::vector3df vertical = matrix.getColumn(1);
core::vector3df view = matrix.getColumn(2);
Code: Select all
//! Gets the specified column of the matrix, which is the camera axis in the case of a camera rotation matrix
vector3df getColumn(const s32 column) const;
inline vector3df matrix4::getColumn(const s32 column) const
{
return vector3df(M[column], M[column+4], M[column+8]);
}