GteFluid3InitializeState.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 
12 #include <Graphics/GteTexture3.h>
13 
14 namespace gte
15 {
16 
17 class GraphicsEngine;
18 
20 {
21 public:
22  // Construction. The initial velocity is zero and the initial density
23  // is randomly generated with values in [0,1].
24  Fluid3InitializeState(std::shared_ptr<ProgramFactory> const& factory,
25  int xSize, int ySize, int zSize, int numXThreads, int numYThreads, int numZThreads);
26 
27  // Member access. The texels are (velocity.xyz, density).
28  inline std::shared_ptr<Texture3> const& GetStateTm1() const;
29  inline std::shared_ptr<Texture3> const& GetStateT() const;
30 
31  // Compute the initial density and initial velocity for the fluid
32  // simulation.
33  void Execute(std::shared_ptr<GraphicsEngine> const& engine);
34 
35 private:
36  int mNumXGroups, mNumYGroups, mNumZGroups;
37  std::shared_ptr<ComputeProgram> mInitializeState;
38  std::shared_ptr<Texture3> mDensity;
39  std::shared_ptr<Texture3> mVelocity;
40  std::shared_ptr<Texture3> mStateTm1;
41  std::shared_ptr<Texture3> mStateT;
42 
43  // Shader source code as strings.
44  static std::string const msGLSLSource;
45  static std::string const msHLSLSource;
46  static std::string const* msSource[ProgramFactory::PF_NUM_API];
47 };
48 
49 inline std::shared_ptr<Texture3> const& Fluid3InitializeState::GetStateTm1() const
50 {
51  return mStateTm1;
52 }
53 
54 inline std::shared_ptr<Texture3> const& Fluid3InitializeState::GetStateT() const
55 {
56  return mStateT;
57 }
58 
59 }
std::shared_ptr< ComputeProgram > mInitializeState
std::shared_ptr< Texture3 > const & GetStateT() const
std::shared_ptr< Texture3 > mDensity
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
std::shared_ptr< Texture3 > mVelocity
static std::string const msGLSLSource
static std::string const msHLSLSource
std::shared_ptr< Texture3 > mStateTm1
std::shared_ptr< Texture3 > mStateT
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63
std::shared_ptr< Texture3 > const & GetStateTm1() const


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