#include <CSOMath.h>
Public Member Functions | |
| CSOMath () | |
| Constructor. | |
| ~CSOMath () | |
| Destructor. | |
Static Public Member Functions | |
| static void | init () |
| Initializes the CSOMath module. | |
| static double | computeArea (const std::vector< Vector3 > &points, const Vector3 &normal) |
| Computes the area of the polygon, given as a list of points. | |
| static void | computeAreaAndCenterOfGravity (const std::vector< Vector3 > &points, const Vector3 &normal, const Vector3 ¢erPoint, double &area, Vector3 ¢erOfGravity) |
| Computes the area and center of gravity (in terms of area) of the polygon, given as a list of points. | |
| static Vector3 | mapWorldToVoxel (const Vector3 &worldPos, const CSO *cso) |
| Computes the voxel position of a given world position with the matrix of the given CSO. | |
| static void | mapWorldToVoxel (const Vector3 &worldPos, Vector3 &voxelPos, const CSO *cso) |
| Computes the voxel position of a given world position with the matrix of the given CSO. | |
| static int | floorToInt (const double x) |
| Returns the floored double value as an integer. | |
| static int | ceilToInt (const double x) |
| Returns the ceiled double value as an integer. | |
| static float | fast_log (float value) |
| Calculates the natural logarithm based on an approximation using a look up table. | |
| static double | computeDirectionDotProduct (const Vector3 &predPos, const Vector3 &middlePos, const Vector3 &succPos) |
| Computes and returns the dot product of the direction vectors of pred-middle and middle-succ. | |
| static bool | computeIsInPlane (const CSO *cso, Vector3 &planeNormal) |
| static bool | isSelfIntersecting (const std::vector< Vector3 > &positions, bool isClosed) |
| static bool | isSelfIntersecting (const std::vector< Vector3 > &positions, std::vector< Vector3 > &intersectPoints, bool isClosed) |
| static bool | isSelfIntersecting (const CSO *cso) |
| static bool | isSelfIntersecting (const CSO *cso, std::vector< Vector3 > &intersectPositions) |
| static double | computeSegmentSegmentDistance (const Vector3 &start0, const Vector3 &end0, const Vector3 &start1, const Vector3 &end1, Vector3 &intersectionPoint, bool &isParallel) |
| static double | computeSegmentSegmentDistance (const Vector3 &start0, const Vector3 &end0, const Vector3 &start1, const Vector3 &end1, Vector3 &intersectionPoint) |
| static bool | areInSamePlane (CSO *cso0, CSO *cso1) |
| static bool | computeUnionIntersectionCSOs (CSO *, CSO *, CSO *, CSO *) |
| static void | rotateAndProject (Rotation &rot, Vector3 &voxelPos, bool shouldProject=true) |
| static void | level (CSO *cso) |
| static bool | isPointInsidePolygon (const std::vector< Vector3 > &polygonPoints, const Vector3 &point) |
| static void | appendUniquePosition (std::vector< Vector3 > &positions, Vector3 pos) |
| static Vector3 | getCenterOfGravity (CSO *cso, bool considerSeedPointsExtra=false) |
| static double | distanceToLine (const Vector3 &point, const Vector3 &linePoint1, const Vector3 &linePoint2) |
Static Public Attributes | |
| static const double | smallNumber |
| A small number for comparisons. | |
Definition at line 31 of file CSOMath.h.
| ml::CSOMath::CSOMath | ( | ) |
Constructor.
| ml::CSOMath::~CSOMath | ( | ) |
Destructor.
| static int ml::CSOMath::ceilToInt | ( | const double | x | ) | [inline, static] |
| static double ml::CSOMath::computeArea | ( | const std::vector< Vector3 > & | points, | |
| const Vector3 & | normal | |||
| ) | [static] |
Computes the area of the polygon, given as a list of points.
| static void ml::CSOMath::computeAreaAndCenterOfGravity | ( | const std::vector< Vector3 > & | points, | |
| const Vector3 & | normal, | |||
| const Vector3 & | centerPoint, | |||
| double & | area, | |||
| Vector3 & | centerOfGravity | |||
| ) | [static] |
Computes the area and center of gravity (in terms of area) of the polygon, given as a list of points.
In contrast to CSOGeometry::getCenterOfGravity(), this method defines the center of gravity as the center of the enclosed area.
| static double ml::CSOMath::computeDirectionDotProduct | ( | const Vector3 & | predPos, | |
| const Vector3 & | middlePos, | |||
| const Vector3 & | succPos | |||
| ) | [static] |
Computes and returns the dot product of the direction vectors of pred-middle and middle-succ.
| static float ml::CSOMath::fast_log | ( | float | value | ) | [inline, static] |
| static int ml::CSOMath::floorToInt | ( | const double | x | ) | [inline, static] |
| static void ml::CSOMath::init | ( | ) | [static] |
Initializes the CSOMath module.
| static bool ml::CSOMath::isSelfIntersecting | ( | const CSO * | cso | ) | [inline, static] |
| static bool ml::CSOMath::isSelfIntersecting | ( | const std::vector< Vector3 > & | positions, | |
| bool | isClosed | |||
| ) | [inline, static] |
| static void ml::CSOMath::level | ( | CSO * | cso | ) | [inline, static] |
| static void ml::CSOMath::mapWorldToVoxel | ( | const Vector3 & | worldPos, | |
| Vector3 & | voxelPos, | |||
| const CSO * | cso | |||
| ) | [static] |
Computes the voxel position of a given world position with the matrix of the given CSO.
Computes the voxel position of a given world position with the matrix of the given CSO.
const double ml::CSOMath::smallNumber [static] |
1.5.8