diff options
Diffstat (limited to 'intern/dualcon/intern/Projections.h')
-rw-r--r-- | intern/dualcon/intern/Projections.h | 109 |
1 files changed, 54 insertions, 55 deletions
diff --git a/intern/dualcon/intern/Projections.h b/intern/dualcon/intern/Projections.h index e77c234b058..fc650158a0b 100644 --- a/intern/dualcon/intern/Projections.h +++ b/intern/dualcon/intern/Projections.h @@ -24,11 +24,11 @@ #define GRID_DIMENSION 20 #if defined(_WIN32) && !(_MSC_VER >= 1900) -#define isnan(n) _isnan(n) -#define LONG __int64 -#define int64_t __int64 +# define isnan(n) _isnan(n) +# define LONG __int64 +# define int64_t __int64 #else -#include <stdint.h> +# include <stdint.h> #endif /** @@ -59,71 +59,70 @@ extern const int facemap[6][4]; * Structure for the projections inheritable from parent */ struct TriangleProjection { - /// Projections of triangle (min and max) - int64_t tri_proj[NUM_AXES][2]; + /// Projections of triangle (min and max) + int64_t tri_proj[NUM_AXES][2]; - /// Normal of the triangle - double norm[3]; + /// Normal of the triangle + double norm[3]; - /// Index of polygon - int index; + /// Index of polygon + int index; }; /* This is a projection for the cube against a single projection axis, see CubeTriangleIsect.cubeProj */ struct CubeProjection { - int64_t origin; - int64_t edges[3]; - int64_t min, max; + int64_t origin; + int64_t edges[3]; + int64_t min, max; }; - /** * Class for projections of cube / triangle vertices on the separating axes */ -class CubeTriangleIsect -{ -public: - /// Inheritable portion - TriangleProjection *inherit; - - /// Projections of the cube vertices - CubeProjection cubeProj[NUM_AXES]; - -public: - CubeTriangleIsect() {} - - /** - * Construction from a cube (axes aligned) and triangle - */ - CubeTriangleIsect(int64_t cube[2][3], int64_t trig[3][3], int64_t error, int triind); - - /** - * Construction from a parent CubeTriangleIsect object and the index of - * the children - */ - CubeTriangleIsect(CubeTriangleIsect *parent); - - unsigned char getBoxMask( ); - - /** - * Shifting a cube to a new origin - */ - void shift(int off[3]); - - /** - * Method to test intersection of the triangle and the cube - */ - int isIntersecting() const; - - int isIntersectingPrimary(int edgeInd) const; - - float getIntersectionPrimary(int edgeInd) const; +class CubeTriangleIsect { + public: + /// Inheritable portion + TriangleProjection *inherit; + + /// Projections of the cube vertices + CubeProjection cubeProj[NUM_AXES]; + + public: + CubeTriangleIsect() + { + } + + /** + * Construction from a cube (axes aligned) and triangle + */ + CubeTriangleIsect(int64_t cube[2][3], int64_t trig[3][3], int64_t error, int triind); + + /** + * Construction from a parent CubeTriangleIsect object and the index of + * the children + */ + CubeTriangleIsect(CubeTriangleIsect *parent); + + unsigned char getBoxMask(); + + /** + * Shifting a cube to a new origin + */ + void shift(int off[3]); + + /** + * Method to test intersection of the triangle and the cube + */ + int isIntersecting() const; + + int isIntersectingPrimary(int edgeInd) const; + + float getIntersectionPrimary(int edgeInd) const; #ifdef WITH_CXX_GUARDEDALLOC - MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:CubeTriangleIsect") + MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:CubeTriangleIsect") #endif - }; -#endif /* __PROJECTIONS_H__ */ +#endif /* __PROJECTIONS_H__ */ |