TinyRaytracer 0.1
A simple C++ raytracer
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Triangle Class Reference

Class Triangle, with 3 vertices that made it up. More...

#include <object.hpp>

Inheritance diagram for Triangle:
Object

Public Member Functions

 Triangle (Vertex a, Vertex b, Vertex c, RGB rgb)
 
 Triangle (Vertex a, Vertex b, Vertex c, std::string text)
 
ObjectInfo checkObject (Ray &ray) override
 
AABB getBox () override
 
RGB getColor (double b0, double b1, double b2)
 
void setProperties (RGB shine, RGB tran, double ior, double roughness) override
 
virtual ObjectInfo checkObject (Ray &ray)=0
 
virtual void setProperties (RGB, RGB, double, double)
 
virtual AABB getBox ()=0
 

Public Attributes

point3 p0
 
point3 p1
 
point3 p2
 Three vertices of the triangle.
 
Texcoord tex0
 
Texcoord tex1
 
Texcoord tex2
 texture coordinates for the vertices,if provided.
 
vec3 nor
 Normal of the triangle.
 
point3 e1
 
point3 e2
 The e1,e2 coordinates, precomputed for Barycentric calculation.
 
Image texture
 Texture, if provided.
 
Materials mat
 Material properties.
 
- Public Attributes inherited from Object
AABB bbox
 Axis-aligned bounding box for the Object class. For BVH traversal.
 

Detailed Description

Class Triangle, with 3 vertices that made it up.

Member Function Documentation

◆ checkObject()

ObjectInfo Triangle::checkObject ( Ray ray)
overridevirtual

Implements Object.

◆ getBox()

AABB Triangle::getBox ( )
inlineoverridevirtual

Implements Object.

◆ setProperties()

void Triangle::setProperties ( RGB  shine,
RGB  tran,
double  ior,
double  roughness 
)
inlineoverridevirtual

Reimplemented from Object.


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