VR-Forces 5.0.2 Developer's Guide
 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) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
12 
13 #pragma warning( push )
14 #pragma warning( disable : 4251 )
15 
20 
21 #include <vector>
22 
23 namespace makVrv
24 {
26  {
27  float ambient_spotx[4]; // ambient (xyz) + spot.x (w)
28  float diffuse_spoty[4]; // diffuse (xyz) + spot.y (w)
29  float specular_spotz[4]; // specular (xyz) + spot.z (w)
30 
31  float position_range[4]; // position (xyz) + range (w)
32  float direction_type[4]; // direction (xyz) + type (w)
33 
34  float attenuation_pack[4]; // attenuation (xyz) + pack (w)
35 
36  static size_t GetSizeInFloats(void);
37  };
38 
42  {
43  public:
45  DtLightData(size_t maxLights, size_t lightBlockCount);
46 
48  virtual ~DtLightData();
49 
50  private:
52  DtLightData() = delete;
53 
55  DtLightData(const DtLightData&) = delete;
56 
58  DtLightData& operator=(const DtLightData&) = delete;
59 
60  public:
62  virtual size_t maxLights(void) const;
63 
65  virtual size_t sizeInBytes(void) const;
66 
68  virtual size_t inUseSizeInBytes(void) const;
69 
71  virtual size_t inUseSliceSizeInBytes(void) const;
72 
74  virtual void packLights(const LightReusableVector& lights);
75 
77  virtual float32* data(int slice);
78 
79  protected:
81  virtual void packLight(size_t offset, const DtLight* pLight);
82 
83  protected:
84  std::vector<float32*> myData;
85 
86  const size_t myMaxLights; // maximum lights that we can store.
87  size_t myLightCount; // current light count
88 
89  const size_t myLightBlockCount;
90  };
91 
92 } //namespace makVrv
93 
94 #pragma warning( pop )
Helper class to pack lights into a buffer/texture.
Definition: DtLightData.h:41
std::vector< float32 * > myData
Definition: DtLightData.h:84
Dll export defines.
float diffuse_spoty[4]
Definition: DtLightData.h:28
const size_t myLightBlockCount
Definition: DtLightData.h:89
const size_t myMaxLights
Definition: DtLightData.h:86
Definition: DtLightData.h:25
float attenuation_pack[4]
Definition: DtLightData.h:34
float direction_type[4]
Definition: DtLightData.h:32
float position_range[4]
Definition: DtLightData.h:31
Light class.
float float32
Definition: DtCommonTypes.h:33
float ambient_spotx[4]
Definition: DtLightData.h:27
static size_t GetSizeInFloats(void)
Enumerations for various types of texture/buffer formats.
Class for generic lights This holds per-light data such as range, attenuation factors, colors, etc.
Definition: DtLight.h:48
DtIntSize class.
#define DT_DLL_VRVGRAPHICSUTILS
Definition: vrvGraphicsUtils.h:18
float specular_spotz[4]
Definition: DtLightData.h:29
voidpf uLong offset
Definition: ioapi.h:42
size_t myLightCount
Definition: DtLightData.h:87
Helpers to easily define forward declarations.

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)