KiCad PCB EDA Suite
|
#include <triangle_3d.h>
Public Member Functions | |
TRIANGLE (const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3) | |
TRIANGLE (const SFVEC3F &aV1, const SFVEC3F &aV2, const SFVEC3F &aV3, const SFVEC3F &aFaceNormal) | |
TRIANGLE (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 |
bool | IntersectP (const RAY &aRay, float aMaxDistance) const override |
bool | Intersects (const BBOX_3D &aBBox) const override |
SFVEC3F | GetDiffuseColor (const HITINFO &aHitInfo) const override |
void | SetBoardItem (BOARD_ITEM *aBoardItem) |
BOARD_ITEM * | GetBoardItem () const |
void | SetMaterial (const MATERIAL *aMaterial) |
const MATERIAL * | GetMaterial () const |
float | GetModelTransparency () const |
void | SetModelTransparency (float aModelTransparency) |
const BBOX_3D & | GetBBox () const |
const SFVEC3F & | GetCentroid () const |
Protected Attributes | |
BBOX_3D | m_bbox |
SFVEC3F | m_centroid |
OBJECT_3D_TYPE | m_obj_type |
const MATERIAL * | m_material |
BOARD_ITEM * | m_boardItem |
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 |
A triangle object.
Definition at line 42 of file triangle_3d.h.
Definition at line 95 of file triangle_3d.cpp.
References m_vertex, m_vertexColorRGBA, and pre_calc_const().
TRIANGLE::TRIANGLE | ( | const SFVEC3F & | aV1, |
const SFVEC3F & | aV2, | ||
const SFVEC3F & | aV3, | ||
const SFVEC3F & | aFaceNormal | ||
) |
Definition at line 110 of file triangle_3d.cpp.
References m_normal, m_vertex, m_vertexColorRGBA, and pre_calc_const().
TRIANGLE::TRIANGLE | ( | const SFVEC3F & | aV1, |
const SFVEC3F & | aV2, | ||
const SFVEC3F & | aV3, | ||
const SFVEC3F & | aN1, | ||
const SFVEC3F & | aN2, | ||
const SFVEC3F & | aN3 | ||
) |
Definition at line 130 of file triangle_3d.cpp.
References m_normal, m_vertex, m_vertexColorRGBA, and pre_calc_const().
|
inlineinherited |
Definition at line 92 of file object_3d.h.
References OBJECT_3D::m_bbox.
Referenced by CONTAINER_3D_BASE::Add(), and BVH_PBRT::Intersect().
|
inlineinherited |
Definition at line 56 of file object_3d.h.
References OBJECT_3D::m_boardItem.
Referenced by RENDER_3D_RAYTRACE_BASE::IntersectBoardItem().
|
inlineinherited |
Definition at line 94 of file object_3d.h.
References OBJECT_3D::m_centroid.
Implements OBJECT_3D.
Definition at line 306 of file triangle_3d.cpp.
References HITINFO::m_UV, and m_vertexColorRGBA.
|
inlineinherited |
Definition at line 64 of file object_3d.h.
References OBJECT_3D::m_material.
Referenced by BVH_PBRT::IntersectP(), and RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 65 of file object_3d.h.
References OBJECT_3D::m_modelTransparency.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
TODO: precalc this, improve it
Implements OBJECT_3D.
Definition at line 202 of file triangle_3d.cpp.
References RAY::at(), MATERIAL::Generate(), ku, kv, m_bnu, m_bnv, m_cnu, m_cnv, RAY::m_Dir, HITINFO::m_HitNormal, HITINFO::m_HitPoint, m_k, OBJECT_3D::m_material, m_n, m_nd, m_normal, m_nu, m_nv, RAY::m_Origin, HITINFO::m_tHit, m_vertex, and HITINFO::pHitObject.
|
overridevirtual |
aMaxDistance | is the maximum distance of the test. |
TODO: precalc this
Implements OBJECT_3D.
Definition at line 256 of file triangle_3d.cpp.
References 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.
|
overridevirtual |
TODO: improve
Implements OBJECT_3D.
Definition at line 299 of file triangle_3d.cpp.
References BBOX_3D::Intersects(), and OBJECT_3D::m_bbox.
|
private |
Definition at line 34 of file triangle_3d.cpp.
References BBOX_3D::GetCenter(), OBJECT_3D::m_bbox, m_bnu, m_bnv, OBJECT_3D::m_centroid, m_cnu, m_cnv, m_k, m_n, m_nd, m_normal, m_nu, m_nv, m_vertex, BBOX_3D::Reset(), BBOX_3D::ScaleNextUp(), BBOX_3D::Set(), and BBOX_3D::Union().
Referenced by TRIANGLE().
|
inlineinherited |
Definition at line 55 of file object_3d.h.
References OBJECT_3D::m_boardItem.
Referenced by RENDER_3D_RAYTRACE_BASE::addModels().
void TRIANGLE::SetColor | ( | const SFVEC3F & | aColor | ) |
Definition at line 150 of file triangle_3d.cpp.
References m_vertexColorRGBA.
Referenced by RENDER_3D_RAYTRACE_BASE::addModels(), and RENDER_3D_RAYTRACE_BASE::Reload().
Definition at line 160 of file triangle_3d.cpp.
References m_vertexColorRGBA.
void TRIANGLE::SetColor | ( | unsigned int | aFaceColorRGBA | ) |
Definition at line 174 of file triangle_3d.cpp.
References m_vertexColorRGBA.
void TRIANGLE::SetColor | ( | unsigned int | aVertex1ColorRGBA, |
unsigned int | aVertex2ColorRGBA, | ||
unsigned int | aVertex3ColorRGBA | ||
) |
Definition at line 182 of file triangle_3d.cpp.
References m_vertexColorRGBA.
|
inlineinherited |
Definition at line 58 of file object_3d.h.
References MATERIAL::GetTransparency(), OBJECT_3D::m_material, and OBJECT_3D::m_modelTransparency.
Referenced by RENDER_3D_RAYTRACE_BASE::addModels(), RENDER_3D_RAYTRACE_BASE::createItemsFromContainer(), RENDER_3D_RAYTRACE_BASE::createObject(), RENDER_3D_RAYTRACE_BASE::insertHole(), and RENDER_3D_RAYTRACE_BASE::Reload().
|
inlineinherited |
Definition at line 66 of file object_3d.h.
References OBJECT_3D::m_modelTransparency.
Referenced by RENDER_3D_RAYTRACE_BASE::addModels().
Definition at line 191 of file triangle_3d.cpp.
References m_uv.
|
protectedinherited |
Definition at line 97 of file object_3d.h.
Referenced by CYLINDER::CYLINDER(), DUMMY_BLOCK::DUMMY_BLOCK(), OBJECT_3D::GetBBox(), CYLINDER::Intersect(), DUMMY_BLOCK::Intersect(), LAYER_ITEM::Intersect(), ROUND_SEGMENT::Intersect(), CYLINDER::IntersectP(), DUMMY_BLOCK::IntersectP(), LAYER_ITEM::IntersectP(), ROUND_SEGMENT::IntersectP(), CYLINDER::Intersects(), DUMMY_BLOCK::Intersects(), LAYER_ITEM::Intersects(), XY_PLANE::Intersects(), ROUND_SEGMENT::Intersects(), Intersects(), LAYER_ITEM::LAYER_ITEM(), pre_calc_const(), ROUND_SEGMENT::ROUND_SEGMENT(), and XY_PLANE::XY_PLANE().
|
private |
Definition at line 79 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
private |
Definition at line 79 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
protectedinherited |
Definition at line 102 of file object_3d.h.
Referenced by OBJECT_3D::GetBoardItem(), OBJECT_3D::OBJECT_3D(), and OBJECT_3D::SetBoardItem().
|
protectedinherited |
Definition at line 98 of file object_3d.h.
Referenced by CYLINDER::CYLINDER(), DUMMY_BLOCK::DUMMY_BLOCK(), OBJECT_3D::GetCentroid(), LAYER_ITEM::LAYER_ITEM(), pre_calc_const(), ROUND_SEGMENT::ROUND_SEGMENT(), and XY_PLANE::XY_PLANE().
|
private |
Definition at line 80 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
private |
Definition at line 80 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
private |
Definition at line 78 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
protectedinherited |
Definition at line 100 of file object_3d.h.
Referenced by OBJECT_3D::GetMaterial(), CYLINDER::Intersect(), DUMMY_BLOCK::Intersect(), LAYER_ITEM::Intersect(), XY_PLANE::Intersect(), ROUND_SEGMENT::Intersect(), Intersect(), OBJECT_3D::OBJECT_3D(), and OBJECT_3D::SetMaterial().
|
protectedinherited |
Definition at line 106 of file object_3d.h.
Referenced by OBJECT_3D::GetModelTransparency(), OBJECT_3D::OBJECT_3D(), OBJECT_3D::SetMaterial(), and OBJECT_3D::SetModelTransparency().
|
private |
Definition at line 74 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
private |
Definition at line 77 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
private |
Definition at line 72 of file triangle_3d.h.
Referenced by Intersect(), pre_calc_const(), and TRIANGLE().
|
private |
Definition at line 77 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
private |
Definition at line 77 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), and pre_calc_const().
|
protectedinherited |
Definition at line 99 of file object_3d.h.
Referenced by OBJECT_3D::OBJECT_3D().
|
private |
Definition at line 75 of file triangle_3d.h.
Referenced by SetUV().
|
private |
Definition at line 73 of file triangle_3d.h.
Referenced by Intersect(), IntersectP(), pre_calc_const(), and TRIANGLE().
|
private |
Definition at line 76 of file triangle_3d.h.
Referenced by GetDiffuseColor(), SetColor(), and TRIANGLE().