Function: velocityBetween()
function velocityBetween(
prev: PoseTuple,
next: PoseTuple,
dtSeconds: number
): {
angular: Vec3Tuple;
linear: Vec3Tuple;
};
Defined in: velocity.ts:17
Grip velocity derived from two consecutive poses - the throw/flick input every physics-flavoured grab needs, for the many providers that report poses but no velocity. Pure and dependency-free: the caller keeps the previous pose, this turns the pair into a velocity.
linear is metres per second in world space. angular is a rotation
axis scaled by radians per second, taken along the shortest arc between
the two orientations. Both are zero when dtSeconds is zero, negative
or not a finite number, so a dropped frame can never produce Infinity.
The result is shaped to drop straight into
InputSourceSnapshot.linearVelocity / .angularVelocity.
Parameters
| Parameter | Type |
|---|---|
prev | PoseTuple |
next | PoseTuple |
dtSeconds | number |
Returns
{
angular: Vec3Tuple;
linear: Vec3Tuple;
}
| Name | Type | Defined in |
|---|---|---|
angular | Vec3Tuple | velocity.ts:21 |
linear | Vec3Tuple | velocity.ts:21 |