GtePlanarReflectionEffect.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/GtePVWUpdater.h>
13 #include <Graphics/GteVisual.h>
14 
15 namespace gte
16 {
17 
19 {
20 public:
21  // Construction. The number of planes supported depends on the number of
22  // stencil bits (256 for an 8-bit stencil buffer). The planes must be opaque.
23  PlanarReflectionEffect(std::vector<std::shared_ptr<Visual>> const& planes,
24  std::vector<float> const& reflectances);
25 
26  virtual void Draw(std::shared_ptr<GraphicsEngine> const& engine,
27  VisibleSet const& visibleSet, PVWUpdater& pvwMatrices);
28 
29  // Member access. GetPlane(i) returns (origin,normal).
30  inline int GetNumPlanes() const;
31  std::pair<Vector4<float>, Vector4<float>> GetPlane(int i) const;
32  std::shared_ptr<Visual> GetPlaneVisual(int i) const;
33  void SetReflectance(int i, float reflectance);
34  float GetReflectance(int i) const;
35 
36 protected:
37  std::vector<std::shared_ptr<Visual>> mPlanes;
38  std::vector<float> mReflectances;
39  std::vector<Vector4<float>> mPlaneOrigins, mPlaneNormals;
40  std::shared_ptr<BlendState> mNoColorWrites, mReflectanceBlend;
41  std::shared_ptr<RasterizerState> mCullReverse;
42  std::shared_ptr<DepthStencilState> mDSPass0, mDSPass1, mDSPass2;
43 };
44 
45 
47 {
48  return static_cast<int>(mPlanes.size());
49 }
50 
51 }
std::vector< Visual * > VisibleSet
Definition: GteCuller.h:47
std::vector< Vector4< float > > mPlaneOrigins
std::shared_ptr< DepthStencilState > mDSPass2
std::vector< std::shared_ptr< Visual > > mPlanes
std::shared_ptr< BlendState > mReflectanceBlend
std::shared_ptr< RasterizerState > mCullReverse
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:01