GteFluid3.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
17 
18 namespace gte
19 {
20 
21 class GraphicsEngine;
22 class ProgramFactory;
23 
25 {
26 public:
27  // Construction. The (x,y,z) grid covers [0,1]^3.
28  Fluid3(std::shared_ptr<GraphicsEngine> const& engine,
29  std::shared_ptr<ProgramFactory> const& factory,
30  int xSize, int ySize, int zSize, float dt);
31 
32  void Initialize();
33  void DoSimulationStep();
34  inline std::shared_ptr<Texture3> const& GetState() const;
35 
36 private:
37  // Constructor inputs.
38  std::shared_ptr<GraphicsEngine> mEngine;
39  int mXSize, mYSize, mZSize;
40  float mDt;
41 
42  // Current simulation time.
43  float mTime;
44 
45  std::shared_ptr<ConstantBuffer> mParameters;
46  std::shared_ptr<Fluid3InitializeSource> mInitializeSource;
47  std::shared_ptr<Fluid3InitializeState> mInitializeState;
48  std::shared_ptr<Fluid3EnforceStateBoundary> mEnforceStateBoundary;
49  std::shared_ptr<Fluid3UpdateState> mUpdateState;
50  std::shared_ptr<Fluid3ComputeDivergence> mComputeDivergence;
51  std::shared_ptr<Fluid3SolvePoisson> mSolvePoisson;
52  std::shared_ptr<Fluid3AdjustVelocity> mAdjustVelocity;
53 
54  std::shared_ptr<Texture3> mSourceTexture;
55  std::shared_ptr<Texture3> mStateTm1Texture;
56  std::shared_ptr<Texture3> mStateTTexture;
57  std::shared_ptr<Texture3> mStateTp1Texture;
58  std::shared_ptr<Texture3> mDivergenceTexture;
59  std::shared_ptr<Texture3> mPoissonTexture;
60 };
61 
62 inline std::shared_ptr<Texture3> const& Fluid3::GetState() const
63 {
64  return mStateTTexture;
65 }
66 
67 }
std::shared_ptr< Fluid3InitializeSource > mInitializeSource
Definition: GteFluid3.h:46
std::shared_ptr< Fluid3AdjustVelocity > mAdjustVelocity
Definition: GteFluid3.h:52
std::shared_ptr< GraphicsEngine > mEngine
Definition: GteFluid3.h:38
std::shared_ptr< Fluid3UpdateState > mUpdateState
Definition: GteFluid3.h:49
float mTime
Definition: GteFluid3.h:43
std::shared_ptr< ConstantBuffer > mParameters
Definition: GteFluid3.h:45
std::shared_ptr< Texture3 > const & GetState() const
Definition: GteFluid3.h:62
std::shared_ptr< Texture3 > mDivergenceTexture
Definition: GteFluid3.h:58
std::shared_ptr< Texture3 > mStateTTexture
Definition: GteFluid3.h:56
std::shared_ptr< Fluid3EnforceStateBoundary > mEnforceStateBoundary
Definition: GteFluid3.h:48
std::shared_ptr< Fluid3InitializeState > mInitializeState
Definition: GteFluid3.h:47
std::shared_ptr< Texture3 > mPoissonTexture
Definition: GteFluid3.h:59
int mZSize
Definition: GteFluid3.h:39
std::shared_ptr< Texture3 > mStateTp1Texture
Definition: GteFluid3.h:57
std::shared_ptr< Texture3 > mStateTm1Texture
Definition: GteFluid3.h:55
float mDt
Definition: GteFluid3.h:40
std::shared_ptr< Fluid3ComputeDivergence > mComputeDivergence
Definition: GteFluid3.h:50
std::shared_ptr< Texture3 > mSourceTexture
Definition: GteFluid3.h:54
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63
std::shared_ptr< Fluid3SolvePoisson > mSolvePoisson
Definition: GteFluid3.h:51


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59