gKit2 light
Public Member Functions | Public Attributes | List of all members
Triangle Struct Reference

triangle pour le bvh, cf fonction bounds() et intersect(). More...

+ Inheritance diagram for Triangle:

Public Member Functions

 Triangle (const TriangleData &data, const int _id)
 
void intersect (RayHit &ray) const
 
BBox bounds () const
 
 Triangle (const TriangleData &data, const int _id)
 
Hit intersect (const Ray &ray, const float htmax) const
 
BBox bounds () const
 
 Triangle (const vec3 &a, const vec3 &b, const vec3 &c, const int _mesh_id, const int _primitive_id, const int _id)
 
Hit intersect (const Ray &ray, const float htmax) const
 
BBox bounds () const
 
 Triangle (const vec3 &a, const vec3 &b, const vec3 &c, const int _mesh_id, const int _primitive_id, const int _id)
 
Hit intersect (const Ray &ray, const float htmax) const
 
BBox bounds () const
 
 Triangle (const TriangleData &data, const int _id)
 
void intersect (RayHit &ray) const
 
BBox bounds () const
 
 Triangle (const vec3 &a, const vec3 &b, const vec3 &c, const int _mesh_id, const int _primitive_id, const int _id)
 
Hit intersect (const Ray &ray, const float htmax) const
 
 Triangle (const TriangleData &data, const int _id)
 
Hit intersect (const Ray &ray, const float tmax) const
 
 Triangle (const TriangleData &data)
 
bool intersect (const Ray &ray, const float htmax, float &rt, float &ru, float &rv) const
 
Point point (const float u, const float v) const
 
Vector normal (const float u, const float v) const
 

Public Attributes

Point p
 
Vector e1
 
Vector e2
 
int id
 
int mesh_id
 
int primitive_id
 
int triangle_id
 
- Public Attributes inherited from TriangleData
vec3 a
 
vec3 b
 
vec3 c
 positions
More...
 
vec3 na
 
vec3 nb
 
vec3 nc
 normales More...
 
vec2 ta
 
vec2 tb
 
vec2 tc
 texcoords More...
 

Detailed Description

triangle pour le bvh, cf fonction bounds() et intersect().

Definition at line 83 of file tuto_bvh.cpp.

Member Function Documentation

◆ point()

Point Triangle::point ( const float  u,
const float  v 
) const
inline

renvoie un point a l'interieur du triangle connaissant ses coordonnees barycentriques. convention p(u, v)= (1 - u - v) * a + u * b + v * c

Definition at line 104 of file tuto_is.cpp.

105  {
106  float w= 1.f - u - v;
107  return Point(Vector(a) * w + Vector(b) * u + Vector(c) * v);
108  }
representation d'un point 3d.
Definition: vec.h:21
vec3 c
positions
Definition: mesh.h:96
representation d'un vecteur 3d.
Definition: vec.h:59

◆ normal()

Vector Triangle::normal ( const float  u,
const float  v 
) const
inline

renvoie une normale a l'interieur du triangle connaissant ses coordonnees barycentriques. convention p(u, v)= (1 - u - v) * a + u * b + v * c

Definition at line 112 of file tuto_is.cpp.

113  {
114  float w= 1.f - u - v;
115  return Vector(na) * w + Vector(nb) * u + Vector(nc) * v;
116  }
vec3 nc
normales
Definition: mesh.h:97

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