Cafu Engine
SurfaceInfoT Class Reference

This class holds all information that is needed in order to compute the UV texture-space coordinates of (and thus to apply a material onto) a primitive surface. More...

#include "SurfaceInfo.hpp"

Public Member Functions

 SurfaceInfoT ()
 The default constructor. More...
 
 SurfaceInfoT (const Plane3fT &Plane, bool FaceAligned)
 The constructor for creating a SurfaceInfoT in plane projection mode, matching the given plane. More...
 
void Save_cmap (std::ostream &OutFile) const
 Serializes this instance into a cmap file. More...
 
void ResetUVAxes (const Plane3fT &Plane, bool FaceAligned)
 Resets the texture-space u- and v-axes as appropriate for the given plane. More...
 
void WrapTranslations ()
 Wraps the Trans[] members so that they are in the interval [0, 1[. More...
 
void RotateUVAxes (float Angle)
 Rotates the texture-space u- and v-axes by the given angle. More...
 
void AlignMaterial (const char *AlignKey, const ArrayT< Vector3fT > &Vertices)
 Changes this SurfaceInfoT so that the material is aligned on the surface according to AlignKey. More...
 

Static Public Member Functions

static SurfaceInfoT Create_cmap (TextParserT &TP)
 Named constructor for loading a SurfaceInfoT from a cmap file. More...
 

Public Attributes

TexCoordGenModeT TexCoordGenMode
 Determines the algorithm that is used to generate texture-coordinates for the associated map primitive. More...
 
float Trans [2]
 
float Scale [2]
 
float Rotate
 
Vector3fT UAxis
 
Vector3fT VAxis
 
float LightmapScale
 

Detailed Description

This class holds all information that is needed in order to compute the UV texture-space coordinates of (and thus to apply a material onto) a primitive surface.

Constructor & Destructor Documentation

SurfaceInfoT::SurfaceInfoT ( )

The default constructor.

SurfaceInfoT::SurfaceInfoT ( const Plane3fT Plane,
bool  FaceAligned 
)

The constructor for creating a SurfaceInfoT in plane projection mode, matching the given plane.

Member Function Documentation

void SurfaceInfoT::AlignMaterial ( const char *  AlignKey,
const ArrayT< Vector3fT > &  Vertices 
)

Changes this SurfaceInfoT so that the material is aligned on the surface according to AlignKey.

Parameters
AlignKeyHow the material is aligned wrt. the surface. Valid keys are "top", "bottom", "left", "right", "center" and "fit".
VerticesThe vertices of the surface for which the alignment is to be computed.
SurfaceInfoT SurfaceInfoT::Create_cmap ( TextParserT TP)
static

Named constructor for loading a SurfaceInfoT from a cmap file.

void SurfaceInfoT::ResetUVAxes ( const Plane3fT Plane,
bool  FaceAligned 
)

Resets the texture-space u- and v-axes as appropriate for the given plane.

Parameters
PlaneThe plane with reference to which the axes are reset.
FaceAlignedWhen true, the axes are re-initialized face-aligned, world-aligned otherwise.
void SurfaceInfoT::RotateUVAxes ( float  Angle)

Rotates the texture-space u- and v-axes by the given angle.

Parameters
AngleThe angle of rotation, in degrees.
void SurfaceInfoT::Save_cmap ( std::ostream &  OutFile) const

Serializes this instance into a cmap file.

void SurfaceInfoT::WrapTranslations ( )

Wraps the Trans[] members so that they are in the interval [0, 1[.

Member Data Documentation

TexCoordGenModeT SurfaceInfoT::TexCoordGenMode

Determines the algorithm that is used to generate texture-coordinates for the associated map primitive.


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