warp icon indicating copy to clipboard operation
warp copied to clipboard

[REQUEST] warp builtin to normalize quaternion of transform

Open etaoxing opened this issue 1 year ago • 0 comments

Description

A warp builtin function that accepts a wp.transform and returns a new wp.transform with its quaternion normalized again (to reduce numerical errors from transform_multiply or transform_inv).

Context

Convenience function and faster performance than defining a wp.func:

@wp.func
def normalize_transform(t: wp.transform):
    p = wp.transform_get_translation(t)
    q = wp.transform_get_rotation(t)
    return wp.transform(p, wp.normalize(q))

etaoxing avatar Sep 25 '24 09:09 etaoxing