simvx.core.math.transforms¶
Transform2D: a 2D position, rotation and scale that composes with its parent.
Module Contents¶
Classes¶
2D transform: position + rotation + scale with cached 3x3 matrix. |
API¶
- class simvx.core.math.transforms.Transform2D(position=(0, 0), rotation=0.0, scale=(1, 1))[source]¶
2D transform: position + rotation + scale with cached 3x3 matrix.
Initialization
- translated(offset) simvx.core.math.transforms.Transform2D[source]¶
Return a new transform with position shifted by offset.
- rotated(angle: float) simvx.core.math.transforms.Transform2D[source]¶
Return a new transform with additional rotation (radians).
- scaled(factor) simvx.core.math.transforms.Transform2D[source]¶
Return a new transform with scale multiplied by factor.
- inverse() simvx.core.math.transforms.Transform2D[source]¶
Return the inverse transform.