|
Carna
Version 3.0.1
|
Implements NormalMap3D generically for a particular VoxelType. More...
#include <BufferedNormalMap3D.h>
Inheritance diagram for Carna::base::BufferedNormalMap3D< BufferedVectorComponentType, BufferType >:
Collaboration diagram for Carna::base::BufferedNormalMap3D< BufferedVectorComponentType, BufferType >:Public Types | |
| typedef BufferType | Buffer |
| Holds the used buffer type. | |
| typedef BufferedVectorComponentType | BufferedVectorComponent |
| Holds the type used to store the components of the normal vectors. | |
Public Types inherited from Carna::base::math::VectorField< math::Vector3f > | |
| typedef math::Vector3f | Value |
| Holds the co-domain type of the vector field. | |
Public Member Functions | |
| BufferedNormalMap3D (const math::Vector3ui &size, Association< BufferType > *buffer) | |
| Instantiates. More... | |
| BufferedNormalMap3D (const math::Vector3ui &size) | |
| math::Vector3f | operator() (const math::Vector3ui &location) const |
| Decodes and tells the vector stored at location. | |
| math::Vector3f | operator() (unsigned int x, unsigned int y, unsigned int z) const |
| void | setVoxel (const math::Vector3ui &location, const math::Vector3f &normal) |
| Encodes normal and stores it at location. | |
| void | setVoxel (unsigned int x, unsigned int y, unsigned int z, const math::Vector3f &normal) |
| BufferType & | buffer () |
| References the underlying buffer. | |
| const BufferType & | buffer () const |
| References the underlying buffer. | |
Public Member Functions inherited from Carna::base::NormalMap3D | |
| NormalMap3D () | |
| Instantiates. | |
| NormalMap3D (const math::Vector3ui &size) | |
| Instantiates. | |
Public Member Functions inherited from Carna::base::math::VectorField< math::Vector3f > | |
| virtual | ~VectorField () |
| Does nothing. | |
Static Public Member Functions | |
| static float | decodeComponent (BufferedVectorComponentType encodedVectorComponent) |
| Returns the actual normal vector component corresponding to encodedVectorComponent. More... | |
| static BufferedVectorComponentType | encodeComponent (float actualVectorComponent) |
| Returns the buffered vector component corresponding to actualVectorComponent. More... | |
Protected Attributes | |
| const std::unique_ptr< Association< BufferType > > | myBuffer |
| Holds the buffer. | |
Additional Inherited Members | |
Public Attributes inherited from Carna::base::NormalMap3D | |
| math::Vector3ui | size |
| Holds the resolution. | |
Implements NormalMap3D generically for a particular VoxelType.
| BufferedVectorComponentType | is the data type used to store the components of a single normal. Only integral data types are allowed. |
| BufferType | is the data type used as container for the normal vectors. |
glTexImage3d caused read access errors on Windows when used with three channel textures, whereas it worked nicely on Linux. This class ignores the values stored within the fourth channel.Definition at line 59 of file BufferedNormalMap3D.h.
|
inline |
Instantiates.
buffer != nullptr && buffer->get() != nullptr (**buffer).size() >= 4 * sizeof(BufferedVectorComponentType) * size.x * size.y * size.z Definition at line 84 of file BufferedNormalMap3D.h.
|
inlineexplicit |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 93 of file BufferedNormalMap3D.h.
|
inlinestatic |
Returns the actual normal vector component corresponding to encodedVectorComponent.
This function maps encodedVectorComponent to \(\left[-1, 1\right]\), whereby the minimum of BufferedVectorComponentType is mapped to \(-1\) and its maximum to \(+1\).
Definition at line 109 of file BufferedNormalMap3D.h.
|
inlinestatic |
Returns the buffered vector component corresponding to actualVectorComponent.
This function maps actualVectorComponent to values from the minimum of BufferedVectorComponentType to its maximum linearly.
std::abs(actualVectorComponent) <= 1 Definition at line 127 of file BufferedNormalMap3D.h.
|
inlinevirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Implements Carna::base::math::VectorField< math::Vector3f >.
Definition at line 151 of file BufferedNormalMap3D.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 173 of file BufferedNormalMap3D.h.
Documentation generated by Doxygen