#include <simgear/misc/sg_path.hxx>
#include <simgear/props/props.hxx>
#include <simgear/props/props_io.hxx>
+#include <simgear/structure/OSGVersion.hxx>
#include <osgParticle/SmokeTrailEffect>
#include <osgParticle/FireEffect>
#include "particles.hxx"
+#if SG_OSG_VERSION >= 27004
+#define OSG_PARTICLE_FIX 1
+#endif
+
namespace simgear
{
void GlobalParticleCallback::operator()(osg::Node* node, osg::NodeVisitor* nv)
SGQuatd q
= SGQuatd::fromLonLatDeg(modelRoot->getFloatValue("/position/longitude-deg",0),
modelRoot->getFloatValue("/position/latitude-deg",0));
- osg::Matrix om(q.osg());
+ osg::Matrix om(toOsg(q));
osg::Vec3 v(0,0,9.81);
gravity = om.preMult(v);
const osg::Vec3& zUpWind = Particles::getWindVector();
return commonRoot.get();
}
-// Enable this once particle fix is in OSG.
-// #define OSG_PARTICLE_FIX 1
void transformParticles(osgParticle::ParticleSystem* particleSys,
const osg::Matrix& mat)
{
if (displace * displace > 10000.0 * 10000.0) {
// Make new frame for particle system, coincident with
// the emitter frame, but oriented with local Z.
- SGGeod geod = SGGeod::fromCart(SGVec3d(emitOrigin));
+ SGGeod geod = SGGeod::fromCart(toSG(emitOrigin));
Matrix newParticleMat = geod.makeZUpFrame();
Matrix changeParticleFrame
= particleMat * Matrix::inverse(newParticleMat);