KiCad PCB EDA Suite
CTRIANGLE Class Reference

A triangle object. More...

#include <ctriangle.h>

Inheritance diagram for CTRIANGLE:
COBJECT

Public Member Functions

 CTRIANGLE (const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3)
 
 CTRIANGLE (const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3, const SFVEC3F &aFaceNormal)
 
 CTRIANGLE (const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3, const SFVEC3F &aN1, const SFVEC3F &aN2, const SFVEC3F &aN3)
 
void SetColor (const SFVEC3F &aColor)
 
void SetColor (const SFVEC3F &aVC0, const SFVEC3F &aVC1, const SFVEC3F &aVC2)
 
void SetColor (unsigned int aFaceColorRGBA)
 
void SetColor (unsigned int aVertex1ColorRGBA, unsigned int aVertex2ColorRGBA, unsigned int aVertex3ColorRGBA)
 
void SetUV (const SFVEC2F &aUV1, const SFVEC2F &aUV2, const SFVEC2F &aUV3)
 
bool Intersect (const RAY &aRay, HITINFO &aHitInfo) const override
 Functions Intersect. More...
 
bool IntersectP (const RAY &aRay, float aMaxDistance) const override
 Functions Intersect for shadow test. More...
 
bool Intersects (const CBBOX &aBBox) const override
 Function Intersects. More...
 
SFVEC3F GetDiffuseColor (const HITINFO &aHitInfo) const override
 
void SetMaterial (const CMATERIAL *aMaterial)
 
const CMATERIALGetMaterial () const
 
float GetModelTransparency () const
 
void SetModelTransparency (float aModelTransparency)
 
const CBBOXGetBBox () const
 
const SFVEC3FGetCentroid () const
 

Protected Attributes

CBBOX m_bbox
 
SFVEC3F m_centroid
 
OBJECT3D_TYPE m_obj_type
 
const CMATERIALm_material
 
float m_modelTransparency
 

Private Member Functions

void pre_calc_const ()
 

Private Attributes

SFVEC3F m_normal [3]
 
SFVEC3F m_vertex [3]
 
SFVEC3F m_n
 
SFVEC2F m_uv [3]
 
unsigned int m_vertexColorRGBA [3]
 
float m_nu
 
float m_nv
 
float m_nd
 
unsigned int m_k
 
float m_bnu
 
float m_bnv
 
float m_cnu
 
float m_cnv
 

Detailed Description

A triangle object.

Definition at line 42 of file ctriangle.h.

Constructor & Destructor Documentation

◆ CTRIANGLE() [1/3]

CTRIANGLE::CTRIANGLE ( const SFVEC3F aV1,
const SFVEC3F aV2,
const SFVEC3F aV3 
)

Definition at line 101 of file ctriangle.cpp.

103 {
104  m_vertex[0] = aV1;
105  m_vertex[1] = aV2;
106  m_vertex[2] = aV3;
107 
108  m_vertexColorRGBA[0] = 0xFFFFFFFF;
109  m_vertexColorRGBA[1] = 0xFFFFFFFF;
110  m_vertexColorRGBA[2] = 0xFFFFFFFF;
111 
112  pre_calc_const();
113 }
unsigned int m_vertexColorRGBA[3]
Definition: ctriangle.h:80
SFVEC3F m_vertex[3]
Definition: ctriangle.h:77
void pre_calc_const()
Definition: ctriangle.cpp:37
COBJECT(OBJECT3D_TYPE aObjType)
Definition: cobject.cpp:39

References m_vertex, m_vertexColorRGBA, pre_calc_const(), and TRIANGLE.

◆ CTRIANGLE() [2/3]

CTRIANGLE::CTRIANGLE ( const SFVEC3F aV1,
const SFVEC3F aV2,
const SFVEC3F aV3,
const SFVEC3F aFaceNormal 
)

Definition at line 116 of file ctriangle.cpp.

119 {
120  m_vertex[0] = aV1;
121  m_vertex[1] = aV2;
122  m_vertex[2] = aV3;
123 
124  m_vertexColorRGBA[0] = 0xFFFFFFFF;
125  m_vertexColorRGBA[1] = 0xFFFFFFFF;
126  m_vertexColorRGBA[2] = 0xFFFFFFFF;
127 
128  pre_calc_const();
129 
130  m_normal[0] = aFaceNormal;
131  m_normal[1] = aFaceNormal;
132  m_normal[2] = aFaceNormal;
133 }
unsigned int m_vertexColorRGBA[3]
Definition: ctriangle.h:80
SFVEC3F m_vertex[3]
Definition: ctriangle.h:77
void pre_calc_const()
Definition: ctriangle.cpp:37
COBJECT(OBJECT3D_TYPE aObjType)
Definition: cobject.cpp:39
SFVEC3F m_normal[3]
Definition: ctriangle.h:76

References m_normal, m_vertex, m_vertexColorRGBA, pre_calc_const(), and TRIANGLE.

◆ CTRIANGLE() [3/3]

CTRIANGLE::CTRIANGLE ( const SFVEC3F aV1,
const SFVEC3F aV2,
const SFVEC3F aV3,
const SFVEC3F aN1,
const SFVEC3F aN2,
const SFVEC3F aN3 
)

Definition at line 136 of file ctriangle.cpp.

139 {
140  m_vertex[0] = aV1;
141  m_vertex[1] = aV2;
142  m_vertex[2] = aV3;
143 
144  m_vertexColorRGBA[0] = 0xFFFFFFFF;
145  m_vertexColorRGBA[1] = 0xFFFFFFFF;
146  m_vertexColorRGBA[2] = 0xFFFFFFFF;
147 
148  pre_calc_const();
149 
150  m_normal[0] = aN1;
151  m_normal[1] = aN2;
152  m_normal[2] = aN3;
153 }
unsigned int m_vertexColorRGBA[3]
Definition: ctriangle.h:80
SFVEC3F m_vertex[3]
Definition: ctriangle.h:77
void pre_calc_const()
Definition: ctriangle.cpp:37
COBJECT(OBJECT3D_TYPE aObjType)
Definition: cobject.cpp:39
SFVEC3F m_normal[3]
Definition: ctriangle.h:76

References m_normal, m_vertex, m_vertexColorRGBA, pre_calc_const(), and TRIANGLE.

Member Function Documentation

◆ GetBBox()

const CBBOX& COBJECT::GetBBox ( ) const
inlineinherited

Definition at line 105 of file cobject.h.

105 { return m_bbox; }
CBBOX m_bbox
Definition: cobject.h:53

References COBJECT::m_bbox.

Referenced by CGENERICCONTAINER::Add(), and CBVH_PBRT::Intersect().

◆ GetCentroid()

const SFVEC3F& COBJECT::GetCentroid ( ) const
inlineinherited

Definition at line 107 of file cobject.h.

107 { return m_centroid; }
SFVEC3F m_centroid
Definition: cobject.h:54

References COBJECT::m_centroid.

◆ GetDiffuseColor()

SFVEC3F CTRIANGLE::GetDiffuseColor ( const HITINFO aHitInfo) const
overridevirtual

Implements COBJECT.

Definition at line 318 of file ctriangle.cpp.

319 {
320  const unsigned int rgbC1 = m_vertexColorRGBA[0];
321  const unsigned int rgbC2 = m_vertexColorRGBA[1];
322  const unsigned int rgbC3 = m_vertexColorRGBA[2];
323 
324  const SFVEC3F c1 = SFVEC3F( (float)((rgbC1 >> 24) & 0xFF) / 255.0f,
325  (float)((rgbC1 >> 16) & 0xFF) / 255.0f,
326  (float)((rgbC1 >> 8) & 0xFF) / 255.0f );
327  const SFVEC3F c2 = SFVEC3F( (float)((rgbC2 >> 24) & 0xFF) / 255.0f,
328  (float)((rgbC2 >> 16) & 0xFF) / 255.0f,
329  (float)((rgbC2 >> 8) & 0xFF) / 255.0f );
330  const SFVEC3F c3 = SFVEC3F( (float)((rgbC3 >> 24) & 0xFF) / 255.0f,
331  (float)((rgbC3 >> 16) & 0xFF) / 255.0f,
332  (float)((rgbC3 >> 8) & 0xFF) / 255.0f );
333 
334  const float u = aHitInfo.m_UV.x;
335  const float v = aHitInfo.m_UV.y;
336  const float w = 1.0f - u - v;
337 
338  return w * c1 + u * c2 + v * c3;
339 }
unsigned int m_vertexColorRGBA[3]
Definition: ctriangle.h:80
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
SFVEC2F m_UV
( 8) 2-D texture coordinates
Definition: hitinfo.h:46

References HITINFO::m_UV, and m_vertexColorRGBA.

◆ GetMaterial()

const CMATERIAL* COBJECT::GetMaterial ( ) const
inlineinherited

Definition at line 72 of file cobject.h.

72 { return m_material; }
const CMATERIAL * m_material
Definition: cobject.h:56

References COBJECT::m_material.

Referenced by CBVH_PBRT::IntersectP(), and C3D_RENDER_RAYTRACING::shadeHit().

◆ GetModelTransparency()

float COBJECT::GetModelTransparency ( ) const
inlineinherited

Definition at line 73 of file cobject.h.

73 { return m_modelTransparency; }
float m_modelTransparency
Definition: cobject.h:60

References COBJECT::m_modelTransparency.

Referenced by C3D_RENDER_RAYTRACING::shadeHit().

◆ Intersect()

bool CTRIANGLE::Intersect ( const RAY aRay,
HITINFO aHitInfo 
) const
overridevirtual

Functions Intersect.

Intersect

Parameters
aRay
aHitInfo
Returns
true if the aRay intersects the object

TODO: precalc this, improove it

Implements COBJECT.

Definition at line 212 of file ctriangle.cpp.

213 {
215 #define ku s_modulo[m_k + 1]
216 #define kv s_modulo[m_k + 2]
217 
218  const SFVEC3F &O = aRay.m_Origin;
219  const SFVEC3F &D = aRay.m_Dir;
220  const SFVEC3F &A = m_vertex[0];
221 
222  const float lnd = 1.0f / (D[m_k] + m_nu * D[ku] + m_nv * D[kv]);
223  const float t = (m_nd - O[m_k] - m_nu * O[ku] - m_nv * O[kv]) * lnd;
224 
225  if( !( (aHitInfo.m_tHit > t) && (t > 0.0f) ) )
226  return false;
227 
228  const float hu = O[ku] + t * D[ku] - A[ku];
229  const float hv = O[kv] + t * D[kv] - A[kv];
230  const float beta = hv * m_bnu + hu * m_bnv;
231 
232  if( beta < 0.0f )
233  return false;
234 
235  const float gamma = hu * m_cnu + hv * m_cnv;
236 
237  if( gamma < 0 )
238  return false;
239 
240  const float v = gamma;
241  const float u = beta;
242 
243  if( (u + v) > 1.0f )
244  return false;
245 
246  if( glm::dot( D, m_n ) > 0.0f )
247  return false;
248 
249  aHitInfo.m_tHit = t;
250  aHitInfo.m_HitPoint = aRay.at( t );
251 
252  // interpolate vertex normals with UVW using Gouraud's shading
253  aHitInfo.m_HitNormal = glm::normalize( (1.0f - u - v) * m_normal[0] +
254  u * m_normal[1] +
255  v * m_normal[2] );
256 
257  m_material->PerturbeNormal( aHitInfo.m_HitNormal, aRay, aHitInfo );
258 
259  aHitInfo.pHitObject = this;
260 
261  return true;
262 #undef ku
263 #undef kv
264 }
float m_bnu
Definition: ctriangle.h:83
#define ku
SFVEC3F m_n
Definition: ctriangle.h:78
float m_nd
Definition: ctriangle.h:81
float m_nv
Definition: ctriangle.h:81
const CMATERIAL * m_material
Definition: cobject.h:56
#define kv
float m_tHit
( 4) distance
Definition: hitinfo.h:43
SFVEC3F at(float t) const
Definition: ray.h:89
SFVEC3F m_HitPoint
(12) hit position
Definition: hitinfo.h:49
float m_bnv
Definition: ctriangle.h:83
SFVEC3F m_vertex[3]
Definition: ctriangle.h:77
unsigned int m_k
Definition: ctriangle.h:82
float m_cnu
Definition: ctriangle.h:84
const COBJECT * pHitObject
( 4) Object that was hitted
Definition: hitinfo.h:45
SFVEC3F m_Dir
Definition: ray.h:72
SFVEC3F m_Origin
Definition: ray.h:69
#define D(x)
Definition: ptree.cpp:41
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
SFVEC3F m_HitNormal
(12) normal at the hit point
Definition: hitinfo.h:42
SFVEC3F m_normal[3]
Definition: ctriangle.h:76
float m_cnv
Definition: ctriangle.h:84
void PerturbeNormal(SFVEC3F &aNormal, const RAY &aRay, const HITINFO &aHitInfo) const
Definition: cmaterial.cpp:88
float m_nu
Definition: ctriangle.h:81

References RAY::at(), D, ku, kv, m_bnu, m_bnv, m_cnu, m_cnv, RAY::m_Dir, HITINFO::m_HitNormal, HITINFO::m_HitPoint, m_k, COBJECT::m_material, m_n, m_nd, m_normal, m_nu, m_nv, RAY::m_Origin, HITINFO::m_tHit, m_vertex, CMATERIAL::PerturbeNormal(), and HITINFO::pHitObject.

◆ IntersectP()

bool CTRIANGLE::IntersectP ( const RAY aRay,
float  aMaxDistance 
) const
overridevirtual

Functions Intersect for shadow test.

Intersect

Parameters
aRay
aMaxDistance- max distance of the test
Returns
true if the aRay intersects the object

TODO: precalc this

Implements COBJECT.

Definition at line 267 of file ctriangle.cpp.

269 {
271 #define ku s_modulo[m_k + 1]
272 #define kv s_modulo[m_k + 2]
273 
274  const SFVEC3F O = aRay.m_Origin;
275  const SFVEC3F D = aRay.m_Dir;
276  const SFVEC3F A = m_vertex[0];
277 
278  const float lnd = 1.0f / (D[m_k] + m_nu * D[ku] + m_nv * D[kv]);
279  const float t = (m_nd - O[m_k] - m_nu * O[ku] - m_nv * O[kv]) * lnd;
280 
281  if( !( (aMaxDistance > t) && (t > 0.0f) ) )
282  return false;
283 
284  const float hu = O[ku] + t * D[ku] - A[ku];
285  const float hv = O[kv] + t * D[kv] - A[kv];
286  const float beta = hv * m_bnu + hu * m_bnv;
287 
288  if( beta < 0.0f )
289  return false;
290 
291  const float gamma = hu * m_cnu + hv * m_cnv;
292 
293  if( gamma < 0.0f )
294  return false;
295 
296  const float v = gamma;
297  const float u = beta;
298 
299  if( (u + v) > 1.0f )
300  return false;
301 
302  if( glm::dot( D, m_n ) > 0.0f )
303  return false;
304 
305  return true;
306 #undef ku
307 #undef kv
308 }
float m_bnu
Definition: ctriangle.h:83
#define ku
SFVEC3F m_n
Definition: ctriangle.h:78
float m_nd
Definition: ctriangle.h:81
float m_nv
Definition: ctriangle.h:81
#define kv
float m_bnv
Definition: ctriangle.h:83
SFVEC3F m_vertex[3]
Definition: ctriangle.h:77
unsigned int m_k
Definition: ctriangle.h:82
float m_cnu
Definition: ctriangle.h:84
SFVEC3F m_Dir
Definition: ray.h:72
SFVEC3F m_Origin
Definition: ray.h:69
#define D(x)
Definition: ptree.cpp:41
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
float m_cnv
Definition: ctriangle.h:84
float m_nu
Definition: ctriangle.h:81

