The SimpleTexturedObject class represents an object with Phong lighting information and a single texture.
More...
#include <simpletexturedobject.h>
|
| SimpleTexturedObject () |
| Creates an empty object. Use the setter methods below to set up data, and then call commit() when done. More...
|
|
virtual | ~SimpleTexturedObject () |
|
void | commit () |
| Call this method after setting all of the object's information. This will commit the information and allow it to be rendered. More...
|
|
void | setTriangleInfo (QVector< QVector3D > positions, QVector< QVector3D > normals, QVector< Triangle > triangles) |
| Sets up face information for the object. More...
|
|
void | setMaterialInfo (float ambient, float diffuse, float specular, float shininess) |
| Sets up material information for the object. Uses the same material for each vertex. More...
|
|
void | setMaterialInfo (QVector< float > ambient, QVector< float > diffuse, QVector< float > specular, QVector< float > shininess) |
| Sets up per-vertex materials for the object. More...
|
|
void | setTextureInfo (QVector< TriangleTexCoords > texCoords, SharedImageAndSource image) |
| Sets up texture information for the object. More...
|
|
bool | isCommitted () const |
|
int | getNumVertices () const |
| Returns the number of vertices in the vertex array. This may not be the same as the number of vertices when the object is rendered (it may be that the triangle array is unrolled). More...
|
|
int | getNumTriangles () const |
|
const QVector< QVector3D > & | getVertices () const |
|
const QVector< QVector3D > & | getFaceNormals () const |
|
const QVector< Triangle > & | getTriangles () const |
|
const QVector< float > & | getVertexAmbient () const |
|
const QVector< float > & | getVertexDiffuse () const |
|
const QVector< float > & | getVertexSpecular () const |
|
const QVector< float > & | getVertexShininess () const |
|
const QVector< TriangleTexCoords > & | getFaceTexCoords () const |
|
const QImage & | getImage () const |
|
float | getAmbient () const |
|
float | getDiffuse () const |
|
float | getSpecular () const |
|
float | getShininess () const |
|
QString | getMaterialName () const |
|
SharedImageAndSource | getImageAndSource () const |
|
The SimpleTexturedObject class represents an object with Phong lighting information and a single texture.
◆ Triangle
◆ TriangleTexCoords
◆ SimpleTexturedObject()
SimpleTexturedObject::SimpleTexturedObject |
( |
| ) |
|
Creates an empty object. Use the setter methods below to set up data, and then call commit() when done.
◆ ~SimpleTexturedObject()
SimpleTexturedObject::~SimpleTexturedObject |
( |
| ) |
|
|
virtual |
◆ commit()
void SimpleTexturedObject::commit |
( |
| ) |
|
Call this method after setting all of the object's information. This will commit the information and allow it to be rendered.
◆ getAmbient()
float SimpleTexturedObject::getAmbient |
( |
| ) |
const |
◆ getDiffuse()
float SimpleTexturedObject::getDiffuse |
( |
| ) |
const |
◆ getFaceNormals()
const QVector< QVector3D > & SimpleTexturedObject::getFaceNormals |
( |
| ) |
const |
◆ getFaceTexCoords()
◆ getImage()
const QImage & SimpleTexturedObject::getImage |
( |
| ) |
const |
◆ getImageAndSource()
◆ getMaterialName()
QString SimpleTexturedObject::getMaterialName |
( |
| ) |
const |
◆ getNumTriangles()
int SimpleTexturedObject::getNumTriangles |
( |
| ) |
const |
◆ getNumVertices()
int SimpleTexturedObject::getNumVertices |
( |
| ) |
const |
Returns the number of vertices in the vertex array. This may not be the same as the number of vertices when the object is rendered (it may be that the triangle array is unrolled).
- Returns
- Equal to getVertices().size() if isCommitted() is true. In any case, equal to the size of the positions array last passed to setTriangleInfo().
◆ getShininess()
float SimpleTexturedObject::getShininess |
( |
| ) |
const |
◆ getSpecular()
float SimpleTexturedObject::getSpecular |
( |
| ) |
const |
◆ getTriangles()
◆ getVertexAmbient()
const QVector< float > & SimpleTexturedObject::getVertexAmbient |
( |
| ) |
const |
◆ getVertexDiffuse()
const QVector< float > & SimpleTexturedObject::getVertexDiffuse |
( |
| ) |
const |
◆ getVertexShininess()
const QVector< float > & SimpleTexturedObject::getVertexShininess |
( |
| ) |
const |
◆ getVertexSpecular()
const QVector< float > & SimpleTexturedObject::getVertexSpecular |
( |
| ) |
const |
◆ getVertices()
const QVector< QVector3D > & SimpleTexturedObject::getVertices |
( |
| ) |
const |
◆ isCommitted()
bool SimpleTexturedObject::isCommitted |
( |
| ) |
const |
◆ objectUpdated
void SimpleTexturedObject::objectUpdated |
( |
| ) |
|
|
signal |
Emitted when the object is updated. It is assumed that isCommitted() is true.
◆ setMaterialInfo() [1/2]
void SimpleTexturedObject::setMaterialInfo |
( |
float |
ambient, |
|
|
float |
diffuse, |
|
|
float |
specular, |
|
|
float |
shininess |
|
) |
| |
Sets up material information for the object. Uses the same material for each vertex.
Assumes setTriangleInfo() has been called.
- Parameters
-
ambient | The ambient parameter. |
diffuse | The diffuse parameter. |
specular | The specular parameter. |
shininess | The shininess parameter. |
◆ setMaterialInfo() [2/2]
void SimpleTexturedObject::setMaterialInfo |
( |
QVector< float > |
ambient, |
|
|
QVector< float > |
diffuse, |
|
|
QVector< float > |
specular, |
|
|
QVector< float > |
shininess |
|
) |
| |
Sets up per-vertex materials for the object.
Assumes setTriangleInfo() has been called.
- Parameters
-
ambient | The ambient parameter. |
diffuse | The diffuse parameter. |
specular | The specular parameter. |
shininess | The shininess parameter. |
◆ setTextureInfo()
Sets up texture information for the object.
Assumes setTriangleInfo() has been called.
- Parameters
-
texCoords | Texture coordinates for each triangle. |
image | The image (texture) for the object. |
◆ setTriangleInfo()
void SimpleTexturedObject::setTriangleInfo |
( |
QVector< QVector3D > |
positions, |
|
|
QVector< QVector3D > |
normals, |
|
|
QVector< Triangle > |
triangles |
|
) |
| |
Sets up face information for the object.
- Parameters
-
positions | A list of vertex positions. |
normals | A list of face normals. Should be parallel to triangles array. |
triangles | A list of triangles. Each triangle is a triplet of indices into the positions array. |
The documentation for this class was generated from the following files: