Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

struct Geo::RastFragment

stores a fragment of a triangle i.e. a triangle clipped to a pixel box

Variables

NameDescription
Geo::u32 m_NumPts

number of points in fragment polygon

const RastVert * m_Points

fragment polygon points; coordinates are in [0,1]x[0,1] i.e.

const RastTri * m_Tri

reference to triangle that owns this fragment

Geo::s32 m_X

integer coordinates of (top-left of) pixel

Geo::s32 m_Y

integer coordinates of (top-left of) pixel

Functions

NameDescription
GetArea()

get signed area of fragment polygon; it's flipped if area < 0

GetBarycentricCoords(float, float, float &, float &)

get barycentric coordinates of a point in the pixel

GetCentroid(RastVert &)

get centroid of fragment polygon (average of vertex positions)

IsPtInPoly(float, float)

is a given point in the fragment polygon?


Anchor
a732ca24ecf5dfa9681975b332067fd64
a732ca24ecf5dfa9681975b332067fd64

float Geo::RastFragment::GetArea

...

public: float GetArea() const

...

get signed area of fragment polygon; it's flipped if area < 0


Anchor
a08b44a83beca802facdb85d4acd0554b
a08b44a83beca802facdb85d4acd0554b

void Geo::RastFragment::GetBarycentricCoords

...

public: void GetBarycentricCoords
(
    float x,
    float y,
    float & u,
    float & v
) const

...

get barycentric coordinates of a point in the pixel


Anchor
a19cfa9fbee24386df0449437de91559d
a19cfa9fbee24386df0449437de91559d

void Geo::RastFragment::GetCentroid

...

public: void GetCentroid
(
    RastVert & out
) const

...

get centroid of fragment polygon (average of vertex positions)


Anchor
a47d2a5bbe1dc7a8197fbb6aef9c0e6c3
a47d2a5bbe1dc7a8197fbb6aef9c0e6c3

bool Geo::RastFragment::IsPtInPoly

...

public: bool IsPtInPoly
(
    float x,
    float y
) const

...

is a given point in the fragment polygon?