GteFluid2.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) grid covers [0,1]^2.
28  Fluid2(std::shared_ptr<GraphicsEngine> const& engine,
29  std::shared_ptr<ProgramFactory> const& factory,
30  int xSize, int ySize, float dt, float densityViscosity, float velocityViscosity);
31 
32  void Initialize();
33  void DoSimulationStep();
34  inline std::shared_ptr<Texture2> const& GetState() const;
35 
36 private:
37  // Constructor inputs.
38  std::shared_ptr<GraphicsEngine> mEngine;
39  int mXSize, mYSize;
40  float mDt;
41 
42  // Current simulation time.
43  float mTime;
44 
45  std::shared_ptr<ConstantBuffer> mParameters;
46  std::shared_ptr<Fluid2InitializeSource> mInitializeSource;
47  std::shared_ptr<Fluid2InitializeState> mInitializeState;
48  std::shared_ptr<Fluid2EnforceStateBoundary> mEnforceStateBoundary;
49  std::shared_ptr<Fluid2UpdateState> mUpdateState;
50  std::shared_ptr<Fluid2ComputeDivergence> mComputeDivergence;
51  std::shared_ptr<Fluid2SolvePoisson> mSolvePoisson;
52  std::shared_ptr<Fluid2AdjustVelocity> mAdjustVelocity;
53 
54  std::shared_ptr<Texture2> mSourceTexture;
55  std::shared_ptr<Texture2> mStateTm1Texture;
56  std::shared_ptr<Texture2> mStateTTexture;
57  std::shared_ptr<Texture2> mStateTp1Texture;
58  std::shared_ptr<Texture2> mDivergenceTexture;
59  std::shared_ptr<Texture2> mPoissonTexture;
60 };
61 
62 inline std::shared_ptr<Texture2> const& Fluid2::GetState() const
63 {
64  return mStateTTexture;
65 }
66 
67 }
std::shared_ptr< Texture2 > mStateTp1Texture
Definition: GteFluid2.h:57
float mTime
Definition: GteFluid2.h:43
std::shared_ptr< Fluid2ComputeDivergence > mComputeDivergence
Definition: GteFluid2.h:50
std::shared_ptr< Fluid2UpdateState > mUpdateState
Definition: GteFluid2.h:49
std::shared_ptr< Texture2 > mStateTTexture
Definition: GteFluid2.h:56
std::shared_ptr< Fluid2SolvePoisson > mSolvePoisson
Definition: GteFluid2.h:51
std::shared_ptr< Texture2 > mDivergenceTexture
Definition: GteFluid2.h:58
float mDt
Definition: GteFluid2.h:40
std::shared_ptr< Fluid2InitializeState > mInitializeState
Definition: GteFluid2.h:47
std::shared_ptr< Texture2 > mSourceTexture
Definition: GteFluid2.h:54
int mYSize
Definition: GteFluid2.h:39
std::shared_ptr< Fluid2AdjustVelocity > mAdjustVelocity
Definition: GteFluid2.h:52
std::shared_ptr< Texture2 > mPoissonTexture
Definition: GteFluid2.h:59
std::shared_ptr< Fluid2InitializeSource > mInitializeSource
Definition: GteFluid2.h:46
std::shared_ptr< Texture2 > const & GetState() const
Definition: GteFluid2.h:62
std::shared_ptr< GraphicsEngine > mEngine
Definition: GteFluid2.h:38
std::shared_ptr< Fluid2EnforceStateBoundary > mEnforceStateBoundary
Definition: GteFluid2.h:48
std::shared_ptr< Texture2 > mStateTm1Texture
Definition: GteFluid2.h:55
std::shared_ptr< ConstantBuffer > mParameters
Definition: GteFluid2.h:45
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


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