vtdata library
|
Classes | |
class | FPoint3 |
class | DPoint3 |
class | FPoint2 |
class | DPoint2 |
class | IPoint2 |
class | DLine2 |
class | FLine2 |
class | DLine3 |
class | FLine3 |
class | FPlane |
class | FBox3 |
class | FSphere |
class | DPolygon2 |
class | DPolyArray |
class | FPolygon3 |
class | DRECT |
class | FRECT |
class | DMatrix3 |
class | DMatrix4 |
class | FMatrix3 |
class | FMatrix4 |
class | FQuat |
class | FPQ |
class | RGBi |
class | RGBAi |
class | RGBf |
class | RGBAf |
class | ScopedLocale |
Typedefs | |
typedef std::vector< DLine2 > | DLine2Array |
typedef std::vector< FLine3 > | FLine3Array |
typedef float | FMatrix4Data[4][4] |
Functions | |
float | random_offset (float x) |
float | random (float x) |
int | vt_log2 (int n) |
float | vt_log2f (float n) |
double | AngleSideVector (const DPoint2 &p0, const DPoint2 &p1, const DPoint2 &p2, DPoint2 &sideways) |
float | AngleSideVector (const FPoint3 &p0, const FPoint3 &p1, const FPoint3 &p2, FPoint3 &sideways) |
bool | CrossingsTest (const DPoint2 *pgon, int numverts, const DPoint2 &point) |
bool | CrossingsTest (const DPoint3 *pgon, int numverts, const DPoint2 &point) |
bool | PointInTriangle (const FPoint2 &p, const FPoint2 &p1, const FPoint2 &p2, const FPoint2 &p3) |
bool | PointInTriangle (const DPoint2 &p, const DPoint2 &p1, const DPoint2 &p2, const DPoint2 &p3) |
bool | BarycentricCoords (const FPoint2 &p1, const FPoint2 &p2, const FPoint2 &p3, const FPoint2 &p, float fBary[3]) |
bool | BarycentricCoords (const DPoint2 &p1, const DPoint2 &p2, const DPoint2 &p3, const DPoint2 &p, double fBary[3]) |
bool | PlaneIntersection (const FPlane &plane1, const FPlane &plane2, const FPlane &plane3, FPoint3 &result) |
double | DistancePointToLine (const DPoint2 &p1, const DPoint2 &p2, const DPoint2 &p3) |
float | DistanceLineToLine (const FPoint3 &A1, const FPoint3 &A2, const FPoint3 &B1, const FPoint3 &B2, FPoint3 &result1, FPoint3 &result2) |
float | DistanceSegmentToSegment (const FPoint3 &A1, const FPoint3 &A2, const FPoint3 &B1, const FPoint3 &B2, FPoint3 &result1, FPoint3 &result2) |
int | LineSegmentsIntersect (const DPoint2 &p1, const DPoint2 &p2, const DPoint2 &p3, const DPoint2 &p4, DPoint2 *result=NULL) |
void | vtLogMatrix (const FMatrix4 &mat) |
void | vtLogMatrix (const FMatrix3 &mat) |
bool | RaySphereIntersection (const FPoint3 &rkOrigin, const FPoint3 &rkDirection, const FSphere &rkSphere, int &riQuantity, FPoint3 akPoint[2]) |
void | ProjectionXZ (const FLine3 &fline3, DLine2 &dline2) |
void | ProjectionXZ (const FPolygon3 &fpoly3, DPolygon2 &dpoly2) |
void | ProjectionXZ (const DLine2 &dline2, float fY, FLine3 &fline3) |
void | ProjectionXZ (const DPolygon2 &dpoly2, float fY, FPolygon3 &fpoly3) |
double | AreaOfTriangle (const DPoint2 &A, const DPoint2 &B, const DPoint2 &C) |
double | AreaOfTriangle (const DPoint3 &A, const DPoint3 &B, const DPoint3 &C) |
double AngleSideVector | ( | const DPoint2 & | p0, |
const DPoint2 & | p1, | ||
const DPoint2 & | p2, | ||
DPoint2 & | sideways | ||
) |
Given three points in a polyline, determine a side vector will will offset the polyline, to the left, by a unit width.
float AngleSideVector | ( | const FPoint3 & | p0, |
const FPoint3 & | p1, | ||
const FPoint3 & | p2, | ||
FPoint3 & | sideways | ||
) |
Given three points in a polyline, determine a side vector will will offset the polyline by a unit width.
bool BarycentricCoords | ( | const FPoint2 & | p1, |
const FPoint2 & | p2, | ||
const FPoint2 & | p3, | ||
const FPoint2 & | p, | ||
float | fBary[3] | ||
) |
Compute the 3 barycentric coordinates of a 2D point in a 2D triangle.
bool BarycentricCoords | ( | const DPoint2 & | p1, |
const DPoint2 & | p2, | ||
const DPoint2 & | p3, | ||
const DPoint2 & | p, | ||
double | fBary[3] | ||
) |
Compute the 3 barycentric coordinates of a 2D point in a 2D triangle.
Point-in-polygon test.
Tests whether the 2D polygon pgon with numverts number of vertices contains the test point point.
Another version of CrossingsTest that accepts 3D rather than 2D points. Only the first two components (X and Y) are tested, so this allows you to do a 2D test with a 3D polygon.
float DistanceLineToLine | ( | const FPoint3 & | A1, |
const FPoint3 & | A2, | ||
const FPoint3 & | B1, | ||
const FPoint3 & | B2, | ||
FPoint3 & | result1, | ||
FPoint3 & | result2 | ||
) |
Given the four vectors defining your points A1, A2, B1, and B2, the points result1 and result2 on the lines A1A2 and B1B2, respectively, which are closest together, and their distance, d, apart.
Find the closest distance from a point to a line segment.
p1,p2 | The points which define the line segment. |
p3 | The point to which to measure distance. |
int LineSegmentsIntersect | ( | const DPoint2 & | p1, |
const DPoint2 & | p2, | ||
const DPoint2 & | p3, | ||
const DPoint2 & | p4, | ||
DPoint2 * | result | ||
) |
Test whether two 2D line segment intersect or not. Based on the algorithm 'Faster Line Segment Intersection' by Franklin Antonio
bool PlaneIntersection | ( | const FPlane & | plane1, |
const FPlane & | plane2, | ||
const FPlane & | plane3, | ||
FPoint3 & | result | ||
) |
Find the intersection of 3 planes.
bool PointInTriangle | ( | const FPoint2 & | p, |
const FPoint2 & | p1, | ||
const FPoint2 & | p2, | ||
const FPoint2 & | p3 | ||
) |
2D point in triangle containment test.
bool PointInTriangle | ( | const DPoint2 & | p, |
const DPoint2 & | p1, | ||
const DPoint2 & | p2, | ||
const DPoint2 & | p3 | ||
) |
2D point in triangle containment test.
To convert between 3D and 2D entities, project to and from the 3D coordinate system's XZ plane.
int vt_log2 | ( | int | n | ) |
Compute base-2 logarithm of an integer. There's probably an even simpler way to do this with sneaky logical ops or without a loop, but this works.