Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/cc/splat-types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ Vec3f normalized(const Vec3f &v) {
return {v[0] / n, v[1] / n, v[2] / n};
}

Quat4f normalized(const Quat4f &v) {
float norm = std::sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2] + v[3] * v[3]);
return {v[0] / norm, v[1] / norm, v[2] / norm, v[3] / norm};
}

float norm(const Quat4f &q) {
return std::sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]);
}
Expand Down
5 changes: 4 additions & 1 deletion src/cc/splat-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ float norm(const Vec3f &a);

// Quaternion helpers.
float norm(const Quat4f &q);
Quat4f normalized(const Quat4f &v);
constexpr Quat4f normalized(const Quat4f &v) {
float norm = std::sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2] + v[3] * v[3]);
return {v[0] / norm, v[1] / norm, v[2] / norm, v[3] / norm};
}
Quat4f axisAngleQuat(const Vec3f &scaledAxis);

// Constexpr helpers.
Expand Down