A modifier that will generate UV coordinates as they would need to be on a box model. More...
#include <boxuvmodifier.h>
Public Types | |
enum | MappingType { MT_Cross = 1, MT_Packed = 2, MT_Full = 3 } |
An enum describing how the quads for the cube are expected to be laid out on the texture. More... | |
Public Member Functions | |
BoxUVModifier () | |
Blank constructor. | |
virtual | ~BoxUVModifier () |
Class destructor. | |
virtual String | GetName () const |
Gets the name of this modifier. More... | |
virtual void | Modify (TriangleBuffer &Buffer) |
Alters the generated pixels in a TriangleBuffer. More... | |
BoxUVModifier & | SetBoxHalfSize (const Vector3 &HalfSize) |
Sets the half-size of the Box to project UV's onto. More... | |
BoxUVModifier & | SetBoxHalfSize (const Real X, const Real Y, const Real Z) |
Sets the half-size of the Box to project UV's onto. More... | |
BoxUVModifier & | SetBoxPosition (const Vector3 &Position) |
Sets the center position of the Box to project UV's onto. More... | |
BoxUVModifier & | SetBoxPosition (const Real X, const Real Y, const Real Z) |
Sets the center position of the Box to project UV's onto. More... | |
BoxUVModifier & | SetMappingType (const MappingType Type) |
Sets the UV mapping mode to be expected to be used with the mesh. More... | |
Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshModifier | |
MeshModifier () | |
Blank constructor. | |
virtual | ~MeshModifier () |
Class destructor. | |
Protected Attributes | |
Vector3 | BoxHalfExtents |
The half-size of the box on each dimension. More... | |
Vector3 | BoxPosition |
The central position of the box. More... | |
MappingType | Mapping |
How the quads for the cube are expected to be laid out on the texture. More... | |
A modifier that will generate UV coordinates as they would need to be on a box model.
The mapping type used here will not necessarily make or break the actual operation performed, it simple sets the data for a particular expectation. All of the axes specified here are in local model space.
MT_Full is the simplest setup and is used for most if not all tutorial setups and it is where it uses the full texture, stretches it to match the aspect ratio of the face, and copies it for each face on the box. The other setups are a little more complicated.
MT_Cross is a more typical example of a professional cube map, where you place the quads for each face on a texture partitioned in a 4x3 grid with the middle row occupied by the X and Z axis faces in the following order: (-X,-Z,+X,+Z), and the top and bottom of the second column (from the left) occupied by the Y axis faces: +Y on top and -Y on bottom.
MT_Packed is where a texture is partitioned into a 3x2 grid, and unlike MT_Cross, will take up the entire texture. The top row are the positive facing directions in alphabetical order (+X,+Y,+Z) from left to right. The bottom row are the negative facing directions, also in alphabetical order (-X,-Y,-Z) from left to right.
Definition at line 94 of file boxuvmodifier.h.
An enum describing how the quads for the cube are expected to be laid out on the texture.
Definition at line 98 of file boxuvmodifier.h.
|
virtual |
Gets the name of this modifier.
Implements Mezzanine::Graphics::Procedural::MeshModifier.
Definition at line 142 of file boxuvmodifier.cpp.
|
virtual |
Alters the generated pixels in a TriangleBuffer.
Buffer | The buffer to be modified. |
Implements Mezzanine::Graphics::Procedural::MeshModifier.
Definition at line 90 of file boxuvmodifier.cpp.
BoxUVModifier & Mezzanine::Graphics::Procedural::BoxUVModifier::SetBoxHalfSize | ( | const Vector3 & | HalfSize | ) |
Sets the half-size of the Box to project UV's onto.
HalfSize | Half the size of the Box to generate UV's with. |
Definition at line 166 of file boxuvmodifier.cpp.
BoxUVModifier & Mezzanine::Graphics::Procedural::BoxUVModifier::SetBoxHalfSize | ( | const Real | X, |
const Real | Y, | ||
const Real | Z | ||
) |
Sets the half-size of the Box to project UV's onto.
X | Half the size of the Box to generate UV's with on the X axis. |
Y | Half the size of the Box to generate UV's with on the Y axis. |
Z | Half the size of the Box to generate UV's with on the Z axis. |
Definition at line 172 of file boxuvmodifier.cpp.
BoxUVModifier & Mezzanine::Graphics::Procedural::BoxUVModifier::SetBoxPosition | ( | const Vector3 & | Position | ) |
Sets the center position of the Box to project UV's onto.
Position | The central position of the Box. |
Definition at line 154 of file boxuvmodifier.cpp.
BoxUVModifier & Mezzanine::Graphics::Procedural::BoxUVModifier::SetBoxPosition | ( | const Real | X, |
const Real | Y, | ||
const Real | Z | ||
) |
Sets the center position of the Box to project UV's onto.
X | The central position of the Box on the X axis. |
Y | The central position of the Box on the Y axis. |
Z | The central position of the Box on the Z axis. |
Definition at line 160 of file boxuvmodifier.cpp.
BoxUVModifier & Mezzanine::Graphics::Procedural::BoxUVModifier::SetMappingType | ( | const MappingType | Type | ) |
Sets the UV mapping mode to be expected to be used with the mesh.
Type | The type of mapping to expect when setting up the UV's. |
Definition at line 148 of file boxuvmodifier.cpp.
|
protected |
The half-size of the box on each dimension.
Definition at line 107 of file boxuvmodifier.h.
|
protected |
The central position of the box.
Definition at line 110 of file boxuvmodifier.h.
|
protected |
How the quads for the cube are expected to be laid out on the texture.
Definition at line 113 of file boxuvmodifier.h.