AP_Math: AP_GeodesicGrid: make data static
That gives the change of storing that data in flash storage in some architectures. That doesn't happen yet though, some extra changes are required for that to happen.
This commit is contained in:
parent
fd2428db34
commit
77223a7fcb
@ -105,13 +105,14 @@
|
||||
|
||||
#include "AP_GeodesicGrid.h"
|
||||
|
||||
AP_GeodesicGrid::AP_GeodesicGrid()
|
||||
: _neighbor_umbrellas{
|
||||
const struct AP_GeodesicGrid::neighbor_umbrella
|
||||
AP_GeodesicGrid::_neighbor_umbrellas[3]{
|
||||
{{ 9, 8, 7, 12, 14}, 1, 2, 0, 0, 2},
|
||||
{{ 1, 2, 4, 5, 3}, 0, 0, 2, 2, 0},
|
||||
{{16, 15, 13, 18, 17}, 2, 2, 0, 2, 1},
|
||||
}
|
||||
, _inverses{
|
||||
};
|
||||
|
||||
const Matrix3f AP_GeodesicGrid::_inverses[10]{
|
||||
{{-0.309017f, 0.500000f, 0.190983f},
|
||||
{ 0.000000f, 0.000000f, -0.618034f},
|
||||
{-0.309017f, -0.500000f, 0.190983f}},
|
||||
@ -142,8 +143,9 @@ AP_GeodesicGrid::AP_GeodesicGrid()
|
||||
{{ 0.309017f, 0.500000f, -0.190983f},
|
||||
{-0.500000f, 0.190983f, 0.309017f},
|
||||
{-0.190983f, -0.309017f, -0.500000f}},
|
||||
}
|
||||
, _mid_inverses{
|
||||
};
|
||||
|
||||
const Matrix3f AP_GeodesicGrid::_mid_inverses[10]{
|
||||
{{-0.000000f, 1.000000f, -0.618034f},
|
||||
{ 0.000000f, -1.000000f, -0.618034f},
|
||||
{-0.618034f, 0.000000f, 1.000000f}},
|
||||
@ -174,9 +176,7 @@ AP_GeodesicGrid::AP_GeodesicGrid()
|
||||
{{-0.000000f, 1.000000f, 0.618034f},
|
||||
{-1.000000f, -0.618034f, -0.000000f},
|
||||
{ 0.618034f, 0.000000f, -1.000000f}},
|
||||
}
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
int AP_GeodesicGrid::section(const Vector3f& v,
|
||||
const bool inclusive) const
|
||||
|
@ -106,8 +106,6 @@ public:
|
||||
*/
|
||||
static const int NUM_SUBTRIANGLES = 4;
|
||||
|
||||
AP_GeodesicGrid();
|
||||
|
||||
/**
|
||||
* Find which section is crossed by \p v.
|
||||
*
|
||||
@ -170,7 +168,7 @@ private:
|
||||
* The i-th matrix is the inverse of the change-of-basis matrix from
|
||||
* natural basis to the basis formed by T_i's vectors.
|
||||
*/
|
||||
Matrix3f _inverses[10];
|
||||
static const Matrix3f _inverses[10];
|
||||
|
||||
/**
|
||||
* The inverses of the change-of-basis matrices for the middle triangles.
|
||||
@ -178,7 +176,7 @@ private:
|
||||
* The i-th matrix is the inverse of the change-of-basis matrix from
|
||||
* natural basis to the basis formed by T_i's middle triangle's vectors.
|
||||
*/
|
||||
Matrix3f _mid_inverses[10];
|
||||
static const Matrix3f _mid_inverses[10];
|
||||
|
||||
/**
|
||||
* The representation of the neighbor umbrellas of T_0.
|
||||
@ -202,7 +200,7 @@ private:
|
||||
* the umbrellas' vertices and components is convertioned to be with
|
||||
* respect to those pairs.
|
||||
*/
|
||||
struct neighbor_umbrella {
|
||||
static const struct neighbor_umbrella {
|
||||
/**
|
||||
* The umbrella's components. The value of #components[i] is the
|
||||
* icosahedron triangle index of the i-th component.
|
||||
|
Loading…
Reference in New Issue
Block a user