Cleanup: Cleanup: style, use braces for collada
This commit is contained in:
@@ -151,19 +151,22 @@ void BCMatrix::transpose(Matrix &mat)
|
||||
|
||||
void BCMatrix::sanitize(Matrix &mat, int precision)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
double val = (double)mat[i][j];
|
||||
val = double_round(val, precision);
|
||||
mat[i][j] = (float)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BCMatrix::sanitize(DMatrix &mat, int precision)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int j = 0; j < 4; j++)
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
mat[i][j] = double_round(mat[i][j], precision);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BCMatrix::unit()
|
||||
@@ -177,13 +180,14 @@ void BCMatrix::unit()
|
||||
* precision = -1 indicates to not limit the precision. */
|
||||
void BCMatrix::get_matrix(DMatrix &mat, const bool transposed, const int precision) const
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
float val = (transposed) ? matrix[j][i] : matrix[i][j];
|
||||
if (precision >= 0)
|
||||
val = floor((val * pow(10, precision) + 0.5)) / pow(10, precision);
|
||||
mat[i][j] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BCMatrix::get_matrix(Matrix &mat,
|
||||
@@ -191,13 +195,14 @@ void BCMatrix::get_matrix(Matrix &mat,
|
||||
const int precision,
|
||||
const bool inverted) const
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
float val = (transposed) ? matrix[j][i] : matrix[i][j];
|
||||
if (precision >= 0)
|
||||
val = floor((val * pow(10, precision) + 0.5)) / pow(10, precision);
|
||||
mat[i][j] = val;
|
||||
}
|
||||
}
|
||||
|
||||
if (inverted) {
|
||||
invert_m4(mat);
|
||||
|
||||
@@ -188,8 +188,9 @@ inline bool bc_startswith(std::string const &value, std::string const &starting)
|
||||
|
||||
inline bool bc_endswith(const std::string &value, const std::string &ending)
|
||||
{
|
||||
if (ending.size() > value.size())
|
||||
if (ending.size() > value.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return value.compare(value.size() - ending.size(), ending.size(), ending) == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user