Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::Procedural::BoxUVModifier Class Reference

A modifier that will generate UV coordinates as they would need to be on a box model. More...

#include <boxuvmodifier.h>

+ Inheritance diagram for Mezzanine::Graphics::Procedural::BoxUVModifier:
+ Collaboration diagram for Mezzanine::Graphics::Procedural::BoxUVModifier:

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...
 
BoxUVModifierSetBoxHalfSize (const Vector3 &HalfSize)
 Sets the half-size of the Box to project UV's onto. More...
 
BoxUVModifierSetBoxHalfSize (const Real X, const Real Y, const Real Z)
 Sets the half-size of the Box to project UV's onto. More...
 
BoxUVModifierSetBoxPosition (const Vector3 &Position)
 Sets the center position of the Box to project UV's onto. More...
 
BoxUVModifierSetBoxPosition (const Real X, const Real Y, const Real Z)
 Sets the center position of the Box to project UV's onto. More...
 
BoxUVModifierSetMappingType (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...
 

Detailed Description

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.

Member Enumeration Documentation

An enum describing how the quads for the cube are expected to be laid out on the texture.

Enumerator
MT_Cross 

Each face of the cube is packed into a 4x3 texture atlas and is arranged into a cross shape.

MT_Packed 

Each face of the cube is packed into a 3x2 texture atlas.

MT_Full 

There is only one texture to use for each face of the cube.

Definition at line 98 of file boxuvmodifier.h.

Member Function Documentation

String Mezzanine::Graphics::Procedural::BoxUVModifier::GetName ( ) const
virtual

Gets the name of this modifier.

Returns
Returns a string containing the name of this modifier.

Implements Mezzanine::Graphics::Procedural::MeshModifier.

Definition at line 142 of file boxuvmodifier.cpp.

void Mezzanine::Graphics::Procedural::BoxUVModifier::Modify ( TriangleBuffer Buffer)
virtual

Alters the generated pixels in a TriangleBuffer.

Parameters
BufferThe 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.

Parameters
HalfSizeHalf the size of the Box to generate UV's with.
Returns
Returns a reference to this.

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.

Parameters
XHalf the size of the Box to generate UV's with on the X axis.
YHalf the size of the Box to generate UV's with on the Y axis.
ZHalf the size of the Box to generate UV's with on the Z axis.
Returns
Returns a reference to this.

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.

Parameters
PositionThe central position of the Box.
Returns
Returns a reference to this.

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.

Parameters
XThe central position of the Box on the X axis.
YThe central position of the Box on the Y axis.
ZThe central position of the Box on the Z axis.
Returns
Returns a reference to this.

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.

Parameters
TypeThe type of mapping to expect when setting up the UV's.
Returns
Returns a reference to this.

Definition at line 148 of file boxuvmodifier.cpp.

Member Data Documentation

Vector3 Mezzanine::Graphics::Procedural::BoxUVModifier::BoxHalfExtents
protected

The half-size of the box on each dimension.

Definition at line 107 of file boxuvmodifier.h.

Vector3 Mezzanine::Graphics::Procedural::BoxUVModifier::BoxPosition
protected

The central position of the box.

Definition at line 110 of file boxuvmodifier.h.

MappingType Mezzanine::Graphics::Procedural::BoxUVModifier::Mapping
protected

How the quads for the cube are expected to be laid out on the texture.

Definition at line 113 of file boxuvmodifier.h.


The documentation for this class was generated from the following files: