Rotation Lerp

Does Panda provide a one-shot Lerp function? The only thing I could find was the set of LerpTypeInterval. If I have start and end rotations, r1 and r2, is there a method like r3=LerpRotation(r1,r2,0.6)? I’m doing it “manually” with Python right now, and I’m afraid that it could get kind of slow when I’m doing many of them. I would be happy with either quaternions or eulers.

You mean, you want to add two quaternions and compute a new result immediately, but not perform this operation over time like in an interval?

Since Panda provides a Quaternion class (see Quat), this is a trivial operation, e.g.:

r1 = node1.getQuat()
r2 = LRotationf(90, 0, 0)
r3 = r1 + r2

Note that the class LRotationf inherits from Quat, and holds a quaternion, but among its constructors are the (h, p, r) of traditional Euler angles (the conversion is made implicitly).