5#ifndef S_MATERIAL_LAYER_HPP_INCLUDED
6#define S_MATERIAL_LAYER_HPP_INCLUDED
8#include <nirtcpp/core/engine/matrix4.hpp>
9#include <nirtcpp/core/engine/irrAllocator.hpp>
37 static const char*
const aTextureClampNames[] = {
38 "texture_clamp_repeat",
39 "texture_clamp_clamp",
40 "texture_clamp_clamp_to_edge",
41 "texture_clamp_clamp_to_border",
42 "texture_clamp_mirror",
43 "texture_clamp_mirror_clamp",
44 "texture_clamp_mirror_clamp_to_edge",
45 "texture_clamp_mirror_clamp_to_border", 0};
72 MatrixAllocator.destruct(TextureMatrix);
73 MatrixAllocator.deallocate(TextureMatrix);
89 if (other.TextureMatrix)
90 *TextureMatrix = *other.TextureMatrix;
93 MatrixAllocator.destruct(TextureMatrix);
94 MatrixAllocator.deallocate(TextureMatrix);
100 if (other.TextureMatrix)
102 TextureMatrix = MatrixAllocator.allocate(1);
103 MatrixAllocator.construct(TextureMatrix,*other.TextureMatrix);
109 TextureWrapV = other.TextureWrapV;
110 TextureWrapW = other.TextureWrapW;
125 TextureMatrix = MatrixAllocator.allocate(1);
128 return *TextureMatrix;
136 return *TextureMatrix;
149 TextureMatrix = MatrixAllocator.allocate(1);
150 MatrixAllocator.construct(TextureMatrix,mat);
153 *TextureMatrix = mat;
164 TextureWrapV != b.TextureWrapV ||
165 TextureWrapW != b.TextureWrapW ||
173 different |= (TextureMatrix != b.TextureMatrix) &&
174 (!TextureMatrix || !b.TextureMatrix || (*TextureMatrix != *(b.TextureMatrix)));
182 {
return !(b!=*
this); }
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
Definition matrix4.hpp:49
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Interface of a Video Driver dependent Texture.
Definition ITexture.hpp:186
Class for holding material parameters which exist per texture layer.
Definition SMaterialLayer.hpp:50
bool TrilinearFilter
Is trilinear filtering enabled? Default: false.
Definition SMaterialLayer.hpp:199
s8 LODBias
Bias for the mipmap choosing decision.
Definition SMaterialLayer.hpp:215
bool operator==(const SMaterialLayer &b) const
Equality operator.
Definition SMaterialLayer.hpp:181
ITexture * Texture
Texture.
Definition SMaterialLayer.hpp:185
u8 TextureWrapU
Texture Clamp Mode.
Definition SMaterialLayer.hpp:189
SMaterialLayer & operator=(const SMaterialLayer &other)
Assignment operator.
Definition SMaterialLayer.hpp:80
SMaterialLayer()
Default constructor.
Definition SMaterialLayer.hpp:53
const core::matrix4 & getTextureMatrix() const
Gets the immutable texture transformation matrix.
Definition SMaterialLayer.hpp:133
u8 AnisotropicFilter
Is anisotropic filtering enabled? Default: 0, disabled.
Definition SMaterialLayer.hpp:208
void setTextureMatrix(const core::matrix4 &mat)
Sets the texture transformation matrix to mat.
Definition SMaterialLayer.hpp:145
SMaterialLayer(const SMaterialLayer &other)
Copy constructor.
Definition SMaterialLayer.hpp:60
bool operator!=(const SMaterialLayer &b) const
Inequality operator.
Definition SMaterialLayer.hpp:159
~SMaterialLayer()
Destructor.
Definition SMaterialLayer.hpp:68
core::matrix4 & getTextureMatrix()
Gets the texture transformation matrix.
Definition SMaterialLayer.hpp:121
bool BilinearFilter
Is bilinear filtering enabled? Default: true.
Definition SMaterialLayer.hpp:194
Class for holding parameters for a material renderer.
Definition SMaterial.hpp:304
NIRTCPP_API const matrix4 IdentityMatrix
global const identity matrix
E_TEXTURE_CLAMP
Texture coord clamp mode outside [0.0, 1.0].
Definition SMaterialLayer.hpp:19
@ ETC_REPEAT
Texture repeats.
Definition SMaterialLayer.hpp:21
@ ETC_CLAMP_TO_BORDER
Texture is clamped to the border pixel (if exists)
Definition SMaterialLayer.hpp:27
@ ETC_MIRROR
Texture is alternatingly mirrored (0..1..0..1..0..)
Definition SMaterialLayer.hpp:29
@ ETC_MIRROR_CLAMP_TO_BORDER
Texture is mirrored once and then clamped to border.
Definition SMaterialLayer.hpp:35
@ ETC_CLAMP
Texture is clamped to the last pixel.
Definition SMaterialLayer.hpp:23
@ ETC_CLAMP_TO_EDGE
Texture is clamped to the edge pixel.
Definition SMaterialLayer.hpp:25
@ ETC_MIRROR_CLAMP_TO_EDGE
Texture is mirrored once and then clamped to edge.
Definition SMaterialLayer.hpp:33
@ ETC_MIRROR_CLAMP
Texture is mirrored once and then clamped (0..1..0)
Definition SMaterialLayer.hpp:31
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed char s8
8 bit signed variable.
Definition irrTypes.hpp:32
unsigned char u8
8 bit unsigned variable.
Definition irrTypes.hpp:24