![]() |
LibCarna Version 3.4.0
|
Implements NormalMap3D generically for a particular VoxelType. More...
#include <BufferedNormalMap3D.hpp>
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. | |
![]() | |
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. | |
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. | |
![]() | |
NormalMap3D () | |
Instantiates. | |
NormalMap3D (const math::Vector3ui &size) | |
Instantiates. | |
![]() | |
virtual | ~VectorField () |
Does nothing. | |
Static Public Member Functions | |
static float | decodeComponent (BufferedVectorComponentType encodedVectorComponent) |
Returns the actual normal vector component corresponding to encodedVectorComponent. | |
static BufferedVectorComponentType | encodeComponent (float actualVectorComponent) |
Returns the buffered vector component corresponding to actualVectorComponent. | |
Protected Attributes | |
const std::unique_ptr< Association< BufferType > > | myBuffer |
Holds the buffer. | |
Additional Inherited Members | |
![]() | |
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 62 of file BufferedNormalMap3D.hpp.
typedef BufferType LibCarna::base::BufferedNormalMap3D< BufferedVectorComponentType, BufferType >::Buffer |
Holds the used buffer type.
Definition at line 74 of file BufferedNormalMap3D.hpp.
typedef BufferedVectorComponentType LibCarna::base::BufferedNormalMap3D< BufferedVectorComponentType, BufferType >::BufferedVectorComponent |
Holds the type used to store the components of the normal vectors.
Definition at line 79 of file BufferedNormalMap3D.hpp.
|
inline |
Instantiates.
buffer != nullptr && buffer->get() != nullptr
(**buffer).size() >= 4 * sizeof(BufferedVectorComponentType) * size.x * size.y * size.z
Definition at line 87 of file BufferedNormalMap3D.hpp.
|
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 96 of file BufferedNormalMap3D.hpp.
|
inline |
References the underlying buffer.
Definition at line 188 of file BufferedNormalMap3D.hpp.
|
inline |
References the underlying buffer.
Definition at line 196 of file BufferedNormalMap3D.hpp.
|
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 112 of file BufferedNormalMap3D.hpp.
|
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 130 of file BufferedNormalMap3D.hpp.
|
inlinevirtual |
Decodes and tells the vector stored at location.
Reimplemented from LibCarna::base::math::VectorField< math::Vector3f >.
Definition at line 146 of file BufferedNormalMap3D.hpp.
|
inlinevirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Implements LibCarna::base::math::VectorField< math::Vector3f >.
Definition at line 153 of file BufferedNormalMap3D.hpp.
|
inline |
Encodes normal and stores it at location.
Definition at line 169 of file BufferedNormalMap3D.hpp.
|
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 176 of file BufferedNormalMap3D.hpp.
|
protected |
Holds the buffer.
Definition at line 206 of file BufferedNormalMap3D.hpp.
Written by Leonid Kostrykin © 2021–2025. Based on Carna (© 2010-2016).
Documentation generated by Doxygen