1
\$\begingroup\$

I am developing a game, in unity, that has accurate destruction physics and from my understanding unity uses plain old rigid body physics. I was wondering if there was a way to bring composite rigid body physics into unity through a plug in or library or some other way?

Thanks, nova

edit: So composite rigid body physics is almost exact like normal rigid body physics. But the main difference is that in composite rigid body physics all of the assets will not be considered physics based objects until an outside force hits them. For example a building and all of that parts it is made out of will not be processed as physics based objects until say a rocket hits it. This method of composite rigid body physics uses much less memory because it is only processing what is being affect and not everything else.

\$\endgroup\$
  • \$\begingroup\$ Please describe what composite rigid body physics is. \$\endgroup\$ – Steven Jan 13 '15 at 23:01
  • \$\begingroup\$ So composite rigid body physics is almost exact like normal rigid body physics. But the main difference is that in composite rigid body physics all of the assets will not be considered physics based objects until an outside force hits them. For example a building and all of that parts it is made out of will not be processed as physics based objects until say a rocket hits it. This method of composite rigid body physics uses much less memory because it is only processing what is being affect and not everything else. \$\endgroup\$ – nova nanite Jan 14 '15 at 2:14
  • \$\begingroup\$ This sounds like an optimization strategy and not like the Composite Rigid Body Algorithm I have read about. Regardless, the strategy you want is a system that takes a collision with an object and then promotes that static object into a dynamic, simulated rigid body, is that right? \$\endgroup\$ – Steven Jan 14 '15 at 3:45
  • \$\begingroup\$ Yes that is exactly what I'am trying to apply to unity in some way. \$\endgroup\$ – nova nanite Jan 14 '15 at 4:27
1
\$\begingroup\$

Using the same metaphor of building and rocket and assuming that as the Rocket is flying through the air doing its stuff then it will already be a dynamic, simulated object with a rigidbody, a possible quick way to do this would be to have a collider with isTrigger = true on the building.

When OnTriggerEnter() fires, you can then add a rigidbody and any other scripts needed to control it to the building using GameObject.AddComponent()

\$\endgroup\$
  • \$\begingroup\$ You could then change the trigger back to a collider, or replace it if you need a more complex shape. This isn't incredibly efficient, you could have a rigidbody attached but disabled and (depending on Unity version) call rigidbody.SetActive(true) when the trigger fires. \$\endgroup\$ – Joe Jun 19 '15 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.