Skip to content

Commit

Permalink
fixed negative scales having mismatch between gfx and collision (#352)
Browse files Browse the repository at this point in the history
Co-authored-by: scut <scut>
  • Loading branch information
jesusyoshi54 authored Jun 11, 2024
1 parent 2f96875 commit 3baa214
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fast64_internal/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,9 @@ def yield_children(obj: bpy.types.Object):
def store_original_mtx():
active_obj = bpy.context.view_layer.objects.active
for obj in yield_children(active_obj):
obj["original_mtx"] = obj.matrix_local
# negative scales produce a rotation, we need to remove that since
# scales will be applied to the transform for each object
obj["original_mtx"] = Matrix.LocRotScale(obj.location, obj.rotation_euler, None)


def rotate_bounds(bounds, mtx: mathutils.Matrix):
Expand Down Expand Up @@ -800,8 +802,6 @@ def copy_object_and_apply(obj: bpy.types.Object, apply_scale=False, apply_modifi
obj["instanced_mesh_name"] = obj.name

obj.original_name = obj.name
if apply_scale:
obj["original_mtx"] = translation_rotation_from_mtx(mathutils.Matrix(obj["original_mtx"]))

obj_copy = obj.copy()
obj_copy.data = obj_copy.data.copy()
Expand Down

0 comments on commit 3baa214

Please sign in to comment.