TS defines tables as [y_row_count x x_column_count] and we follow that weird Y, X order of arguments here
This commit is contained in:
parent
93b0f0db13
commit
126e269522
|
@ -93,13 +93,14 @@ float interpolate2d(const float value, const TBin (&bin)[TSize], const TValue (&
|
||||||
return priv::linterp(low, high, frac);
|
return priv::linterp(low, high, frac);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename VType, unsigned RNum, typename RType, unsigned CNum, typename CType>
|
// TS defines tables as [y_row_count x x_column_count] and we follow that weird Y, X order of arguments here
|
||||||
float interpolate3d(const VType (&table)[RNum][CNum],
|
template<typename VType, unsigned RNum, typename RType, unsigned X_ColumnNum, typename X_CType>
|
||||||
const RType (&rowBins)[RNum], float rowValue,
|
float interpolate3d(const VType (&table)[RNum][X_ColumnNum],
|
||||||
const CType (&colBins)[CNum], float colValue)
|
const RType (&rowBins)[RNum], float yRowValue,
|
||||||
|
const X_CType (&colBins)[X_ColumnNum], float xColValue)
|
||||||
{
|
{
|
||||||
auto row = priv::getBin(rowValue, rowBins);
|
auto row = priv::getBin(yRowValue, rowBins);
|
||||||
auto col = priv::getBin(colValue, colBins);
|
auto col = priv::getBin(xColValue, colBins);
|
||||||
|
|
||||||
// Orient the table such that (0, 0) is the bottom left corner,
|
// Orient the table such that (0, 0) is the bottom left corner,
|
||||||
// then the following variable names will make sense
|
// then the following variable names will make sense
|
||||||
|
|
Loading…
Reference in New Issue