Cage opened this issue on Dec 20, 2006 · 1232 posts
Spanki posted Tue, 04 March 2008 at 6:30 PM
Actually, the only problem with the point-in-triangle code itself is in getting the round-off-error values right, based on the language being used and the scale of the objects and angles involved - it doesn't have any trouble with 'split-edges' per se.
The split-edge problem is due to the fact that you have more than one 'valid' hit polygon when you hit an edge (two potentially valid polygons) or a vertex (n-potentially valid polygons). In the case where the polygons share common (welded) vertices, it doesn't matter which one you work with (for the geometry/morphing code).
When the edge is split (each poly has it's own vertices), then you need some method of figuring out 'which' is the one you need (in fact, you're going to have to deal with all of them at some point - so they're all valid). This is very much related to the UV seam problem... the uv polygons can have seams pretty much anywhere (effectively splitting the edges), so the polygon that got (more or less randomly) chosen back in the collision code is the one you want only about 50% of the time (or worse, if it was a vertex hit) :).
In addition to that, the weight values generated were also based on that particular polygon (the ordering of it's vertices), so you'll need new weight values for the alternate polys as well.
Once you have all that data stashed somewhere, you still have to come up with some method of figuring out which one to use, for the given situation... In the case of geometry/morphing, it probably still doesn't matter much... since the split vertices will likely morph/move the same amount anyway.
In the case of uv remapping.... the answer is.... not-so-simple (if/when I figure it out, I'll let you know :) ).
Capsule-mapping? No, sorry - I don't have anything like that.
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.