TexturedSmoothTriangle Class Reference

#include <TexturedSmoothTriangle.h>

Inherits Triangle.

Inheritance diagram for TexturedSmoothTriangle:

Inheritance graph
[legend]
Collaboration diagram for TexturedSmoothTriangle:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TexturedSmoothTriangle (const Triangle &v)
 TexturedSmoothTriangle (const Triangle &v, const Vec3f &na, const Vec3f &nb, const Vec3f &nc)
 TexturedSmoothTriangle (const Triangle &v, const Vec3f &na, const Vec3f &nb, const Vec3f &nc, const TexCoordinate &ta, const TexCoordinate &tb, const TexCoordinate &tc)
void setNormals (const Vec3f &na, const Vec3f &nb, const Vec3f &nc)
Vec3f normal (const Ray &ray) const
void setTexCoord (const TexCoordinate &ta, const TexCoordinate &tb, const TexCoordinate &tc)
TexCoordinate texCoord (const Ray &ray) const

Private Attributes

Vec3f mNa
 Vertex normals.
Vec3f mNb
Vec3f mNc
TexCoordinate mTa
 Texture coordinates.
TexCoordinate mTb
TexCoordinate mTc

Detailed Description

A triangle with smooth surface and texture. Surface is calculated using vertex normals

Author:
Alex Busenius

Christian Engels

Definition at line 15 of file TexturedSmoothTriangle.h.


Constructor & Destructor Documentation

TexturedSmoothTriangle::TexturedSmoothTriangle ( const Triangle v  )  [inline]

Definition at line 18 of file TexturedSmoothTriangle.h.

TexturedSmoothTriangle::TexturedSmoothTriangle ( const Triangle v,
const Vec3f na,
const Vec3f nb,
const Vec3f nc 
) [inline]

Definition at line 23 of file TexturedSmoothTriangle.h.

References mNa, mNb, mNc, and Vec3f::normalize().

TexturedSmoothTriangle::TexturedSmoothTriangle ( const Triangle v,
const Vec3f na,
const Vec3f nb,
const Vec3f nc,
const TexCoordinate ta,
const TexCoordinate tb,
const TexCoordinate tc 
) [inline]

Definition at line 37 of file TexturedSmoothTriangle.h.

References mNa, mNb, mNc, and Vec3f::normalize().


Member Function Documentation

void TexturedSmoothTriangle::setNormals ( const Vec3f na,
const Vec3f nb,
const Vec3f nc 
) [inline]

sets the normals to the given values

Definition at line 59 of file TexturedSmoothTriangle.h.

References mNa, mNb, mNc, and Vec3f::normalize().

Vec3f TexturedSmoothTriangle::normal ( const Ray ray  )  const [inline, virtual]

Calculate a normal in global coordinates given barycentric coordinates of the hitpoint

Returns:
Returns the interpolated normal for this triangle

Reimplemented from Triangle.

Definition at line 74 of file TexturedSmoothTriangle.h.

References Ray::hit(), mNa, mNb, mNc, Ray::obj(), PhysicalObject::toGlobalCoordinates(), Ray::u(), and Ray::v().

void TexturedSmoothTriangle::setTexCoord ( const TexCoordinate ta,
const TexCoordinate tb,
const TexCoordinate tc 
) [inline]

sets the Texture Coordinates of the 3 vertices

Definition at line 91 of file TexturedSmoothTriangle.h.

References mTa, mTb, and mTc.

TexCoordinate TexturedSmoothTriangle::texCoord ( const Ray ray  )  const [inline, virtual]

Returns:
the interpolated Texture Coordinate

Reimplemented from Primitive.

Definition at line 100 of file TexturedSmoothTriangle.h.

References Ray::hit(), mTa, mTb, mTc, Ray::u(), Ray::v(), TexCoordinate::x(), and TexCoordinate::y().


Member Data Documentation

Vec3f TexturedSmoothTriangle::mNa [private]

Vertex normals.

Definition at line 115 of file TexturedSmoothTriangle.h.

Referenced by normal(), setNormals(), and TexturedSmoothTriangle().

Vec3f TexturedSmoothTriangle::mNb [private]

Definition at line 116 of file TexturedSmoothTriangle.h.

Referenced by normal(), setNormals(), and TexturedSmoothTriangle().

Vec3f TexturedSmoothTriangle::mNc [private]

Definition at line 117 of file TexturedSmoothTriangle.h.

Referenced by normal(), setNormals(), and TexturedSmoothTriangle().

TexCoordinate TexturedSmoothTriangle::mTa [private]

Texture coordinates.

Definition at line 120 of file TexturedSmoothTriangle.h.

Referenced by setTexCoord(), and texCoord().

TexCoordinate TexturedSmoothTriangle::mTb [private]

Definition at line 121 of file TexturedSmoothTriangle.h.

Referenced by setTexCoord(), and texCoord().

TexCoordinate TexturedSmoothTriangle::mTc [private]

Definition at line 122 of file TexturedSmoothTriangle.h.

Referenced by setTexCoord(), and texCoord().


The documentation for this class was generated from the following file:
Generated on Fri Feb 1 00:02:32 2008 for Grayfall by  doxygen 1.5.1