VR-Forces 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) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
12 
13 #pragma warning( push )
14 #pragma warning( disable : 4251 )
15 
18 
19 #include <vrvMath/DtDataFormat.h>
20 #include <vrvMath/DtIntSize.h>
21 
22 #include <vector>
23 
24 namespace makVrv
25 {
27  {
28  float ambient_spotx[4]; // ambient (xyz) + spot.x (w)
29  float diffuse_spoty[4]; // diffuse (xyz) + spot.y (w)
30  float specular_spotz[4]; // specular (xyz) + spot.z (w)
31 
32  float position_range[4]; // position (xyz) + range (w)
33  float direction_type[4]; // direction (xyz) + type (w)
34 
35  float attenuation_pack[4]; // attenuation (xyz) + pack (w)
36 
37  static size_t GetSizeInFloats(void);
38  };
39 
43  {
44  public:
46  DtLightData(size_t maxLights, size_t lightBlockCount);
47 
49  virtual ~DtLightData();
50 
51  private:
53  DtLightData() = delete;
54 
56  DtLightData(const DtLightData&) = delete;
57 
59  DtLightData& operator=(const DtLightData&) = delete;
60 
61  public:
63  virtual size_t maxLights(void) const;
64 
66  virtual size_t sizeInBytes(void) const;
67 
69  virtual size_t inUseSizeInBytes(void) const;
70 
72  virtual size_t inUseSliceSizeInBytes(void) const;
73 
75  virtual void packLights(const LightReusableVector& lights);
76 
78  virtual float32* data(int slice);
79 
80  protected:
82  virtual void packLight(size_t offset, const DtLight* pLight);
83 
84  protected:
85  std::vector<float32*> myData;
86 
87  const size_t myMaxLights; // maximum lights that we can store.
88  size_t myLightCount; // current light count
89 
90  const size_t myLightBlockCount;
91  };
92 
93 } //namespace makVrv
94 
95 #pragma warning( pop )
Helper class to pack lights into a buffer/texture.
Definition: DtLightData.h:42
std::vector< float32 * > myData
Definition: DtLightData.h:85
Dll export defines.
float diffuse_spoty[4]
Definition: DtLightData.h:29
const size_t myLightBlockCount
Definition: DtLightData.h:90
const size_t myMaxLights
Definition: DtLightData.h:87
Definition: DtLightData.h:26
float attenuation_pack[4]
Definition: DtLightData.h:35
float direction_type[4]
Definition: DtLightData.h:33
float position_range[4]
Definition: DtLightData.h:32
Light class.
float float32
Definition: DtCommonTypes.h:33
float ambient_spotx[4]
Definition: DtLightData.h:28
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:49
DtIntSize class.
#define DT_DLL_VRVGRAPHICSUTILS
Definition: vrvGraphicsUtils.h:18
float specular_spotz[4]
Definition: DtLightData.h:30
voidpf uLong offset
Definition: ioapi.h:42
size_t myLightCount
Definition: DtLightData.h:88
Helpers to easily define forward declarations.

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)