Allowing a PrimitiveComponent to simulate physics *without* adding collision?

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.

1 Like

There’s a distinction here though - ignoring collision doesn’t mean it doesn’t have physical properties, such as mass, COM, inertia tensor, etc, and it can still affect the simulation via constraints. Doesn’t negate your overall point at all, just pointing out that there are some requirements in order for something to be simulatable.

But yeah, I agree it would be ideal if it were possible to build aggregates like this at the component level with the root being nothing more than a UE4-side reflection of the state of the overall body. I’ve hit the same issue and have resorted to the same approach of a dummy body with no collision and minimal mass. I’m not yet 100% sure this even works without affecting the properties of the resulting rigid body in some undesired way.

I am fairly sure this is just a limitation imposed by the way UE4 maps between its primitive components and PhysX, nothing to do with PhysX itself.

Same question.

I am trying your workaround now: adding a dummy parent, that is a primitive component with collision and a physics constraint for any child.