MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / qslerp

Function qslerp

text2motion/utils/quaternion.py:369–384  ·  view source on GitHub ↗

q0: starting quaternion q1: ending quaternion t: array of points along the way Returns: Tensor of Slerps: t.shape + q0.shape

(q0, q1, t)

Source from the content-addressed store, hash-verified

367
368
369def 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
387def qbetween(v0, v1):

Callers

nothing calls this directly

Calls 4

qnormalizeFunction · 0.85
qpowFunction · 0.85
qmulFunction · 0.85
qinvFunction · 0.85

Tested by

no test coverage detected