q0: starting quaternion q1: ending quaternion t: array of points along the way Returns: Tensor of Slerps: t.shape + q0.shape
(q0, q1, t)
| 367 | |
| 368 | |
| 369 | def qslerp(q0, q1, t): |
| 370 | ''' |
| 371 | q0: starting quaternion |
| 372 | q1: ending quaternion |
| 373 | t: array of points along the way |
| 374 | |
| 375 | Returns: |
| 376 | Tensor of Slerps: t.shape + q0.shape |
| 377 | ''' |
| 378 | |
| 379 | q0 = qnormalize(q0) |
| 380 | q1 = qnormalize(q1) |
| 381 | q_ = qpow(qmul(q1, qinv(q0)), t) |
| 382 | |
| 383 | return qmul(q_, |
| 384 | q0.contiguous().view(torch.Size([1] * len(t.shape)) + q0.shape).expand(t.shape + q0.shape).contiguous()) |
| 385 | |
| 386 | |
| 387 | def qbetween(v0, v1): |
nothing calls this directly
no test coverage detected