References D, ku, kv, m_bnu, m_bnv, m_cnu, m_cnv, RAY::m_Dir, m_k, m_n, m_nd, m_nu, m_nv, RAY::m_Origin, and m_vertex.

◆ Intersects()

bool CTRIANGLE::Intersects ( const CBBOX aBBox) const
overridevirtual

Function Intersects.

Intersects - a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅) It intersects if the result intersection is not null

Parameters
aBBox
Returns

TODO: improove

Implements COBJECT.

Definition at line 311 of file ctriangle.cpp.

312 {
314  return m_bbox.Intersects( aBBox );
315 }
bool Intersects(const CBBOX &aBBox) const
Function Intersects test if a bounding box intersects this box.
Definition: cbbox.cpp:230
CBBOX m_bbox
Definition: cobject.h:53

References CBBOX::Intersects(), and COBJECT::m_bbox.

◆ pre_calc_const()

void CTRIANGLE::pre_calc_const ( )
private

Definition at line 37 of file ctriangle.cpp.

38 {
39  const SFVEC3F &A = m_vertex[0];
40  const SFVEC3F &B = m_vertex[1];
41  const SFVEC3F &C = m_vertex[2];
42  const SFVEC3F c = B - A;
43  const SFVEC3F b = C - A;
44 
45  m_bbox.Reset();
46  m_bbox.Set( A );
47  m_bbox.Union( B );
48  m_bbox.Union( C );
51 
52  m_n = glm::cross( b, c );
53 
54  if( glm::abs( m_n.x ) > glm::abs( m_n.y ) )
55  {
56  if( glm::abs( m_n.x ) > glm::abs( m_n.z ) )
57  m_k = 0;
58  else
59  m_k = 2;
60  }
61  else
62  {
63  if( glm::abs( m_n.y ) > glm::abs( m_n.z ) )
64  m_k = 1;
65  else
66  m_k = 2;
67  }
68 
69  int u = (m_k + 1) % 3;
70  int v = (m_k + 2) % 3;
71 
72 
73  // precomp
74  float krec = 1.0f / m_n[m_k];
75 
76  m_nu = m_n[u] * krec;
77  m_nv = m_n[v] * krec;
78  m_nd = glm::dot( m_n, A ) * krec;
79 
80 
81  // first line equation
82  float reci = 1.0f / (b[u] * c[v] - b[v] * c[u]);
83 
84  m_bnu = b[u] * reci;
85  m_bnv = -b[v] * reci;
86 
87 
88  // second line equation
89  m_cnu = c[v] * reci;
90  m_cnv = -c[u] * reci;
91 
92  // finalize normal
93  m_n = glm::normalize( m_n );
94 
95  m_normal[0] = m_n;
96  m_normal[1] = m_n;
97  m_normal[2] = m_n;
98 }
float m_bnu
Definition: ctriangle.h:83
SFVEC3F m_centroid
Definition: cobject.h:54
SFVEC3F m_n
Definition: ctriangle.h:78
float m_nd
Definition: ctriangle.h:81
float m_nv
Definition: ctriangle.h:81
CBBOX m_bbox
Definition: cobject.h:53
void Set(const SFVEC3F &aPbMin, const SFVEC3F &aPbMax)
Function Set Set bounding box with new parameters.
Definition: cbbox.cpp:67
void Union(const SFVEC3F &aPoint)
Function Union recalculate the bounding box adding a point.
Definition: cbbox.cpp:105
SFVEC3F GetCenter() const
Function GetCenter return the center point of the bounding box.
Definition: cbbox.cpp:135
float m_bnv
Definition: ctriangle.h:83
SFVEC3F m_vertex[3]
Definition: ctriangle.h:77
unsigned int m_k
Definition: ctriangle.h:82
float m_cnu
Definition: ctriangle.h:84
void ScaleNextUp()
Function ScaleNextUp scales a bounding box to the next float representation making it larger.
Definition: cbbox.cpp:206
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
SFVEC3F m_normal[3]
Definition: ctriangle.h:76
float m_cnv
Definition: ctriangle.h:84
void Reset()
Function Reset reset the bounding box to zero and de-initialized it.
Definition: cbbox.cpp:98
float m_nu
Definition: ctriangle.h:81

