Core 1.0
|
Quadrangles. More...
#include <quadrangle.h>
Public Member Functions | |
Quadrangle () | |
Empty. | |
Quadrangle (const Vector &, const Vector &, const Vector &, const Vector &) | |
Create a quadrangle. More... | |
Quadrangle (double, double) | |
Create a horizontal quadrangle. More... | |
~Quadrangle () | |
Empty. | |
Vector | Vertex (const double &, const double &) const |
Compute the position of a vertex inside the quadrangle. More... | |
Vector | Normal (const double &, const double &) const |
Compute the normal of a vertex inside the quadrangle. More... | |
Vector | Normal () const |
Compute the normal of the quadrangle. More... | |
void | Rotate (const Matrix &) |
Rotate the quadrangle. More... | |
void | Translate (const Vector &) |
Translate the quadrangle. More... | |
void | Scale (const double &) |
Scale the quadrangle. More... | |
void | Transform (const FrameScaled &) |
Transform the quadrangle. More... | |
Protected Attributes | |
Vector | p [4] = { Vector::Null,Vector::X,Vector::X + Vector::Y,Vector::Y } |
Vertices, stored in counter-clockwize order. | |
Static Protected Attributes | |
static double | epsilon = 1.0e-10 |
Internal \epsilon; constant. | |
Quadrangles.
Quadrangles should be planar and convex.
|
explicit |
Create a quadrangle.
a,b,c,d | Vertices. |
|
explicit |
Create a horizontal quadrangle.
x,y | Half size, the quadrangle vertexes will have (±x ±y) coordinates. |
Vector Quadrangle::Normal | ( | ) | const |
Compute the normal of the quadrangle.
The quadrangle should be flat.
Vector Quadrangle::Normal | ( | const double & | u, |
const double & | v | ||
) | const |
Compute the normal of a vertex inside the quadrangle.
u,v | Parametric coordinates of the vertex. |
void Quadrangle::Rotate | ( | const Matrix & | r | ) |
Rotate the quadrangle.
r | Rotation matrix. |
void Quadrangle::Scale | ( | const double & | s | ) |
Scale the quadrangle.
s | Scaling factor. |
void Quadrangle::Transform | ( | const FrameScaled & | frame | ) |
Transform the quadrangle.
frame | Transformation. |
void Quadrangle::Translate | ( | const Vector & | t | ) |
Translate the quadrangle.
t | Translation vector. |
Vector Quadrangle::Vertex | ( | const double & | u, |
const double & | v | ||
) | const |
Compute the position of a vertex inside the quadrangle.
u,v | Parametric coordinates of the vertex. |