VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtLightData.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
12 
13 #pragma warning( push )
14 #pragma warning( disable : 4251 )
15 
19 #include <vrvGraphicsUtils/DtIntSize.h>
20 
22 
23 #include <boost/array.hpp> // TODO: replace with std::array when c++11 is available
24 
25 namespace makVrv
26 {
27 
29  {
30  float ambient_spotx[4]; // ambient (xyz) + spot.x (w)
31  float diffuse_spoty[4]; // diffuse (xyz) + spot.y (w)
32  float specular_spotz[4]; // specular (xyz) + spot.z (w)
33 
34  float position_range[4]; // position (xyz) + range (w)
35  float direction_type[4]; // direction (xyz) + type (w)
36 
37  float attenuation_pack[4]; // attenuation (xyz) + pack (w)
38 
39  static size_t GetSizeInFloats(void);
40  };
41 
45  {
46  public:
48  DtLightData(size_t maxLights);
49 
51  virtual ~DtLightData();
52 
54  size_t maxLights(void) const;
56  size_t sizeInBytes(void) const;
58  size_t inUseSizeInBytes(void) const;
60  size_t inUseSliceSizeInBytes(void) const;
61 
63  void packLights(const VectorLights& lights);
65  void packLights(const VectorLights& lights, size_t total);
66 
68  float32* data(int slice);
69 
70  private:
71  // TODO: replace with std::array once c++11 is available.
72  boost::array<float32*, DtBindingManager::theLightBlockCount> myData;
73 
74  size_t myMaxLights; // maximum lights that we can store.
75  size_t myLightCount; // current light count
76 
78  void packLight(size_t offset, const DtLight* pLight);
79  };
80 
81 } //namespace makVrv
82 
83 #pragma warning( pop )
Helper class to pack lights into a buffer/texture.
Definition: DtLightData.h:44
Dll export defines.
float diffuse_spoty[4]
Definition: DtLightData.h:31
boost::array< float32 *, DtBindingManager::theLightBlockCount > myData
Definition: DtLightData.h:72
Definition: DtLightData.h:28
Contains the vrvOsg::DtBindingManager class.
#define FORWARD_DECLARE_DIFFERENT_SUFFIX(T, U)
Definition: DtForwardDeclare.h:31
float attenuation_pack[4]
Definition: DtLightData.h:37
float direction_type[4]
Definition: DtLightData.h:35
float position_range[4]
Definition: DtLightData.h:34
float float32
Definition: DtCommonTypes.h:33
float ambient_spotx[4]
Definition: DtLightData.h:30
static size_t GetSizeInFloats(void)
Enumerations for various types of texture/buffer formats.
Class for generic lights.
Definition: DtLight.h:48
size_t myMaxLights
Definition: DtLightData.h:74
#define DT_DLL_VRVGRAPHICSUTILS
Definition: vrvGraphicsUtils.h:18
float specular_spotz[4]
Definition: DtLightData.h:32
voidpf uLong offset
Definition: ioapi.h:42
size_t myLightCount
Definition: DtLightData.h:75
Helpers to easily define forward declarations.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)