Added Transform.inverse_transform and corrected signature

parameter is called in_point not in_vector
This commit is contained in:
Daniel 2024-08-01 16:57:18 +02:00 committed by Blyron
parent 58e0374f4f
commit aec0b261af
1 changed files with 27 additions and 5 deletions

View File

@ -3697,17 +3697,39 @@ class Transform():
def __init__(self, location: Location = Location(0,0,0), rotation: Rotation = Rotation(0,0,0)): ... def __init__(self, location: Location = Location(0,0,0), rotation: Rotation = Rotation(0,0,0)): ...
def transform(self, in_point: Vector3D) -> Vector3D: def transform(self, in_point: Vector3D) -> Vector3D:
"""Translates a 3D point from local to global coordinates using the current transformation as frame of reference. """
Translates a 3D point from local to global coordinates using the current
transformation as frame of reference.
Args: Args:
in_point (Location): Translates a 3D point from local to global coordinates using the current transformation as frame of reference. in_point (Location): Location in the space to which the transformation will be applied.
Note:
This operation transforms `in_point` in place.
""" """
def transform_vector(self, in_vector: Vector3D) -> Vector3D: def inverse_transform(self, in_point: Vector3D) -> Vector3D:
"""Rotates a vector using the current transformation as frame of reference, without applying translation. Use this to transform, for example, a velocity. """
Applies the inverse of `transform` by translating a 3D point from global to local
coordinates using the current transformation as frame of reference.
Args: Args:
in_vector (Vector3D): Vector to which the transformation will be applied. in_point (Vector3D): Vector to which the transformation will be applied.
Note:
This operation transforms `in_point` in place.
"""
def transform_vector(self, in_point: Vector3D) -> Vector3D:
"""
Rotates a vector using the current transformation as frame of reference,
without applying translation. Use this to transform, for example, a velocity.
Args:
in_point (Vector3D): Vector to which the transformation will be applied.
Note:
This operation transforms `in_point` in place.
""" """
# endregion # endregion