Walls And Holes  1
M2M::Quad Class Reference

Represents and helps construct a quadrilateral with one texture and a Phong material. More...

#include <m2mpartialmesh.h>

Public Member Functions

 Quad (QVector3D normal, ImageInfo texture, PhongInfo material, QVector3D v1, QVector2D t1, QVector3D v2, QVector2D t2, QVector3D v3, QVector2D t3, QVector3D v4, QVector2D t4)
 Creates a quad with the given vertices. Vertices must be specified in counterclockwise order. More...
 
QVector3D vertex (int idx) const
 
QVector2D texCoord (int idx) const
 
QVector3D normal () const
 
ImageInfo imageInfo () const
 
PhongInfo phongInfo () const
 

Static Public Member Functions

static Quad makeVerticalQuad (QVector3D center, QVector2D xzDirection, float width, float height, ImageInfo texture, PhongInfo material, bool upsideDown=false)
 makeVerticalQuad Creates a vertical quad. More...
 

Detailed Description

Represents and helps construct a quadrilateral with one texture and a Phong material.

Constructor & Destructor Documentation

◆ Quad()

Quad::Quad ( QVector3D  normal,
ImageInfo  texture,
PhongInfo  material,
QVector3D  v1,
QVector2D  t1,
QVector3D  v2,
QVector2D  t2,
QVector3D  v3,
QVector2D  t3,
QVector3D  v4,
QVector2D  t4 
)

Creates a quad with the given vertices. Vertices must be specified in counterclockwise order.

Here is the caller graph for this function:

Member Function Documentation

◆ imageInfo()

ImageInfo Quad::imageInfo ( ) const
Here is the caller graph for this function:

◆ makeVerticalQuad()

Quad Quad::makeVerticalQuad ( QVector3D  center,
QVector2D  xzDirection,
float  width,
float  height,
ImageInfo  texture,
PhongInfo  material,
bool  upsideDown = false 
)
static

makeVerticalQuad Creates a vertical quad.

Parameters
centerThe center point of the quad in 3D space.
xzDirectionThe normal direction of the quad – this vector is assumed to be normalized. A vertical quad's normal always has a Y component of 0.
widthThe "width" of the quad (the other dimension of the quad, as opposed to height).
heightThe "height" of the quad (size along Y axis).
textureThe texture of the quad.
materialThe material of the quad.
upsideDownIf this is "false," the quad's vertices will be output in the order 4 3 1 2 when looking at the quad. Otherwise, the vertices are output in the order 2 1 4 3
Returns
The specified quad.
Here is the call graph for this function:

◆ normal()

QVector3D Quad::normal ( ) const
Here is the caller graph for this function:

◆ phongInfo()

PhongInfo Quad::phongInfo ( ) const
Here is the caller graph for this function:

◆ texCoord()

QVector2D Quad::texCoord ( int  idx) const
Here is the caller graph for this function:

◆ vertex()

QVector3D Quad::vertex ( int  idx) const
Here is the caller graph for this function:

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