Skip to content

Commit

Permalink
Quaternion: pass vector parameters by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Dec 5, 2024
1 parent 66a985c commit dc0d74a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Quaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Quaternion {
Quaternion();
Quaternion(T w, T x, T y, T z);
// from angle and axis
Quaternion(T ang, vector3<T> axis)
Quaternion(T ang, const vector3<T> &axis)
{
const T halfAng = ang * T(0.5);
const T sinHalfAng = sin(halfAng);
Expand All @@ -33,7 +33,7 @@ class Quaternion {
// Create quaternion from normalized direction vectors.
// This creates a quaternion representing the rotation from the second
// unit direction vector to the first unit direction vector.
Quaternion(vector3<T> to, vector3<T> from)
Quaternion(const vector3<T> &to, const vector3<T> &from)
{
// Use half-angle trig identities to skip invoking trig functions
T cosAng = to.Dot(from);
Expand Down

0 comments on commit dc0d74a

Please sign in to comment.