osgEarth 2.1.1
Public Member Functions | Public Attributes

AMRTriangle Class Reference

Inheritance diagram for AMRTriangle:
Collaboration diagram for AMRTriangle:

List of all members.

Public Member Functions

 AMRTriangle ()
 AMRTriangle (const MeshNode &node0, const osg::Vec2 &t0, const MeshNode &node1, const osg::Vec2 &t1, const MeshNode &node2, const osg::Vec2 &t2)
void expand (osg::BoundingBox &box)

Public Attributes

osg::ref_ptr< osg::StateSet > _stateSet
MeshNode _node0
MeshNode _node1
MeshNode _node2

Detailed Description

Definition at line 38 of file AMRGeometry.


Constructor & Destructor Documentation

AMRTriangle::AMRTriangle ( )

Definition at line 33 of file AMRGeometry.cpp.

{
    _stateSet = new osg::StateSet();

    // should this be INT_SAMPLER_2D?
    _stateSet->getOrCreateUniform( "tex0", osg::Uniform::INT )->set( 0 );
}
AMRTriangle::AMRTriangle ( const MeshNode node0,
const osg::Vec2 &  t0,
const MeshNode node1,
const osg::Vec2 &  t1,
const MeshNode node2,
const osg::Vec2 &  t2 
)

Definition at line 45 of file AMRGeometry.cpp.

                                                                :
_node0(n0), _node1(n1), _node2(n2)
{
    _stateSet = new osg::StateSet();
    // should this be INT_SAMPLER_2D?
    SET_UNIFORM( "tex0", osg::Uniform::INT, 0 );

    SET_UNIFORM( "c0", osg::Uniform::FLOAT_VEC3, _node0._geodeticCoord );
    SET_UNIFORM( "c1", osg::Uniform::FLOAT_VEC3, _node1._geodeticCoord );
    SET_UNIFORM( "c2", osg::Uniform::FLOAT_VEC3, _node2._geodeticCoord );

    SET_UNIFORM( "v0", osg::Uniform::FLOAT_VEC3, _node0._vertex );
    SET_UNIFORM( "v1", osg::Uniform::FLOAT_VEC3, _node1._vertex );
    SET_UNIFORM( "v2", osg::Uniform::FLOAT_VEC3, _node2._vertex );

    SET_UNIFORM( "t0", osg::Uniform::FLOAT_VEC2, t0 );
    SET_UNIFORM( "t1", osg::Uniform::FLOAT_VEC2, t1 );
    SET_UNIFORM( "t2", osg::Uniform::FLOAT_VEC2, t2 );

    SET_UNIFORM( "n0", osg::Uniform::FLOAT_VEC3, _node0._normal );
    SET_UNIFORM( "n1", osg::Uniform::FLOAT_VEC3, _node1._normal );
    SET_UNIFORM( "n2", osg::Uniform::FLOAT_VEC3, _node2._normal );

    SET_UNIFORM( "r0", osg::Uniform::FLOAT_VEC4, _node0._geodeticRot.asVec4() );
    SET_UNIFORM( "r1", osg::Uniform::FLOAT_VEC4, _node1._geodeticRot.asVec4() );
    SET_UNIFORM( "r2", osg::Uniform::FLOAT_VEC4, _node2._geodeticRot.asVec4() );
}

Member Function Documentation

void AMRTriangle::expand ( osg::BoundingBox &  box)

Definition at line 76 of file AMRGeometry.cpp.

{
    box.expandBy( _node0._vertex );
    box.expandBy( _node1._vertex );
    box.expandBy( _node2._vertex );
}

Member Data Documentation

Definition at line 52 of file AMRGeometry.

Definition at line 52 of file AMRGeometry.

Definition at line 52 of file AMRGeometry.

osg::ref_ptr<osg::StateSet> AMRTriangle::_stateSet

Definition at line 51 of file AMRGeometry.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines