Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <Opcode.h>
Public Member Functions | |
inline_ | IndexedTriangle () |
Constructor. More... | |
inline_ | IndexedTriangle (udword r0, udword r1, udword r2) |
Constructor. More... | |
inline_ | IndexedTriangle (const IndexedTriangle &triangle) |
Copy constructor. More... | |
inline_ | ~IndexedTriangle () |
Destructor. More... | |
void | Flip () |
float | Area (const Point *verts) const |
float | Perimeter (const Point *verts) const |
float | Compacity (const Point *verts) const |
void | Normal (const Point *verts, Point &normal) const |
void | DenormalizedNormal (const Point *verts, Point &normal) const |
void | Center (const Point *verts, Point ¢er) const |
void | CenteredNormal (const Point *verts, Point &normal) const |
void | RandomPoint (const Point *verts, Point &random) const |
bool | IsVisible (const Point *verts, const Point &source) const |
bool | BackfaceCulling (const Point *verts, const Point &source) const |
float | ComputeOcclusionPotential (const Point *verts, const Point &view) const |
bool | ReplaceVertex (udword oldref, udword newref) |
bool | IsDegenerate () const |
bool | HasVertex (udword ref) const |
bool | HasVertex (udword ref, udword *index) const |
ubyte | FindEdge (udword vref0, udword vref1) const |
udword | OppositeVertex (udword vref0, udword vref1) const |
inline_ udword | OppositeVertex (ubyte edgenb) const |
void | GetVRefs (ubyte edgenb, udword &vref0, udword &vref1, udword &vref2) const |
float | MinEdgeLength (const Point *verts) const |
float | MaxEdgeLength (const Point *verts) const |
void | ComputePoint (const Point *verts, float u, float v, Point &pt, udword *nearvtx=null) const |
float | Angle (const IndexedTriangle &tri, const Point *verts) const |
inline_ Plane | PlaneEquation (const Point *verts) const |
bool | Equal (const IndexedTriangle &tri) const |
Public Attributes | |
udword | mVRef [3] |
Vertex-references. More... | |
|
inline |
|
inline |
|
inline |
float IndexedTriangle::Angle | ( | const IndexedTriangle & | tri, |
const Point * | verts | ||
) | const |
Computes the angle between two triangles.
tri | [in] the other triangle |
verts | [in] the list of indexed vertices |
Definition at line 517 of file IceIndexedTriangle.cpp.
Computes the triangle area.
verts | [in] the list of indexed vertices |
Definition at line 45 of file IceIndexedTriangle.cpp.
Computes backface culling.
verts | [in] the list of indexed vertices |
source | [in] source point (in local space) from which culling must be computed |
Definition at line 218 of file IceIndexedTriangle.cpp.
Computes the triangle center.
verts | [in] the list of indexed vertices |
center | [out] the computed center |
Definition at line 128 of file IceIndexedTriangle.cpp.
Computes the centered normal
verts | [in] the list of indexed vertices |
normal | [out] the computed centered normal |
Definition at line 145 of file IceIndexedTriangle.cpp.
Computes the triangle compacity.
verts | [in] the list of indexed vertices |
Definition at line 79 of file IceIndexedTriangle.cpp.
Computes the occlusion potential of the triangle.
verts | [in] the list of indexed vertices |
source | [in] source point (in local space) from which occlusion potential must be computed |
Definition at line 250 of file IceIndexedTriangle.cpp.
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.
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 451 of file IceIndexedTriangle.cpp.
Computes the triangle denormalized normal.
verts | [in] the list of indexed vertices |
normal | [out] the computed normal |
Definition at line 111 of file IceIndexedTriangle.cpp.
bool IndexedTriangle::Equal | ( | const IndexedTriangle & | tri) | const |
Checks a triangle is the same as another one.
tri | [in] the other triangle |
Definition at line 543 of file IceIndexedTriangle.cpp.
Finds an edge in a tri, given two vertex references.
vref0 | [in] the edge's first vertex reference |
vref1 | [in] the edge's second vertex reference |
Definition at line 335 of file IceIndexedTriangle.cpp.
void IndexedTriangle::Flip | ( | ) |
Flips the winding order.
Definition at line 33 of file IceIndexedTriangle.cpp.
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
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 378 of file IceIndexedTriangle.cpp.
Checks whether the input vertex reference belongs to the triangle or not.
ref | [in] the vertex reference to look for |
Definition at line 303 of file IceIndexedTriangle.cpp.
Checks whether the input vertex reference belongs to the triangle or not.
ref | [in] the vertex reference to look for |
index | [out] the corresponding index in the triangle |
Definition at line 319 of file IceIndexedTriangle.cpp.
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.
Definition at line 288 of file IceIndexedTriangle.cpp.
Computes backface culling.
verts | [in] the list of indexed vertices |
source | [in] source point (in local space) from which culling must be computed |
Definition at line 190 of file IceIndexedTriangle.cpp.
Computes the triangle's largest edge length.
verts | [in] the list of indexed vertices |
Definition at line 428 of file IceIndexedTriangle.cpp.
Computes the triangle's smallest edge length.
verts | [in] the list of indexed vertices |
Definition at line 407 of file IceIndexedTriangle.cpp.
Computes the triangle normal.
verts | [in] the list of indexed vertices |
normal | [out] the computed normal |
Definition at line 94 of file IceIndexedTriangle.cpp.
Gets the last reference given the first two.
vref0 | [in] the first vertex reference |
vref1 | [in] the second vertex reference |
Definition at line 354 of file IceIndexedTriangle.cpp.
Computes the triangle perimeter.
verts | [in] the list of indexed vertices |
Definition at line 61 of file IceIndexedTriangle.cpp.
Computes a random point within the triangle.
verts | [in] the list of indexed vertices |
normal | [out] the computed centered normal |
Definition at line 163 of file IceIndexedTriangle.cpp.
Replaces a vertex reference with another one.
oldref | [in] the vertex reference to replace |
newref | [in] the new vertex reference |
Definition at line 274 of file IceIndexedTriangle.cpp.