libjbt

transformation.h

This is the verbatim text of the transformation.h include file.

#ifndef jbt_transformation_h
#define jbt_transformation_h

#include "ngnode.h"


class jbt_transformation : public jbt_ngnode
{
public:
    

    jbt_transformation( jbt_blobtree* = 0 );


    jbt_transformation( const jMat4&, jbt_blobtree* = 0 );


    void scale( jFlt );
    

    void scale( jFlt, jFlt, jFlt );
    

    void translate( jFlt, jFlt, jFlt );
    

    void rotate( int, jFlt );

    const jMat4& transform() const { return T; }
    const jMat4& inverse() const { return Ti; }

protected:

    void normal( jNorm3& );
    void beginQuery( const jVec3& );
    void computeBound();
    void bracket( const jRay&, jbt_brackets& );
    void seedPoints( jVec3list& ) const;
    bool spanCSG( const jVec3&, const jVec3& );
    void uv( jVec2&, jbt_blobtree*, const jMat4& );
    jgl_algebraic* expression( const jMat4& ) const;
    
    jbt_blobtree::Type type() const { return jbtTransformation; }

private:
    jMat4 T, Ti,Tn;
    void inverse();
};


class jbt_uvtransformation : public jbt_ngnode
{
public:
    

    jbt_uvtransformation( jbt_blobtree* =0 );


    jbt_uvtransformation( const jMat3&, jbt_blobtree* = 0 );


    void scale( jFlt );
    

    void scale( jFlt, jFlt );
    

    void translate( jFlt, jFlt );
    

    void rotate( jFlt );

protected:

    void uv( jVec2&, jbt_blobtree*, const jMat4& );
    
    jbt_blobtree::Type type() const { return jbtUVTransformation; }

private:
    jMat3 T;
};

#endif

JSP / libjbt v0.1 mtigges@cpsc.ucalgary.ca