Get rid of some pointless copying.
This commit is contained in:
parent
21138b6eff
commit
0fcd00cb5b
|
@ -33,7 +33,7 @@ struct Bounds
|
||||||
initialized = false;
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddPoint(mathfu::Vector<T, d> p) {
|
void AddPoint(const mathfu::Vector<T, d> &p) {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
for (int ii = 0; ii < d; ii ++) {
|
for (int ii = 0; ii < d; ii ++) {
|
||||||
min(ii) = std::min(min(ii), p(ii));
|
min(ii) = std::min(min(ii), p(ii));
|
||||||
|
@ -58,7 +58,7 @@ typedef mathfu::Matrix<float, 4> Mat4f;
|
||||||
typedef mathfu::Quaternion<float> Quatf;
|
typedef mathfu::Quaternion<float> Quatf;
|
||||||
typedef Bounds<float, 3> Boundsf;
|
typedef Bounds<float, 3> Boundsf;
|
||||||
|
|
||||||
template<class T, int d> static inline std::vector<T> toStdVec(mathfu::Vector <T, d> vec)
|
template<class T, int d> static inline std::vector<T> toStdVec(const mathfu::Vector <T, d> &vec)
|
||||||
{
|
{
|
||||||
std::vector<T> result(d);
|
std::vector<T> result(d);
|
||||||
for (int ii = 0; ii < d; ii ++) {
|
for (int ii = 0; ii < d; ii ++) {
|
||||||
|
@ -67,7 +67,7 @@ template<class T, int d> static inline std::vector<T> toStdVec(mathfu::Vector <T
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T> std::vector<T> toStdVec(mathfu::Quaternion<T> quat) {
|
template<class T> std::vector<T> toStdVec(const mathfu::Quaternion<T> &quat) {
|
||||||
return std::vector<T> { quat.vector()[0], quat.vector()[1], quat.vector()[2], quat.scalar() };
|
return std::vector<T> { quat.vector()[0], quat.vector()[1], quat.vector()[2], quat.scalar() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue