The CSOMath namespace offers some common methods for various problems, e.g., computing the area, mapping from voxel to world or computing numerical problems real fast.
More...
Functions |
MLCSO_EXPORT double | computeArea (const std::vector< Vector3 > &points, const Vector3 &normal) |
| Computes the area of the polygon, given as a list of points.
|
MLCSO_EXPORT void | computeAreaAndCenterOfGravity (const std::vector< Vector3 > &points, const Vector3 &normal, const Vector3 ¢erPoint, double &area, Vector3 ¢erOfGravity) |
MLCSO_EXPORT Vector3 | mapWorldToVoxel (const Vector3 &worldPos, const CSO *cso) |
| Computes the voxel position of a given world position with the matrix of the given CSO.
|
MLCSO_EXPORT 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.
|
MLCSO_EXPORT int | floorToInt (const double x) |
| Returns the floored double value as an integer.
|
MLCSO_EXPORT int | ceilToInt (const double x) |
| Returns the ceiled double value as an integer.
|
MLCSO_EXPORT 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.
|
Variables |
const double | smallNumber = 10e-10 |
Detailed Description
The CSOMath namespace offers some common methods for various problems, e.g., computing the area, mapping from voxel to world or computing numerical problems real fast.
Function Documentation
MLCSO_EXPORT int ml::CSOMath::ceilToInt |
( |
const double |
x | ) |
[inline] |
Returns the ceiled double value as an integer.
On WIN32 platforms this function uses a faster implementation using inline assembler.
Definition at line 71 of file CSOMath.h.
MLCSO_EXPORT double ml::CSOMath::computeArea |
( |
const std::vector< Vector3 > & |
points, |
|
|
const Vector3 & |
normal |
|
) |
| |
Computes the area of the polygon, given as a list of points.
MLCSO_EXPORT void ml::CSOMath::computeAreaAndCenterOfGravity |
( |
const std::vector< Vector3 > & |
points, |
|
|
const Vector3 & |
normal, |
|
|
const Vector3 & |
centerPoint, |
|
|
double & |
area, |
|
|
Vector3 & |
centerOfGravity |
|
) |
| |
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.
- Parameters:
-
[in] | points | The points that define the polygon. |
[in] | normal | The normal vector of the plane that contains the polygon points. |
[in] | centerPoint | The point that is used to create a triangle fan for the calculation of the polygon area. Any point within the polygon plane may be used (e.g. the first path point), but for numerical reasons a point close to the center should be preferred. |
[out] | area | Return parameter for the calculated area of the polygon. |
[out] | centerOfGravity | Return parameter for the calculated center of gravity of the polygon. |
- Returns:
- See parameters area and centerOfGravity.
MLCSO_EXPORT double ml::CSOMath::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.
MLCSO_EXPORT int ml::CSOMath::floorToInt |
( |
const double |
x | ) |
[inline] |
Returns the floored double value as an integer.
On WIN32 platforms this function uses a faster implementation using inline assembler.
Definition at line 57 of file CSOMath.h.
MLCSO_EXPORT Vector3 ml::CSOMath::mapWorldToVoxel |
( |
const Vector3 & |
worldPos, |
|
|
const CSO * |
cso |
|
) |
| |
Computes the voxel position of a given world position with the matrix of the given CSO.
MLCSO_EXPORT void ml::CSOMath::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.
Variable Documentation