Nugget
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
psyqo::Prim::GouraudQuad Struct Reference

A gouraud-shaded quad. More...

#include <psyqo/primitives/quads.hh>

Collaboration diagram for psyqo::Prim::GouraudQuad:
Collaboration graph
[legend]

Public Member Functions

 GouraudQuad ()
 
 GouraudQuad (Color c)
 
 GouraudQuad (const GouraudQuad &other, Color c)
 
GouraudQuadsetColorA (Color c)
 
GouraudQuadsetColorB (Color c)
 
GouraudQuadsetColorC (Color c)
 
GouraudQuadsetColorD (Color c)
 
Color getColorA () const
 
Color getColorB () const
 
Color getColorC () const
 
Color getColorD () const
 
GouraudQuadsetOpaque ()
 
uint32_t getCommandWord () const
 The GP0 command word, minus any colour.
 
GouraudQuadsetColorAPacked (uint32_t packed)
 Sets the command word and vertex A's colour in one go.
 
GouraudQuadsetSemiTrans ()
 
bool isSemiTrans () const
 
GouraudQuadsetPointA (Vertex v)
 
GouraudQuadsetPointB (Vertex v)
 
GouraudQuadsetPointC (Vertex v)
 
GouraudQuadsetPointD (Vertex v)
 
template<Transparency transparency = Transparency::Auto>
void interpolateColors (const Color *a, const Color *b, const Color *c, const Color *d)
 
template<Transparency transparency = Transparency::Auto>
void interpolateColors (Color a, Color b, Color c, Color d)
 

Public Attributes

Vertex pointA
 
Color colorB
 
Vertex pointB
 
Color colorC
 
Vertex pointC
 
Color colorD
 
Vertex pointD
 

Detailed Description

A gouraud-shaded quad.

This primitive will draw a gouraud-shaded quad. See Quad for more information about vertices and ordering. The color of the quad will be interpolated between the colors of its four vertices. Note that colorA can only be set using the constructor, or the setColorA method.

Constructor & Destructor Documentation

◆ GouraudQuad() [1/3]

psyqo::Prim::GouraudQuad::GouraudQuad ( )
inline

◆ GouraudQuad() [2/3]

psyqo::Prim::GouraudQuad::GouraudQuad ( Color  c)
inline

◆ GouraudQuad() [3/3]

psyqo::Prim::GouraudQuad::GouraudQuad ( const GouraudQuad other,
Color  c 
)
inline

Member Function Documentation

◆ getColorA()

Color psyqo::Prim::GouraudQuad::getColorA ( ) const
inline

◆ getColorB()

Color psyqo::Prim::GouraudQuad::getColorB ( ) const
inline

◆ getColorC()

Color psyqo::Prim::GouraudQuad::getColorC ( ) const
inline

◆ getColorD()

Color psyqo::Prim::GouraudQuad::getColorD ( ) const
inline

◆ getCommandWord()

uint32_t psyqo::Prim::GouraudQuad::getCommandWord ( ) const
inline

The GP0 command word, minus any colour.

A GP0 polygon's first word is the command in bits 31-24 and vertex A's colour in 23-0, and the GTE's RGBC register has an 8 bit CODE field that it fuses into every colour it produces - which is exactly what that field is for. Load this into CODE before an nc* command and the colour FIFO hands back finished first words; then store them with setColorAPacked and the whole thing is a word store instead of a read-modify-write per vertex.

◆ interpolateColors() [1/2]

template<Transparency transparency = Transparency::Auto>
void psyqo::Prim::GouraudQuad::interpolateColors ( Color  a,
Color  b,
Color  c,
Color  d 
)
inline

◆ interpolateColors() [2/2]

template<Transparency transparency = Transparency::Auto>
void psyqo::Prim::GouraudQuad::interpolateColors ( const Color a,
const Color b,
const Color c,
const Color d 
)
inline

◆ isSemiTrans()

bool psyqo::Prim::GouraudQuad::isSemiTrans ( ) const
inline

◆ setColorA()

GouraudQuad & psyqo::Prim::GouraudQuad::setColorA ( Color  c)
inline

◆ setColorAPacked()

GouraudQuad & psyqo::Prim::GouraudQuad::setColorAPacked ( uint32_t  packed)
inline

Sets the command word and vertex A's colour in one go.

For a value that came out of the GTE with CODE preloaded from getCommandWord. Unlike setColorA this does not preserve the transparency bit, because the value being stored already carries it.

◆ setColorB()

GouraudQuad & psyqo::Prim::GouraudQuad::setColorB ( Color  c)
inline

◆ setColorC()

GouraudQuad & psyqo::Prim::GouraudQuad::setColorC ( Color  c)
inline

◆ setColorD()

GouraudQuad & psyqo::Prim::GouraudQuad::setColorD ( Color  c)
inline

◆ setOpaque()

GouraudQuad & psyqo::Prim::GouraudQuad::setOpaque ( )
inline

◆ setPointA()

GouraudQuad & psyqo::Prim::GouraudQuad::setPointA ( Vertex  v)
inline

◆ setPointB()

GouraudQuad & psyqo::Prim::GouraudQuad::setPointB ( Vertex  v)
inline

◆ setPointC()

GouraudQuad & psyqo::Prim::GouraudQuad::setPointC ( Vertex  v)
inline

◆ setPointD()

GouraudQuad & psyqo::Prim::GouraudQuad::setPointD ( Vertex  v)
inline

◆ setSemiTrans()

GouraudQuad & psyqo::Prim::GouraudQuad::setSemiTrans ( )
inline

Member Data Documentation

◆ colorB

Color psyqo::Prim::GouraudQuad::colorB

◆ colorC

Color psyqo::Prim::GouraudQuad::colorC

◆ colorD

Color psyqo::Prim::GouraudQuad::colorD

◆ pointA

Vertex psyqo::Prim::GouraudQuad::pointA

◆ pointB

Vertex psyqo::Prim::GouraudQuad::pointB

◆ pointC

Vertex psyqo::Prim::GouraudQuad::pointC

◆ pointD

Vertex psyqo::Prim::GouraudQuad::pointD

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