I’m working on a component which managed the location of its children components. Basically, it’s a SceneComponent with some functionality that allows it to set its location based on other things.
The problem that I’m running into is that I want to be able to simulate physics on the component. In theory, this should be fine - the object will have child primitive components attached to it, and they’ll all weld together to create an amalgamated bodyinstance. Basically, when in physics mode, I just want the whole group of objects to obey the physics of the child static meshes welded together into a single rigid body.
I’ve set up my component to override GetBodySetup() (and CanEditSimulatePhysics()) to return a default body setup in order to allow it to create a physics representation. That all works fine. The problem is that unless I add at least one collision body to the BodySetup (its AggGeom array) then my PrimitiveComponent will never simulate physics.
But I don’t want it to have collision. It’ll get all the collision it needs from its children before the physics engine even sees it. But there seems to be some requirement that a physics body have collision for it to simulate physics at all. As a result I’m essentially forced to have arbitrary invisible collision adding additional simulated physics bodies I don’t want. A physics simulated body with no collision certainly isn’t an inherently absurd concept - I can set an object to have no collision as a collision profile and simulate physics after all. (I can’t do that in this case though since the welded bodies inherit their settings from the parent.)
Does anyone know of any way to remove or work around this restriction? I haven’t even been able to find where it’s enforced, and it may be in PhysX code for all I know. (Though I expect it wouldn’t be since the BodyInstance does have collision by the time it gets to PhysX thanks to the child welding.)
Thanks.