From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/a03621.html | 453 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 453 insertions(+) create mode 100644 docs/doxygen/nel/a03621.html (limited to 'docs/doxygen/nel/a03621.html') diff --git a/docs/doxygen/nel/a03621.html b/docs/doxygen/nel/a03621.html new file mode 100644 index 00000000..d62b5d5d --- /dev/null +++ b/docs/doxygen/nel/a03621.html @@ -0,0 +1,453 @@ + + +NeL: NLMISC::CTriangleUV class Reference + + + +
+

NLMISC::CTriangleUV Class Reference

#include <geom_ext.h> +

+

Inheritance diagram for NLMISC::CTriangleUV: +

+ +NLMISC::CTriangle +NL3D::CTrianglePatch + +

Detailed Description

+A triangle with 3 uvs.
Author:
Lionel Berenguier

+Nevrax France

+
Date:
2000
+ +

+ +

+Definition at line 167 of file geom_ext.h. + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

void computeGradient (float c0, float c1, float c2, CVector &grad) const
 CTriangleUV ()
 Constructor.

bool intersect (const CVector &p0, const CVector &p1, CVector &hit, const class NLMISC::CPlane &plane) const
CTriangleUVoperator= (const CTriangle &tri)

Data Fields

CUV Uv0
CUV Uv1
CUV Uv2
CVector V0
CVector V1
CVector V2
+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
NLMISC::CTriangleUV::CTriangleUV  )  [inline]
+
+ + + + + +
+   + + +

+Constructor. +

+ +

+Definition at line 175 of file geom_ext.h. +

+

00175 {}
+
+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void NLMISC::CTriangle::computeGradient float  c0,
float  c1,
float  c2,
CVector grad
const [inherited]
+
+ + + + + +
+   + + +

+3D Gradient computation. Given 3 values at the 3 corners 'ci' (gouraud, uv....), this method compute the gradients Grad. The formula to compute the interpolated value according to a 3d position 'v' in space is then simply:
+ c(v)= c0 + grad*(v-V0) +

+Definition at line 67 of file triangle.cpp. +

+References NLMISC::CVector::normalize(), NLMISC::CVector::set(), NLMISC::CTriangle::V0, NLMISC::CTriangle::V1, NLMISC::CTriangle::V2, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z. +

+Referenced by NL3D::BuildTangentSpace(), NL3D::CLodCharacterShapeBuild::compile(), NL3D::CTessFace::computeTesselatedPos(), NL3D::CVisualCollisionEntity::computeUvForPos(), and RenderTriangle(). +

+

