arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

glift::CoordTrans Class Reference

#include <coordTrans.h>

Inheritance diagram for glift::CoordTrans:

glift::GliftObject List of all members.

Detailed Description

CoordTrans - Encapsulates a 4x4 matrix transform that can be specified as an absolute or relative transform.

It is most commonly used to transform texture coordinates of the primitive to which a shader is applied.

CoordTrans

Definition at line 45 of file coordTrans.h.

Public Member Functions

 CoordTrans ()
 CoordTrans (const gutz::vec2f &bias, bool relBias=false)
 CoordTrans (const gutz::vec3f &bias, bool relBias=false)
 CoordTrans (const gutz::vec3f &scale, const gutz::vec3f &bias, bool relScale, bool relBias)
 CoordTrans (const gutz::mat4f &mat, bool relScale=false, bool relTrans=false)
gutz::vec2f apply (const gutz::vec2f &coord, const gutz::vec2f &divisor)
 Apply transform to 'coord'.

gutz::vec3f apply (const gutz::vec3f &coord, const gutz::vec3f &divisor)
gutz::arrayo1f apply (const gutz::arrayw1f &coord, const gutz::arrayw1f &divisor)
virtual void setErrStream (std::ostream *os)
 Where do you want gl errors to go? they must go somewhere, so don't set it to zero please.

virtual std::ostream * getErrStream () const
 Where are gl errors going?


Protected Member Functions

void err (const char *where, const char *when=0) const
 error

std::ostream & err () const
 a simpler way, just use the stream! only for always print, this one automatically adds the objects name

void derr (const char *where, const char *when=0) const
 debug error

bool glerr (const char *where, const char *when=0) const
 gl error report only in debug mode, only if there is an error, if so return true

std::ostream & estr () const
 this one just gives you the stream


Protected Attributes

std::ostream * m_err


Constructor & Destructor Documentation

CoordTrans::CoordTrans  ) 
 

Definition at line 28 of file coordTrans.cpp.

References init(), and gutz::vec3f.

CoordTrans::CoordTrans const gutz::vec2f bias,
bool  relBias = false
 

Definition at line 33 of file coordTrans.cpp.

References bias, init(), and gutz::vec3f.

CoordTrans::CoordTrans const gutz::vec3f bias,
bool  relBias = false
 

Definition at line 38 of file coordTrans.cpp.

References bias, init(), and gutz::vec3f.

CoordTrans::CoordTrans const gutz::vec3f scale,
const gutz::vec3f bias,
bool  relScale,
bool  relBias
 

Definition at line 43 of file coordTrans.cpp.

References bias, init(), and scale.

CoordTrans::CoordTrans const gutz::mat4f mat,
bool  relScale = false,
bool  relTrans = false
 

Definition at line 48 of file coordTrans.cpp.


Member Function Documentation

gutz::arrayo1f CoordTrans::apply const gutz::arrayw1f coord,
const gutz::arrayw1f divisor
 

Homogeneous 4-vec

Make a relative transform if requested

Do the transform

No default necessary b/c already checked above that one of these is valid.

Definition at line 83 of file coordTrans.cpp.

References gutz::arrayo1f, coord, glift::GliftObject::err(), gutz::mat4f, and gutz::vec4f.

vec3f CoordTrans::apply const gutz::vec3f coord,
const gutz::vec3f divisor
 

Make a relative transform if requested

Homogeneous 4-vec

Do the transform

Drop the 4th component (always 1.0)

Definition at line 75 of file coordTrans.cpp.

References gutz::arrayo1f, coord, gutz::mat4f, gutz::vec3f, and gutz::vec4f.

vec2f CoordTrans::apply const gutz::vec2f coord,
const gutz::vec2f divisor
 

Apply transform to 'coord'.

  • If 'm_relScale' or 'm_relBias' are true, the appropriate transform components are first divided by the corresponding component of the 'divisor' vector.

Definition at line 67 of file coordTrans.cpp.

References gutz::arrayo1f, coord, gutz::mat4f, gutz::vec2f, and gutz::vec4f.

Referenced by glift::TexTrans::operator()().

void glift::GliftObject::derr const char *  where,
const char *  when = 0
const [inline, protected, inherited]
 

debug error

Definition at line 122 of file gliftObject.h.

References glift::GliftObject::m_err.

std::ostream & glift::GliftObject::err  )  const [inline, protected, inherited]
 

a simpler way, just use the stream! only for always print, this one automatically adds the objects name

Definition at line 111 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by apply(), glift::SubTex::bindDef(), glift::PrimGL::bindIndices(), glift::SubdivPlanarQuadS::bindQuads(), glift::PrimGL::bindTexCoords(), glift::CoreTex::checkTexType(), glift::EmptyTex::copyToTex(), glift::CoreTex::CoreTex(), glift::FuncTex::FuncTex(), glift::Shader::genTexCoords(), glift::CoreTex::getDataf(), glift::CoreTex::getDataub(), glift::VertexProgARB::init(), glift::FragProgARB::init(), glift::PriorityTex::PriorityTex(), glift::VertexProgARB::reload(), glift::FragProgARB::reload(), glift::RenderableGLI::render(), glift::RenderPass::renderDef(), glift::EmptyTex::resetTexState(), glift::PixelShaderATI8K::setLocalConstf(), glift::TexCube::setTexData(), glift::EmptyTex::setTexData(), glift::ShadedPrim::ShadedPrim(), glift::TexConst::TexConst(), glift::TexCube::TexCube(), and glift::EmptyTex::tryToBindPbuff().

void glift::GliftObject::err const char *  where,
const char *  when = 0
const [inline, protected, inherited]
 

error

Definition at line 101 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::SubPBuff::enable().

std::ostream& glift::GliftObject::estr  )  const [inline, protected, inherited]
 

this one just gives you the stream

Definition at line 84 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::CoreTex::bindDef(), glift::Shader::bindDef(), glift::MultiTex::bindDef(), glift::EmptyTex::bindDef(), glift::DispList::compile(), glift::CoreTex::CoreTex(), glift::VertexProgARB::init(), glift::FragProgARB::init(), glift::MultiTex::releaseDef(), and glift::EmptyTex::releaseDef().

virtual std::ostream* glift::GliftObject::getErrStream  )  const [inline, virtual, inherited]
 

Where are gl errors going?

Definition at line 49 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::getProgShaderFromFile(), and glift::getProgShaderFromText().

bool GliftObject::glerr const char *  where,
const char *  when = 0
const [protected, inherited]
 

gl error report only in debug mode, only if there is an error, if so return true

Definition at line 31 of file gliftObject.cpp.

References glGetError(), and GLuint.

Referenced by RenderState2D::bindDef(), glift::NormalAttrib< VAT >::disableDef(), glift::IndexAttrib< VAT >::disableDef(), glift::TexCoordAttrib< VAT >::disableDef(), glift::VertAttrib< VAT >::disableDef(), glift::GenDrawAttrib< VAT >::disableDef(), glift::DrawAlgImm::draw(), glift::DrawAlgArr::draw(), glift::ShadedPrim::drawDef(), glift::NormalAttrib< VAT >::enableDef(), glift::IndexAttrib< VAT >::enableDef(), glift::TexCoordAttrib< VAT >::enableDef(), glift::VertAttrib< VAT >::enableDef(), glift::GenDrawAttrib< VAT >::enableDef(), and RenderState2D::releaseDef().

virtual void glift::GliftObject::setErrStream std::ostream *  os  )  [inline, virtual, inherited]
 

Where do you want gl errors to go? they must go somewhere, so don't set it to zero please.

Definition at line 44 of file gliftObject.h.

References glift::GliftObject::m_err.

Referenced by glift::getProgShaderFromFile(), and glift::getProgShaderFromText().


Member Data Documentation

std::ostream* glift::GliftObject::m_err [mutable, protected, inherited]
 

Definition at line 87 of file gliftObject.h.

Referenced by glift::GliftObject::derr(), glift::GliftObject::err(), glift::GliftObject::estr(), glift::GliftObject::getErrStream(), glift::GliftObject::GliftObject(), and glift::GliftObject::setErrStream().


The documentation for this class was generated from the following files:
Send questions, comments, and bug reports to:
jmk