Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Solver collision contacts count is always 0
#8
(08-09-2020, 09:09 AM)dosinis Wrote: This page about tearing seems to be outdated, shared wrong one, sorry. http://obi.virtualmethodstudio.com/tutor...aints.html

By the way, is there an effective way to get certain rope ObiStructuralElement straight from collision?

That page is for a previous version, 4.X to be exact, as evidenced by the URL:

http://obi.virtualmethodstudio.com/tutorials_4/scriptingconstraints.html

The docs for the current version are always at:

http://obi.virtualmethodstudio.com/tutorials/

You can't get the element right away from the collision, as the underlying physics engine is unaware of what an element is, it only works with particles. Each element is an "edge" between two particles (element.particle1 and element.particle2), so you should search for the element that contains the particle you want to tear. These are solver indices (as opposed to actor indices), so you can directly look trough all elements for the particle reported by contact.particle. Once you find an element such that element.particle1 == contact.particle, you can pass that element to rope.Tear() and skip all other elements.

Manual tearing isn't well documented though (on my TODO list), most info you can find is by looking at the API docs, but should be pretty straightforward once you understand the things involved. Let me know if you need help with actual code.
Reply


Messages In This Thread
RE: Solver collision contacts count is always 0 - by josemendez - 08-09-2020, 09:16 AM