mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-05-02 02:23:56 +00:00
Fix row-major matrix multiplication order in hierarchical ROI transforms
ComputeChildOffsets and ApplyHierarchyTransform had the multiplication operands swapped. In row-major convention with translation in row 3: offset = child_world * inverse(parent_world) child_new = offset * new_parent_world Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b566ddaea8
commit
39ee0b33d5
@ -375,7 +375,7 @@ std::vector<MxMatrix> AnimUtils::ComputeChildOffsets(LegoROI* p_parent)
|
||||
|
||||
for (auto it = children->begin(); it != children->end(); it++) {
|
||||
MxMatrix offset;
|
||||
offset.Product(parentInv, ((LegoROI*) *it)->GetLocal2World());
|
||||
offset.Product(((LegoROI*) *it)->GetLocal2World(), parentInv);
|
||||
offsets.push_back(offset);
|
||||
}
|
||||
|
||||
@ -398,7 +398,7 @@ void AnimUtils::ApplyHierarchyTransform(
|
||||
size_t i = 0;
|
||||
for (auto it = children->begin(); it != children->end() && i < p_offsets.size(); it++, i++) {
|
||||
MxMatrix childWorld;
|
||||
childWorld.Product(p_transform, p_offsets[i]);
|
||||
childWorld.Product(p_offsets[i], p_transform);
|
||||
((LegoROI*) *it)->WrappedSetLocal2WorldWithWorldDataUpdate(childWorld);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user