26 namespace SkyX {
namespace VClouds
30 const int &a,
const int &b,
const int &c,
31 const int &nx,
const int &ny,
const int &nz,
32 const int &
x,
const int &
y,
const int &
z,
33 const Ogre::Real& Density)
35 , mA2(
Ogre::Math::Pow(a, 2)), mB2(
Ogre::Math::Pow(b, 2)), mC2(
Ogre::Math::Pow(c, 2))
36 , mNx(nx), mNy(ny), mNz(nz)
63 Ogre::Vector3 Direction = Ogre::Vector3(
x-
mX,
y-
mY,
z-
mZ),
64 DirectionNormalized = Direction.normalisedCopy();
66 Ogre::Real a = Ogre::Math::Pow(DirectionNormalized.x, 2) /
mA2 +
67 Ogre::Math::Pow(DirectionNormalized.y, 2) /
mB2 +
68 Ogre::Math::Pow(DirectionNormalized.z, 2) /
mC2,
70 lambda = 1.0f / Ogre::Math::Sqrt(a);
72 return Ogre::Math::Clamp<Ogre::Real>(Direction.length() / lambda, 0, 1);
79 return Ogre::Vector3(density, 1-density, density);
90 uu = (u<0) ? (u + nx) : u;
if (u>=nx) { uu-= nx; }
94 vv = (v<0) ? (v + ny) : v;
if (v>=ny) { vv-= ny; }
102 c[uu][vv][
w].
phum = 0.005f;
103 c[uu][vv][
w].
pext = 0.05f;
104 c[uu][vv][
w].
pact = 0.01f;
106 if (!delayedResponse)
108 c[uu][vv][
w].
cld = Ogre::Math::RangeRandom(0,1) > length ? true :
false;
118 mX += Ax;
mY += Ay;
mZ += Az;
139 mA2 = Ogre::Math::Pow(
mA, 2);
140 mB2 = Ogre::Math::Pow(
mB, 2);
141 mC2 = Ogre::Math::Pow(
mC, 2);