I have a simple pyramid mesh with a bone structure (1 bone for stretching and skewing, 1 for changing the base width and depth) that scales (in different directons) over time. I need to check when that mesh overlaps another actor/component. My current attempt is using a “Component Overlaps Components” node which has the component itself feeding into the Component Transform. It doesn’t seem to detect any overlaps unless I also have a collision mesh.
Would you know if there’s another way?
Following strategies have failed:
Attaching the collision object to the bone being scaled: works partrially but leaves gaps in the model where the overlap happens but the collision object is not overlapped due to the irregular scaling.
Attaching the collision object to the mesh (skeletal): The collision object doesn’t deform with the bone scaling.
Not using bones and just scaling the object woth a custom collision mesh: Works but I’m unable to skew the model at runtime resuklting in unwanted overlaps
Hey there @Dzeba_Systems! I was actually coming here to suggest attaching the collision to the scaling bone and as long as the scaling was uniform it could work, but you’re right you wouldn’t be able to skew it and the collision shape itself won’t follow.
For the skewing/scaling, is it uniform? Like when you go to shift the object, does it have a specific skew-shape it’s trying to make?
Would it be feasible to do custom traces to each of the 4 corners (assuming you’re skewing on the corners that is)?
Hi, thanks for taking the time to think about this.
The shape changes over time. So if you imagine, the pyramid’s base remains the same while the other sides deform to follow the tip which may move in any direction.
Thinking about the trace to each corner, does that mean I would have to also have multiple traces from pyramid tip to several points on each opposing edge to cover all of the surface area?
This really could be solved by somehow knowing if the polygon of a deformed pyramid intersects any other object. It feels like the engine already knows this but I don’t know how to get the information.
You’ve got it. This isn’t the most elegant solution, but the way the engine is made to separate polygons and collisions makes it harder to pull this off as cleanly as you’d thing. It’s why we can’t adjust collision volumes by “vertex” on the regular.
The engine does actually know when any polygons cross, but not the way you’d expect. Generally the graphical side is the only one that cares to know this natively, so you’d have to tap into that side to be able to get polygonal normals, vertex locations, and things like that.
Render core is what handles the rendering thus can tell you these bits. If you’re more comfortable with C++ you should be able to use this information, but I’ve never had the pleasure to work with it myself. I’ll get you a bit of documentation and look around for some resources that might help in that regard. Wish I was a bit more well versed on that side and I could be a bit more specific.