Blender V4.3
Projections.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#ifndef __PROJECTIONS_H__
6#define __PROJECTIONS_H__
7
8#include <stdio.h>
9#include <stdlib.h>
10
11#define CONTAINS_INDEX
12#define GRID_DIMENSION 20
13
14#if defined(_WIN32) && !(_MSC_VER >= 1900)
15# define isnan(n) _isnan(n)
16# define LONG __int64
17# define int64_t __int64
18#else
19# include <stdint.h>
20#endif
21
29extern const int vertmap[8][3];
30extern const int centmap[3][3][3][2];
31extern const int edgemap[12][2];
32extern const int facemap[6][4];
33
34/* Axes:
35 * 0, 1, 2: cube face normals
36 *
37 * 3: triangle normal
38 *
39 * 4, 5, 6,
40 * 7, 8, 9,
41 * 10, 11, 12: cross of each triangle edge vector with each cube
42 * face normal
43 */
44#define NUM_AXES 13
45
52
54 double norm[3];
55
57 int index;
58};
59
60/* This is a projection for the cube against a single projection
61 axis, see CubeTriangleIsect.cubeProj */
67
72 public:
75
78
79 public:
81
85 CubeTriangleIsect(int64_t cube[2][3], int64_t trig[3][3], int64_t error, int triind);
86
92
93 unsigned char getBoxMask();
94
98 void shift(int off[3]);
99
103 int isIntersecting() const;
104
105 int isIntersectingPrimary(int edgeInd) const;
106
107 float getIntersectionPrimary(int edgeInd) const;
108
109#ifdef WITH_CXX_GUARDEDALLOC
110 MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:CubeTriangleIsect")
111#endif
112};
113
114#endif /* __PROJECTIONS_H__ */
const int edgemap[12][2]
#define NUM_AXES
Definition Projections.h:44
const int centmap[3][3][3][2]
const int vertmap[8][3]
const int facemap[6][4]
void shift(int off[3])
int isIntersecting() const
int isIntersectingPrimary(int edgeInd) const
CubeProjection cubeProj[NUM_AXES]
Projections of the cube vertices.
Definition Projections.h:77
unsigned char getBoxMask()
TriangleProjection * inherit
Inheritable portion.
Definition Projections.h:74
float getIntersectionPrimary(int edgeInd) const
static void error(const char *str)
__int64 int64_t
Definition stdint.h:89
int64_t tri_proj[NUM_AXES][2]
Projections of triangle (min and max)
Definition Projections.h:51
double norm[3]
Normal of the triangle.
Definition Projections.h:54
int index
Index of polygon.
Definition Projections.h:57