References CBBOX::GetCenter(), COBJECT::m_bbox, m_bnu, m_bnv, COBJECT::m_centroid, m_cnu, m_cnv, m_k, m_n, m_nd, m_normal, m_nu, m_nv, m_vertex, CBBOX::Reset(), CBBOX::ScaleNextUp(), CBBOX::Set(), and CBBOX::Union().

Referenced by CTRIANGLE().

◆ SetColor() [1/4]

void CTRIANGLE::SetColor ( const SFVEC3F aColor)

Definition at line 156 of file ctriangle.cpp.

157 {
158  m_vertexColorRGBA[0] = ((unsigned int)(aColor.r * 255) << 24) |
159  ((unsigned int)(aColor.g * 255) << 16) |
160  ((unsigned int)(aColor.b * 255) << 8) | 0xFF;
163 }
unsigned int m_vertexColorRGBA[3]
Definition: ctriangle.h:80

References m_vertexColorRGBA.

Referenced by C3D_RENDER_RAYTRACING::add_3D_models(), and C3D_RENDER_RAYTRACING::reload().

◆ SetColor() [2/4]

void CTRIANGLE::SetColor ( const SFVEC3F aVC0,
const SFVEC3F aVC1,
const SFVEC3F aVC2 
)

Definition at line 166 of file ctriangle.cpp.

169 {
170  m_vertexColorRGBA[0] = ((unsigned int)(aVC0.r * 255) << 24) |
171  ((unsigned int)(aVC0.g * 255) << 16) |
172  ((unsigned int)(aVC0.b * 255) << 8) | 0xFF;
173  m_vertexColorRGBA[1] = ((unsigned int)(aVC1.r * 255) << 24) |
174  ((unsigned int)(aVC1.g * 255) << 16) |
175  ((unsigned int)(aVC1.b * 255) << 8) | 0xFF;
176  m_vertexColorRGBA[2] = ((unsigned int)(aVC2.r * 255) << 24) |
177  ((unsigned int)(aVC2.g * 255) << 16) |
178  ((unsigned int)(aVC2.b * 255) << 8) | 0xFF;
179 }
unsigned int m_vertexColorRGBA[3]
Definition: ctriangle.h:80

References m_vertexColorRGBA.

◆ SetColor() [3/4]

void CTRIANGLE::SetColor ( unsigned int  aFaceColorRGBA)

Definition at line 182 of file ctriangle.cpp.

183 {
184  m_vertexColorRGBA[0] = aFaceColorRGBA;
185  m_vertexColorRGBA[1] = aFaceColorRGBA;
186  m_vertexColorRGBA[2] = aFaceColorRGBA;
187 }
unsigned int m_vertexColorRGBA[3]
Definition: ctriangle.h:80

References m_vertexColorRGBA.

◆ SetColor() [4/4]

void CTRIANGLE::SetColor ( unsigned int  aVertex1ColorRGBA,
unsigned int  aVertex2ColorRGBA,
unsigned int  aVertex3ColorRGBA 
)

Definition at line 190 of file ctriangle.cpp.

193 {
194  m_vertexColorRGBA[0] = aVertex1ColorRGBA;
195  m_vertexColorRGBA[1] = aVertex2ColorRGBA;
196  m_vertexColorRGBA[2] = aVertex3ColorRGBA;
197 }
unsigned int m_vertexColorRGBA[3]
Definition: ctriangle.h:80

