13 std::shared_ptr<ProgramFactory>
const& factory,
14 int xSize,
int ySize,
int zSize,
float dt)
24 float dx = 1.0f/
static_cast<float>(
mXSize);
25 float dy = 1.0f/
static_cast<float>(
mYSize);
26 float dz = 1.0f/
static_cast<float>(
mZSize);
27 float dtDivDxDx = (dt/dx)/dx;
28 float dtDivDyDy = (dt/dy)/dy;
29 float dtDivDzDz = (dt/dz)/dz;
32 float ratio0Sqr = ratio0*ratio0;
33 float ratio1Sqr = ratio1*ratio1;
34 float factor = 0.5f/(1.0f + ratio0Sqr + ratio1Sqr);
35 float epsilonX = factor;
36 float epsilonY = ratio0Sqr*factor;
37 float epsilonZ = ratio1Sqr*factor;
38 float epsilon0 = dx*dx*factor;
39 float const denViscosity = 0.0001f;
40 float const velViscosity = 0.0001f;
41 float denVX = denViscosity*dtDivDxDx;
42 float denVY = denViscosity*dtDivDyDy;
43 float denVZ = denViscosity*dtDivDzDz;
44 float velVX = velViscosity*dtDivDxDx;
45 float velVY = velViscosity*dtDivDyDy;
46 float velVZ = velViscosity*dtDivDzDz;
51 p.
halfDivDelta = { 0.5f / dx, 0.5f / dy, 0.5f / dz, 0.0f };
52 p.
timeDelta = { dt / dx, dt / dy, dt / dz, dt };
56 p.
epsilon = { epsilonX, epsilonY, epsilonZ, epsilon0 };
std::shared_ptr< Fluid3InitializeSource > mInitializeSource
std::shared_ptr< Fluid3AdjustVelocity > mAdjustVelocity
Vector4< float > timeDelta
std::shared_ptr< GraphicsEngine > mEngine
std::shared_ptr< Fluid3UpdateState > mUpdateState
Vector4< float > halfDivDelta
Vector4< float > viscosityX
std::shared_ptr< ConstantBuffer > mParameters
std::shared_ptr< Texture3 > mDivergenceTexture
std::shared_ptr< Texture3 > mStateTTexture
std::shared_ptr< Fluid3EnforceStateBoundary > mEnforceStateBoundary
Vector4< float > viscosityY
std::shared_ptr< Fluid3InitializeState > mInitializeState
Vector4< float > spaceDelta
std::shared_ptr< Texture3 > mPoissonTexture
Vector4< float > viscosityZ
std::shared_ptr< Texture3 > mStateTp1Texture
std::shared_ptr< Texture3 > mStateTm1Texture
std::shared_ptr< Fluid3ComputeDivergence > mComputeDivergence
std::shared_ptr< Texture3 > mSourceTexture
std::shared_ptr< Fluid3SolvePoisson > mSolvePoisson
Fluid3(std::shared_ptr< GraphicsEngine > const &engine, std::shared_ptr< ProgramFactory > const &factory, int xSize, int ySize, int zSize, float dt)