Editing Geometry

Topics: Developer Forum
Sep 19, 2009 at 4:49 AM
Edited Sep 19, 2009 at 10:47 AM

Hi there,

I'm attempting to create a polygonal editor that gives the user the ability to edit arbitrary polygons, however I am having problems moving individual vertices. After selection, I modify LocalVertices and call an update via Geom.Matrix = Geom.Matrix. The problem is that if I re-create Geom object, the Centroid positioning offsets original position of the polygon, resulting in all vertices being shifted by a little amount. If I do not re-create Geom object, I can only pick original Geom shape stored in PhysicsSimulator (which is updated through re-creation of Geom through GeomFactory) and not that I moved, scaled or rotated. So, what is the best solution to this at the moment?

 Apparently the main problem is to do with DistanceGrid that is not re-computed with the change of associated Geom, which comes out of the fact that when I move Geom' LocalVertices by specified offset and Union/Subtract from another Geom it actually works correctly. Picking is the problem here and it has to do with DistanceGrid.Intersect where AABB is not re-computed on change of LocalVertices. Tracing it back, the whole callback tree is like this: Geom -> Geom.Construct->DistanceGrid.Instance.CreateDistanceGrid->distanceGridData.AABB = aabb;

This means that AABB is not going to be re-constructed (not AABB for Geom, but of DistanceGrid)


Sep 19, 2009 at 12:24 PM

Nevermind, I figured it out, PM If you need details.