References m_vertexColorRGBA.

◆ SetMaterial()

void COBJECT::SetMaterial ( const CMATERIAL aMaterial)
inlineinherited

Definition at line 66 of file cobject.h.

67  {
68  m_material = aMaterial;
69  m_modelTransparency = aMaterial->GetTransparency(); // Default transparency is from material
70  }
const CMATERIAL * m_material
Definition: cobject.h:56
float m_modelTransparency
Definition: cobject.h:60
float GetTransparency() const
Definition: cmaterial.h:213

References CMATERIAL::GetTransparency(), COBJECT::m_material, and COBJECT::m_modelTransparency.

Referenced by C3D_RENDER_RAYTRACING::add_3D_models(), C3D_RENDER_RAYTRACING::create_3d_object_from(), C3D_RENDER_RAYTRACING::insert3DPadHole(), C3D_RENDER_RAYTRACING::insert3DViaHole(), and C3D_RENDER_RAYTRACING::reload().

◆ SetModelTransparency()

void COBJECT::SetModelTransparency ( float  aModelTransparency)
inlineinherited

Definition at line 74 of file cobject.h.

74 { m_modelTransparency = aModelTransparency; }
float m_modelTransparency
Definition: cobject.h:60

References COBJECT::m_modelTransparency.

Referenced by C3D_RENDER_RAYTRACING::add_3D_models().

◆ SetUV()

void CTRIANGLE::SetUV ( const SFVEC2F aUV1,
const SFVEC2F aUV2,
const SFVEC2F aUV3 
)

Definition at line 200 of file ctriangle.cpp.

203 {
204  m_uv[0] = aUV1;
205  m_uv[1] = aUV2;
206  m_uv[2] = aUV3;
207 }
SFVEC2F m_uv[3]
Definition: ctriangle.h:79

References m_uv.

Member Data Documentation

◆ m_bbox

◆ m_bnu

float CTRIANGLE::m_bnu
private

Definition at line 83 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_bnv

float CTRIANGLE::m_bnv
private

Definition at line 83 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_centroid

◆ m_cnu

float CTRIANGLE::m_cnu
private

Definition at line 84 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_cnv

float CTRIANGLE::m_cnv
private

Definition at line 84 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_k

unsigned int CTRIANGLE::m_k
private

Definition at line 82 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_material

◆ m_modelTransparency

float COBJECT::m_modelTransparency
protectedinherited

◆ m_n

SFVEC3F CTRIANGLE::m_n
private

Definition at line 78 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_nd

float CTRIANGLE::m_nd
private

Definition at line 81 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_normal

SFVEC3F CTRIANGLE::m_normal[3]
private

Definition at line 76 of file ctriangle.h.

Referenced by CTRIANGLE(), Intersect(), and pre_calc_const().

◆ m_nu

float CTRIANGLE::m_nu
private

Definition at line 81 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_nv

float CTRIANGLE::m_nv
private

Definition at line 81 of file ctriangle.h.

Referenced by Intersect(), IntersectP(), and pre_calc_const().

◆ m_obj_type

OBJECT3D_TYPE COBJECT::m_obj_type
protectedinherited

Definition at line 55 of file cobject.h.

Referenced by COBJECT::COBJECT().

◆ m_uv

SFVEC2F CTRIANGLE::m_uv[3]
private

Definition at line 79 of file ctriangle.h.

Referenced by SetUV().

◆ m_vertex

SFVEC3F CTRIANGLE::m_vertex[3]
private

Definition at line 77 of file ctriangle.h.

Referenced by CTRIANGLE(), Intersect(), IntersectP(), and pre_calc_const().

◆ m_vertexColorRGBA

unsigned int CTRIANGLE::m_vertexColorRGBA[3]
private

Definition at line 80 of file ctriangle.h.

Referenced by CTRIANGLE(), GetDiffuseColor(), and SetColor().


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