Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Private Attributes
Shadow Class Reference

Simple shadow class, only used here for default herrings. More...

List of all members.

Public Member Functions

 Shadow (float x1, float x2, float y1, float y2)
ssgEntity * getRoot ()

Private Attributes

ssgBranch * sh

Detailed Description

Simple shadow class, only used here for default herrings.

Definition at line 36 of file herring_manager.cpp.


Constructor & Destructor Documentation

Shadow::Shadow ( float  x1,
float  x2,
float  y1,
float  y2 
)

Definition at line 47 of file herring_manager.cpp.

{
    ssgVertexArray   *va = new ssgVertexArray   () ; sgVec3 v ;
    ssgNormalArray   *na = new ssgNormalArray   () ; sgVec3 n ;
    ssgColourArray   *ca = new ssgColourArray   () ; sgVec4 c ;
    ssgTexCoordArray *ta = new ssgTexCoordArray () ; sgVec2 t ;

    sgSetVec4 ( c, 0.0f, 0.0f, 0.0f, 1.0f ) ; ca->add(c) ;
    sgSetVec3 ( n, 0.0f, 0.0f, 1.0f ) ; na->add(n) ;

    sgSetVec3 ( v, x1, y1, 0.10f ) ; va->add(v) ;
    sgSetVec3 ( v, x2, y1, 0.10f ) ; va->add(v) ;
    sgSetVec3 ( v, x1, y2, 0.10f ) ; va->add(v) ;
    sgSetVec3 ( v, x2, y2, 0.10f ) ; va->add(v) ;

    sgSetVec2 ( t, 0.0f, 0.0f ) ; ta->add(t) ;
    sgSetVec2 ( t, 1.0f, 0.0f ) ; ta->add(t) ;
    sgSetVec2 ( t, 0.0f, 1.0f ) ; ta->add(t) ;
    sgSetVec2 ( t, 1.0f, 1.0f ) ; ta->add(t) ;

    sh = new ssgBranch ;
    sh -> clrTraversalMaskBits ( SSGTRAV_ISECT|SSGTRAV_HOT ) ;

    sh -> setName ( "Shadow" ) ;

    ssgVtxTable *gs = new ssgVtxTable ( GL_TRIANGLE_STRIP, va, na, ta, ca ) ;

    gs -> clrTraversalMaskBits ( SSGTRAV_ISECT|SSGTRAV_HOT ) ;
    gs -> setState ( fuzzy_gst ) ;
    sh -> addKid ( gs ) ;
    sh -> ref () ; /* Make sure it doesn't get deleted by mistake */
}   // Shadow

Member Function Documentation

ssgEntity* Shadow::getRoot ( ) [inline]

Definition at line 42 of file herring_manager.cpp.

{ return sh ; }

Member Data Documentation

ssgBranch* Shadow::sh [private]

Definition at line 38 of file herring_manager.cpp.


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