Need help with DOP hard constraint (condof=1)

   2348   4   1
User Avatar
Member
27 posts
Joined: Aug. 2018
Offline
I made a simplified example where a box is thrown in direction (1,1,1), but it should stay in plane YZ, because of hard constraint which “condof” is set to “1” and “condir” is set to “(1,0,0)”.
It works until the box interacts with another object in the scene (e.g. ground). Then it returns somehow to the initial anchor position.

I attached hip file and video which shows the problem.

I spent a lot of time and tried a lot of different options, but nothing seems to work.
What do I do wrong?
Edited by RadikSalakhov - Aug. 25, 2019 12:56:07

Attachments:
AnchorTest.mp4 (650.4 KB)
AnchorTest.hiplc (579.6 KB)

User Avatar
Member
209 posts
Joined: March 2018
Offline
Hello!
I've created something like Angry Birds destruction before.
Please take a look at here:
2D Rigid Body Simulation [vimeo.com]
User Avatar
Member
27 posts
Joined: Aug. 2018
Offline
Thanks a lot for this great example. In my case it is not enough just to set “Z” coordinate to zero each frame. I need some constraint which holds objects on specific plane (or line).
In the attached example a robot moves on plane YZ before bouncing off the ball, but it is carried away from the plane after it bounce off the ball. I need it to stay always on that plane.

There are cone twist constrains which holds parts of the robot together. If I manipulate position manually (like in your example) then constrains start to behave oddly (robot parts are moving away a little bit).

In theory hard constraint with anchor (condof=1; condir1,0,0)) should do the trick, but it doesn't work.

Edited by RadikSalakhov - Aug. 27, 2019 13:51:27

Attachments:
test_002.mp4 (6.0 MB)

User Avatar
Member
209 posts
Joined: March 2018
Offline
I've fixed your HIP file.
These condof and condir attributes have different meanings on rotation and position constraints. Because of this you need to separate these two attributes and pass them to your constraint in DOP context.
Edited by N-G - Aug. 27, 2019 18:21:40

Attachments:
AnchorTest FIXED.hiplc (588.2 KB)

User Avatar
Member
27 posts
Joined: Aug. 2018
Offline
Wow, thank you very much. I really appreciate it. This solution works great and it is exactly what I need.
  • Quick Links