00068 {
+00069         // Compute basis for 2D triangle.
+00070         CVector         locI, locJ, locK;
+00071         locI= V1-V0;
+00072         locJ= V2-V0;
+00073         locK= locI^locJ;
+00074         locK.normalize();
+00075         locI.normalize();
+00076         locJ= locK^locI;
+00077 
+00078         // compute triangle in 2D.
+00079         CTriangle       tri2D;
+00080         tri2D.V0.set(0,0,0);
+00081         tri2D.V1.x= (V1-V0)*locI;
+00082         tri2D.V1.y= (V1-V0)*locJ;
+00083         tri2D.V1.z= 0;
+00084         tri2D.V2.x= (V2-V0)*locI;
+00085         tri2D.V2.y= (V2-V0)*locJ;
+00086         tri2D.V2.z= 0;
+00087 
+00088         // Compute 2 2D Gradients.
+00089         float   dx01= tri2D.V0.x - tri2D.V2.x;
+00090         float   dx02= tri2D.V1.x - tri2D.V2.x;
+00091         float   dy01= tri2D.V0.y - tri2D.V2.y;
+00092         float   dy02= tri2D.V1.y - tri2D.V2.y;
+00093         float   dc01= c0 - c2;
+00094         float   dc02= c1 - c2;
+00095         float   gd= dx02*dy01 - dx01*dy02;
+00096 
+00097         float   OOgd;
+00098         if(gd!=0)
+00099                 OOgd= 1.0f/gd;
+00100         else
+00101                 OOgd= 1;        // for now, do not manage correctly this case.
+00102         float   gx, gy;
+00103         gx= (dc02*dy01 - dc01*dy02) * OOgd;
+00104         gy= (dc01*dx02 - dc02*dx01) * OOgd;
+00105 
+00106         // transform in 3D.
+00107         grad= locI*gx + locJ*gy;
+00108 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool NLMISC::CTriangle::intersect const CVector p0,
const CVector p1,
CVector hit,
const class NLMISC::CPlane plane
const [inherited]
+
+ + + + + +
+   + + +

+Intersection detection with a segment. You must pass the normalized plane of the triangle as parameter.

+

Parameters:
+ + + + + +
p0 is the first point of the segment.
p1 is the second point of the segment.
hit will receive the coordinate of the intersection if the method returns true.
plane is the plane of the triangle. Build it like this:
CPlane plane; + plane.make (triangle.V0, triangle.V1, triangle.V2); +
+
+
Returns:
true if the segement [p0,p1] intersects the triangle else false.
+ +

+Referenced by NL3D::CInstanceLighter::computeSunContribution(), NL3D::CZoneLighter::CPointLightRT::testRaytrace(), and NL3D::CInstanceLighter::CPointLightRT::testRaytrace().

+

+ + + + +
+ + + + + + + + + + +
CTriangleUV& NLMISC::CTriangleUV::operator= const CTriangle tri  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 177 of file geom_ext.h. +

+

00178         {
+00179                 *((CTriangle*)this)= tri;
+00180                 return *this;
+00181         }
+
+


Field Documentation

+

+ + + + +
+ + +
CUV NLMISC::CTriangleUV::Uv0 +
+
+ + + + + +
+   + + +

+ +

+Definition at line 170 of file geom_ext.h. +

+Referenced by NL3D::CPatch::addTileTrianglesInBBox(), NL3D::CPatchQuadBlock::buildTileTriangles(), NL3D::CVisualCollisionEntity::computeUvForPos(), and NL3D::CDriverUser::drawTriangle().

+

+ + + + +
+ + +
CUV NLMISC::CTriangleUV::Uv1 +
+
+ + + + + +
+   + + +

+ +

+Definition at line 170 of file geom_ext.h. +

+Referenced by NL3D::CPatch::addTileTrianglesInBBox(), NL3D::CPatchQuadBlock::buildTileTriangles(), NL3D::CVisualCollisionEntity::computeUvForPos(), and NL3D::CDriverUser::drawTriangle().

+

+ + + + +
+ + +
CUV NLMISC::CTriangleUV::Uv2 +
+
+ + + + + +
+   + + +

+ +

+Definition at line 170 of file geom_ext.h. +

+Referenced by NL3D::CPatch::addTileTrianglesInBBox(), NL3D::CPatchQuadBlock::buildTileTriangles(), NL3D::CVisualCollisionEntity::computeUvForPos(), and NL3D::CDriverUser::drawTriangle().

+

+ + + + +
+ + +
CVector NLMISC::CTriangle::V0 [inherited] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 51 of file triangle.h. +

+Referenced by NL3D::CMiniCol::addFaces(), NL3D::CPatch::addTileTrianglesInBBox(), NL3D::CShadowPolyReceiver::addTriangle(), NL3D::CLandscape::appendToShadowPolyReceiver(), NL3D::CLandscape::buildCollideFaces(), NL3D::BuildTangentSpace(), NL3D::CPatchQuadBlock::buildTileTriangles(), NL3D::BuildTriFromMB(), NL3D::CBSPTree< T >::CBSPNode::CBSPNode(), NL3D::CLodCharacterShapeBuild::compile(), NL3D::CZoneLighter::compilePointLightRT(), NLMISC::CTriangle::computeGradient(), NL3D::CTessFace::computeTesselatedPos(), NL3D::CVisualCollisionEntity::computeUvForPos(), NLMISC::CPolygon2D::CPolygon2D(), NL3D::CDriverUser::drawTriangle(), NL3D::CMiniCol::getFaces(), NL3D::CMiniCol::getGroundNormal(), NL3D::CCubeGrid< TCell >::insert(), NL3D::CBSPTree< T >::CBSPNode::insert(), NL3D::CZoneLighter::light(), NL3D::CInstanceLighter::light(), NL3D::CCubeGrid< TCell >::project(), RenderTriangle(), NL3D::CVisualCollisionEntity::snapToGround(), NL3D::CMiniCol::snapToGround(), NL3D::CVisualCollisionEntity::triangleIntersect(), NL3D::CVisualCollisionEntity::triangleIntersect2DCeil(), and NL3D::CVisualCollisionEntity::triangleIntersect2DGround().

+

+ + + + +
+ + +
CVector NLMISC::CTriangle::V1 [inherited] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 51 of file triangle.h. +

+Referenced by NL3D::CMiniCol::addFaces(), NL3D::CPatch::addTileTrianglesInBBox(), NL3D::CShadowPolyReceiver::addTriangle(), NL3D::CLandscape::appendToShadowPolyReceiver(), NL3D::CLandscape::buildCollideFaces(), NL3D::BuildTangentSpace(), NL3D::CPatchQuadBlock::buildTileTriangles(), NL3D::BuildTriFromMB(), NL3D::CBSPTree< T >::CBSPNode::CBSPNode(), NL3D::CLodCharacterShapeBuild::compile(), NL3D::CZoneLighter::compilePointLightRT(), NLMISC::CTriangle::computeGradient(), NL3D::CTessFace::computeTesselatedPos(), NLMISC::CPolygon2D::CPolygon2D(), NL3D::CDriverUser::drawTriangle(), NL3D::CMiniCol::getFaces(), NL3D::CMiniCol::getGroundNormal(), NL3D::CCubeGrid< TCell >::insert(), NL3D::CBSPTree< T >::CBSPNode::insert(), NL3D::CZoneLighter::light(), NL3D::CInstanceLighter::light(), NL3D::CCubeGrid< TCell >::project(), NL3D::CVisualCollisionEntity::snapToGround(), NL3D::CMiniCol::snapToGround(), NL3D::CVisualCollisionEntity::triangleIntersect(), NL3D::CVisualCollisionEntity::triangleIntersect2DCeil(), and NL3D::CVisualCollisionEntity::triangleIntersect2DGround().

+

+ + + + +
+ + +
CVector NLMISC::CTriangle::V2 [inherited] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 51 of file triangle.h. +

+Referenced by NL3D::CMiniCol::addFaces(), NL3D::CPatch::addTileTrianglesInBBox(), NL3D::CShadowPolyReceiver::addTriangle(), NL3D::CLandscape::appendToShadowPolyReceiver(), NL3D::CLandscape::buildCollideFaces(), NL3D::BuildTangentSpace(), NL3D::CPatchQuadBlock::buildTileTriangles(), NL3D::BuildTriFromMB(), NL3D::CBSPTree< T >::CBSPNode::CBSPNode(), NL3D::CLodCharacterShapeBuild::compile(), NL3D::CZoneLighter::compilePointLightRT(), NLMISC::CTriangle::computeGradient(), NL3D::CTessFace::computeTesselatedPos(), NLMISC::CPolygon2D::CPolygon2D(), NL3D::CDriverUser::drawTriangle(), NL3D::CMiniCol::getFaces(), NL3D::CMiniCol::getGroundNormal(), NL3D::CCubeGrid< TCell >::insert(), NL3D::CBSPTree< T >::CBSPNode::insert(), NL3D::CZoneLighter::light(), NL3D::CInstanceLighter::light(), NL3D::CCubeGrid< TCell >::project(), NL3D::CVisualCollisionEntity::snapToGround(), NL3D::CMiniCol::snapToGround(), NL3D::CVisualCollisionEntity::triangleIntersect(), NL3D::CVisualCollisionEntity::triangleIntersect2DCeil(), and NL3D::CVisualCollisionEntity::triangleIntersect2DGround().

+


The documentation for this class was generated from the following file: +
Generated on Tue Mar 16 13:39:14 2004 for NeL by + +doxygen +1.3.6
+ + -- cgit v1.2.1