warp
warp copied to clipboard
[REQUEST] warp builtin to normalize quaternion of transform
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))