Skip to content

Commit 219150b

Browse files
committed
Fixed an issue with vector and quaternion multiplication.
1 parent a44c925 commit 219150b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gem/quaternion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def quat_slerp(quat0, quat1, t):
213213

214214
if cosTheta > 0.999:
215215
k0 = 1.0 - t
216-
k1 = t
216+
k1 = t
217217
else:
218218
theta = math.acos(cosTheta)
219219
oneOverSinTheta = 1.0 / math.sin(theta)
@@ -315,7 +315,7 @@ def __mul__(self, other):
315315
if isinstance(other, Quaternion):
316316
return Quaternion(quat_mul_quat(self.data, other.data))
317317
elif isinstance(other, vector.Vector):
318-
return Quaternion(quat_mul_vect(self.data, other.data))
318+
return Quaternion(quat_mul_vect(self.data, other.vector))
319319
elif isinstance(other, float):
320320
return Quaternion(quat_mul_float(self.data, other))
321321
else:
@@ -488,4 +488,4 @@ def quat_from_matrix(matrix):
488488
rquat.data[1] = (matrix.matrix[2][0] + matrix.matrix[0][2]) * mult
489489
rquat.data[2] = (matrix.matrix[1][2] + matrix.matrix[2][1]) * mult
490490
rquat.data[3] = biggestVal
491-
return rquat
491+
return rquat

0 commit comments

Comments
 (0)