refactor: update Puppet transform logic to support AffineTransform world matrices and improve selection highlighting

This commit is contained in:
AndreaRigoni
2026-03-30 15:24:37 +00:00
parent 46c39bc26e
commit 22d0041942
24 changed files with 469 additions and 331 deletions

View File

@@ -53,7 +53,7 @@ int main()
///////////////// GEOMETRY TESTING ///////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Geometry Geo;
LinearGeometry Geo;
Geo.SetPosition(Vector3f(1,1,1));
Geo.EulerYZYRotate(Vector3f(0,0,0));
@@ -77,7 +77,7 @@ int main()
Geo.EulerYZYRotate(Vector3f(0,0,M_PI_2));
wp = Geo.GetWorldPoint(HPoint3f(1,1,1));
// std::cout << "Geometry matrix\n" << Geo.GetTransform() << "\n";
// std::cout << "Geometry matrix\n" << Geo.GetTransform().matrix() << "\n";
// std::cout << "World 1,1,1 coords\n" << wp << "\n";
TEST0( Vector4f0(wp - HPoint3f(0,2,2)) );
@@ -122,6 +122,27 @@ int main()
TEST0( Vector4f0(recovered.homogeneous() - tor_pt.homogeneous()) );
}
// PARENT GEOMETRY TESTING
{
LinearGeometry parent;
parent.Translate(Vector3f(10, 0, 0));
LinearGeometry child;
child.SetParent(&parent);
child.Translate(Vector3f(0, 5, 0));
HPoint3f wp = child.GetWorldPoint(HPoint3f(1, 1, 1));
TEST0( Vector4f0(wp - HPoint3f(11, 6, 1)) );
CylindricalGeometry cparent;
LinearGeometry grandchild;
grandchild.SetParent(&cparent);
grandchild.Translate(Vector3f(1, 0, 0));
HPoint3f gp = grandchild.GetWorldPoint(HPoint3f(1, M_PI_2, 0));
TEST0( Vector4f0(gp - HPoint3f(0, 2, 0)) );
}
END_TESTING;
}