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

A gouraud-shaded triangle. More...

#include <psyqo/primitives/triangles.hh>

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

Public Member Functions

 GouraudTriangle ()
 
 GouraudTriangle (Color c)
 
 GouraudTriangle (const GouraudTriangle &other, Color c)
 
GouraudTrianglesetColorA (Color c)
 
GouraudTrianglesetColorB (Color c)
 
GouraudTrianglesetColorC (Color c)
 
Color getColorA () const
 
Color getColorB () const
 
Color getColorC () const
 
GouraudTrianglesetOpaque ()
 
uint32_t getCommandWord () const
 The GP0 command word, minus any colour.
 
GouraudTrianglesetColorAPacked (uint32_t packed)
 Sets the command word and vertex A's colour in one go.
 
GouraudTrianglesetSemiTrans ()
 
bool isSemiTrans () const
 
GouraudTrianglesetPointA (Vertex v)
 
GouraudTrianglesetPointB (Vertex v)
 
GouraudTrianglesetPointC (Vertex v)
 
template<Transparency transparency = Transparency::Auto>
void interpolateColors (const Color *a, const Color *b, const Color *c)
 
template<Transparency transparency = Transparency::Auto>
void interpolateColors (Color a, Color b, Color c)
 

Public Attributes

Vertex pointA
 
Color colorB
 
Vertex pointB
 
Color colorC
 
Vertex pointC
 

Detailed Description

A gouraud-shaded triangle.

This primitive will draw a gouraud-shaded triangle. It will be drawn between the pointA, pointB, and pointC. Its color will be interpolated between the colors of its three vertices. Note that colorA can only be set using the constructor, or the setColorA method.

Constructor & Destructor Documentation

◆ GouraudTriangle() [1/3]

psyqo::Prim::GouraudTriangle::GouraudTriangle ( )
inline

◆ GouraudTriangle() [2/3]

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

◆ GouraudTriangle() [3/3]

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

Member Function Documentation

◆ getColorA()

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

◆ getColorB()

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

◆ getColorC()

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

◆ getCommandWord()

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

The GP0 command word, minus any colour.

Meant for the GTE's RGBC CODE field, which gets fused into every colour the GTE emits. Preload it and the colour FIFO hands back finished first words. See GouraudQuad::getCommandWord for the full round trip.

◆ interpolateColors() [1/2]

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

◆ interpolateColors() [2/2]

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

◆ isSemiTrans()

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

◆ setColorA()

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

◆ setColorAPacked()

GouraudTriangle & psyqo::Prim::GouraudTriangle::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()

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

◆ setColorC()

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

◆ setOpaque()

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

◆ setPointA()

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

◆ setPointB()

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

◆ setPointC()

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

◆ setSemiTrans()

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

Member Data Documentation

◆ colorB

Color psyqo::Prim::GouraudTriangle::colorB

◆ colorC

Color psyqo::Prim::GouraudTriangle::colorC

◆ pointA

Vertex psyqo::Prim::GouraudTriangle::pointA

◆ pointB

Vertex psyqo::Prim::GouraudTriangle::pointB

◆ pointC

Vertex psyqo::Prim::GouraudTriangle::pointC

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