# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CTriangle Class Reference

A simple triangles of 3 points. More...

#include <triangle.h>

Inheritance diagram for NLMISC::CTriangle

Inheritance graph
[legend]
Collaboration diagram for NLMISC::CTriangle:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTriangle ()
 Constructor. More...

 CTriangle (const CVector &a, const CVector &b, const CVector &c)
 Constructor. More...

bool intersect (const CVector& p0, const CVector& p1, CVector& hit, const class NLMISC::CPlane& plane) const
 Intersection detection with a segment. More...


Public Attributes

CVector V0
CVector V1
CVector V2

Detailed Description

A simple triangles of 3 points.

Author(s):
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 51 of file triangle.h.


Constructor & Destructor Documentation

NLMISC::CTriangle::CTriangle ( ) [inline]
 

Constructor.

Definition at line 58 of file triangle.h.

NLMISC::CTriangle::CTriangle ( const CVector & a,
const CVector & b,
const CVector & c ) [inline]
 

Constructor.

Definition at line 60 of file triangle.h.


Member Function Documentation

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

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.


Member Data Documentation

CVector NLMISC::CTriangle::V0
 

Definition at line 54 of file triangle.h.

CVector NLMISC::CTriangle::V1
 

Definition at line 54 of file triangle.h.

CVector NLMISC::CTriangle::V2
 

Definition at line 54 of file triangle.h.


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