#include <surfaces/Triangle.h>
Inheritance diagram for Triangle:

Public Member Functions | |
| Triangle (const Vector3 &_p0, const Vector3 &_p1, const Vector3 &_p2, SurfaceShader *mat) | |
| Triangle (const Vector3 &_p0, const Vector3 &_p1, const Vector3 &_p2, const Vector3 &_n0, const Vector3 &_n1, const Vector3 &_n2, SurfaceShader *mat) | |
| Triangle (const Vector3 &_p0, const Vector3 &_p1, const Vector3 &_p2, const Vector3 &_n0, const Vector3 &_n1, const Vector3 &_n2, const Vector2 &_u0, const Vector2 &_u1, const Vector2 &_u2, SurfaceShader *mat) | |
| bool | hit (Ray &r, HitRecord &rec, Context &context) const |
| bool | shadowHit (Ray &r, Context &context) const |
| BBox | boundingBox (double time0, double time1) const |
| bool | overlapsBox (const BBox &box) const |
| Uses Tomas Akenine-Moller's code for Triangle-Box overlap. | |
| double | pdfDirection (const Vector3 &vout, const HitRecord &hrec, Context &context) const |
| double | area () const |
Public Attributes | |
| SurfaceShader * | sshader |
Vertices | |
The vertex positions. | |
| Vector3 | p0 |
| Vector3 | p1 |
| Vector3 | p2 |
Normals | |
Per vertex normals. | |
| Vector3 | n0 |
| Vector3 | n1 |
| Vector3 | n2 |
TextureCoordinates | |
Per vertex texture coordinates. | |
| Vector2 | u0 |
| Vector2 | u1 |
| Vector2 | u2 |
A Triangle primitive that stores all information (position, normals and texture coordinates) explicitly. Shading information is interpolated according to the barycentric coordinates of the hit location.
|
||||||||||||||||
|
Intersect given ray with the surface.
Implements Surface. |
|
||||||||||||
|
Intersect without visibility ordering or shading geometry.
Reimplemented from Surface. |
|
||||||||||||
|
Calculate the bounding box of the surface.
Implements Surface. |
|
||||||||||||||||
|
We assume that a point is chosen at random on the triangle, so the pdf with area measure is 1/A. For a given point on the triangle with area dA we know Reimplemented from Surface. |
1.4.3