pygfx.utils.transform.RecursiveTransform
- class pygfx.utils.transform.RecursiveTransform(base: AffineTransform, /, *, parent: RecursiveTransform = None, reference_up=(0, 1, 0), is_camera_space=False)
Bases:
AffineBaseA transform that may be preceded by another transform.
This transform behaves semantically identical to an ordinary
AffineTransform(same properties), except that users may define aparenttransform which precedes thematrixused by the ordinaryAffineTransform. The resultingRecursiveTransformthen controls the total transform that results from combining the two transforms via:recursive_transform = parent @ matrix
In other words, the source frame of
RecursiveTransformis the source frame ofmatrixand the target frame ofRecursiveTransformis the target frame ofparent. Implying thatRecursiveTransform’s properties are given in the target frame.The use case for this class is to allow getting and setting of properties of a WorldObjects world transform, i.e., it implements
WorldObject.world.Under the hood, this transform wraps another transform (passed in as
base), similar to howAffineTransformwraps a numpy array. Setting properties ofRecursiveTransformwill internally transform the new values intomatrixtarget frame and then set the obtained value on the wrapped transform. This means that theparenttransform is not affected by changes made to this transform.- Parameters:
base (AffineTransform) – The base transform that will be wrapped by this transform.
parent (RecursiveTransform, optional) – The parent transform that precedes the base transform.
reference_up (ndarray, [3]) – The direction of the reference_up vector expressed in the target frame. It is used by the axis properties (right, up, forward) to maintain a common level of rotation around an axis when it is updated by it’s setter. By default, it points along the positive Y-axis.
is_camera_space (bool) – If True, the transform represents a camera space which means that it’s
forwardandrightdirections are inverted.
See also
AffineBaseBase class defining various useful properties for this transform.
- flag_update(last_modified=None)
Signal that this transform has updated.
- property parent: RecursiveTransform
The transform that preceeds the own/local transform.