Public Member Functions | Public Attributes | List of all members
IceMaths::IndexedTriangle Class Reference

#include <OPC_IceHook.h>

Public Member Functions

float Angle (const IndexedTriangle &tri, const Point *verts) const
 
float Area (const Point *verts) const
 
bool BackfaceCulling (const Point *verts, const Point &source) const
 
void Center (const Point *verts, Point &center) const
 
void CenteredNormal (const Point *verts, Point &normal) const
 
float Compacity (const Point *verts) const
 
CubeIndex ComputeCubeIndex (const Point *verts) const
 
float ComputeOcclusionPotential (const Point *verts, const Point &view) const
 
void ComputePoint (const Point *verts, float u, float v, Point &pt, udword *nearvtx=null) const
 
void DenormalizedNormal (const Point *verts, Point &normal) const
 
bool Equal (const IndexedTriangle &tri) const
 
ubyte FindEdge (udword vref0, udword vref1) const
 
void Flip ()
 
void GetVRefs (ubyte edgenb, udword &vref0, udword &vref1, udword &vref2) const
 
bool HasVertex (udword ref) const
 
bool HasVertex (udword ref, udword *index) const
 
inline_ IndexedTriangle ()
 Constructor. More...
 
inline_ IndexedTriangle (udword r0, udword r1, udword r2)
 Constructor. More...
 
inline_ IndexedTriangle (const IndexedTriangle &triangle)
 Copy constructor. More...
 
bool IsDegenerate () const
 
bool IsVisible (const Point *verts, const Point &source) const
 
float MaxEdgeLength (const Point *verts) const
 
float MinEdgeLength (const Point *verts) const
 
void Normal (const Point *verts, Point &normal) const
 
udword OppositeVertex (udword vref0, udword vref1) const
 
inline_ udword OppositeVertex (ubyte edgenb) const
 
float Perimeter (const Point *verts) const
 
inline_ Plane PlaneEquation (const Point *verts) const
 
void RandomPoint (const Point *verts, Point &random) const
 
bool ReplaceVertex (udword oldref, udword newref)
 
inline_ ~IndexedTriangle ()
 Destructor. More...
 

Public Attributes

udword mVRef [3]
 Vertex-references. More...
 

Detailed Description

Definition at line 24 of file OPC_IceHook.h.

Constructor & Destructor Documentation

◆ IndexedTriangle() [1/3]

inline_ IceMaths::IndexedTriangle::IndexedTriangle ( )
inline

Constructor.

Definition at line 28 of file OPC_IceHook.h.

◆ IndexedTriangle() [2/3]

inline_ IceMaths::IndexedTriangle::IndexedTriangle ( udword  r0,
udword  r1,
udword  r2 
)
inline

Constructor.

Definition at line 30 of file OPC_IceHook.h.

◆ IndexedTriangle() [3/3]

inline_ IceMaths::IndexedTriangle::IndexedTriangle ( const IndexedTriangle triangle)
inline

Copy constructor.

Definition at line 32 of file OPC_IceHook.h.

◆ ~IndexedTriangle()

inline_ IceMaths::IndexedTriangle::~IndexedTriangle ( )
inline

Destructor.

Definition at line 39 of file OPC_IceHook.h.

Member Function Documentation

◆ Angle()

float IndexedTriangle::Angle ( const IndexedTriangle tri,
const Point verts 
) const

Computes the angle between two triangles.

Parameters
tri[in] the other triangle
verts[in] the list of indexed vertices
Returns
the angle in radians

Definition at line 516 of file IceIndexedTriangle.cpp.

◆ Area()

float IndexedTriangle::Area ( const Point verts) const

Computes the triangle area.

Parameters
verts[in] the list of indexed vertices
Returns
the area

Definition at line 44 of file IceIndexedTriangle.cpp.

◆ BackfaceCulling()

bool IndexedTriangle::BackfaceCulling ( const Point verts,
const Point source 
) const

Computes backface culling.

Parameters
verts[in] the list of indexed vertices
source[in] source point (in local space) from which culling must be computed
Returns
true if the triangle is visible from the source point

Definition at line 217 of file IceIndexedTriangle.cpp.

◆ Center()

void IndexedTriangle::Center ( const Point verts,
Point center 
) const

Computes the triangle center.

Parameters
verts[in] the list of indexed vertices
center[out] the computed center

Definition at line 127 of file IceIndexedTriangle.cpp.

◆ CenteredNormal()

void IndexedTriangle::CenteredNormal ( const Point verts,
Point normal 
) const

Computes the centered normal

Parameters
verts[in] the list of indexed vertices
normal[out] the computed centered normal

Definition at line 144 of file IceIndexedTriangle.cpp.

◆ Compacity()

float IndexedTriangle::Compacity ( const Point verts) const

Computes the triangle compacity.

Parameters
verts[in] the list of indexed vertices
Returns
the compacity

Definition at line 78 of file IceIndexedTriangle.cpp.

◆ ComputeCubeIndex()

CubeIndex IceMaths::IndexedTriangle::ComputeCubeIndex ( const Point verts) const

◆ ComputeOcclusionPotential()

float IndexedTriangle::ComputeOcclusionPotential ( const Point verts,
const Point view 
) const

Computes the occlusion potential of the triangle.

Parameters
verts[in] the list of indexed vertices
source[in] source point (in local space) from which occlusion potential must be computed
Returns
the occlusion potential

Definition at line 249 of file IceIndexedTriangle.cpp.

◆ ComputePoint()

void IndexedTriangle::ComputePoint ( const Point verts,
float  u,
float  v,
Point pt,
udword nearvtx = null 
) const

Computes a point on the triangle according to the stabbing information.

Parameters
verts[in] the list of indexed vertices
u,v[in] point's barycentric coordinates
pt[out] point on triangle
nearvtx[out] index of nearest vertex

Definition at line 450 of file IceIndexedTriangle.cpp.

◆ DenormalizedNormal()

void IndexedTriangle::DenormalizedNormal ( const Point verts,
Point normal 
) const

Computes the triangle denormalized normal.

Parameters
verts[in] the list of indexed vertices
normal[out] the computed normal

Definition at line 110 of file IceIndexedTriangle.cpp.

◆ Equal()

bool IndexedTriangle::Equal ( const IndexedTriangle tri) const

Checks a triangle is the same as another one.

Parameters
tri[in] the other triangle
Returns
true if same triangle

Definition at line 542 of file IceIndexedTriangle.cpp.

◆ FindEdge()

ubyte IndexedTriangle::FindEdge ( udword  vref0,
udword  vref1 
) const

Finds an edge in a tri, given two vertex references.

Parameters
vref0[in] the edge's first vertex reference
vref1[in] the edge's second vertex reference
Returns
the edge number between 0 and 2, or 0xff if input refs are wrong.

Definition at line 334 of file IceIndexedTriangle.cpp.

◆ Flip()

void IndexedTriangle::Flip ( )

Flips the winding order.

Definition at line 32 of file IceIndexedTriangle.cpp.

◆ GetVRefs()

void IndexedTriangle::GetVRefs ( ubyte  edgenb,
udword vref0,
udword vref1,
udword vref2 
) const

Gets the three sorted vertex references according to an edge number. edgenb = 0 => edge 0-1, returns references 0, 1, 2 edgenb = 1 => edge 0-2, returns references 0, 2, 1 edgenb = 2 => edge 1-2, returns references 1, 2, 0

Parameters
edgenb[in] the edge number, 0, 1 or 2
vref0[out] the returned first vertex reference
vref1[out] the returned second vertex reference
vref2[out] the returned third vertex reference

Definition at line 377 of file IceIndexedTriangle.cpp.

◆ HasVertex() [1/2]

bool IndexedTriangle::HasVertex ( udword  ref) const

Checks whether the input vertex reference belongs to the triangle or not.

Parameters
ref[in] the vertex reference to look for
Returns
true if the triangle contains the vertex reference

Definition at line 302 of file IceIndexedTriangle.cpp.

◆ HasVertex() [2/2]

bool IndexedTriangle::HasVertex ( udword  ref,
udword index 
) const

Checks whether the input vertex reference belongs to the triangle or not.

Parameters
ref[in] the vertex reference to look for
index[out] the corresponding index in the triangle
Returns
true if the triangle contains the vertex reference

Definition at line 318 of file IceIndexedTriangle.cpp.

◆ IsDegenerate()

bool IndexedTriangle::IsDegenerate ( ) const

Checks whether the triangle is degenerate or not. A degenerate triangle has two common vertex references. This is a zero-area triangle.

Returns
true if the triangle is degenerate

Definition at line 287 of file IceIndexedTriangle.cpp.

◆ IsVisible()

bool IndexedTriangle::IsVisible ( const Point verts,
const Point source 
) const

Computes backface culling.

Parameters
verts[in] the list of indexed vertices
source[in] source point (in local space) from which culling must be computed
Returns
true if the triangle is visible from the source point

Definition at line 189 of file IceIndexedTriangle.cpp.

◆ MaxEdgeLength()

float IndexedTriangle::MaxEdgeLength ( const Point verts) const

Computes the triangle's largest edge length.

Parameters
verts[in] the list of indexed vertices
Returns
the largest edge length

Definition at line 427 of file IceIndexedTriangle.cpp.

◆ MinEdgeLength()

float IndexedTriangle::MinEdgeLength ( const Point verts) const

Computes the triangle's smallest edge length.

Parameters
verts[in] the list of indexed vertices
Returns
the smallest edge length

Definition at line 406 of file IceIndexedTriangle.cpp.

◆ Normal()

void IndexedTriangle::Normal ( const Point verts,
Point normal 
) const

Computes the triangle normal.

Parameters
verts[in] the list of indexed vertices
normal[out] the computed normal

Definition at line 93 of file IceIndexedTriangle.cpp.

◆ OppositeVertex() [1/2]

udword IndexedTriangle::OppositeVertex ( udword  vref0,
udword  vref1 
) const

Gets the last reference given the first two.

Parameters
vref0[in] the first vertex reference
vref1[in] the second vertex reference
Returns
the last reference, or INVALID_ID if input refs are wrong.

Definition at line 353 of file IceIndexedTriangle.cpp.

◆ OppositeVertex() [2/2]

inline_ udword IceMaths::IndexedTriangle::OppositeVertex ( ubyte  edgenb) const
inline

Definition at line 62 of file OPC_IceHook.h.

◆ Perimeter()

float IndexedTriangle::Perimeter ( const Point verts) const

Computes the triangle perimeter.

Parameters
verts[in] the list of indexed vertices
Returns
the perimeter

Definition at line 60 of file IceIndexedTriangle.cpp.

◆ PlaneEquation()

inline_ Plane IceMaths::IndexedTriangle::PlaneEquation ( const Point verts) const
inline

Definition at line 68 of file OPC_IceHook.h.

◆ RandomPoint()

void IndexedTriangle::RandomPoint ( const Point verts,
Point random 
) const

Computes a random point within the triangle.

Parameters
verts[in] the list of indexed vertices
normal[out] the computed centered normal

Definition at line 162 of file IceIndexedTriangle.cpp.

◆ ReplaceVertex()

bool IndexedTriangle::ReplaceVertex ( udword  oldref,
udword  newref 
)

Replaces a vertex reference with another one.

Parameters
oldref[in] the vertex reference to replace
newref[in] the new vertex reference
Returns
true if success, else false if the input vertex reference doesn't belong to the triangle

Definition at line 273 of file IceIndexedTriangle.cpp.

Member Data Documentation

◆ mVRef

udword IceMaths::IndexedTriangle::mVRef[3]

Vertex-references.

Definition at line 41 of file OPC_IceHook.h.


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


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:09