bullet dynamic constraints

   2515   6   0
User Avatar
Member
7 posts
Joined: Dec. 2021
Offline
Hey guys, creating glue constraints dynamically is pretty straight forward, but it looks like creating hard constraints isn't.
if I drop an object, then create a hard constraint when it hits the ground, with both points on each other, one with an empty name (to pin to the world), with a restlength of 0, it looks like adding a hard constraint sends the object back to its initial position and orientation, as if the constraint had been created in the source. I can't make sense of this because both points of the constraints are where the hit was. looking at the distance and angle attributes, they have values that correspond to the difference between that hit position and the rest, so then the constraint sends it back to the rest to satisfy the distance and angle to be 0, even though both points of the constraint are away, down on the ground! The only explanation I can think of is that the hard constraint just lerps between current and rest packed full transforms and doesn't care about the position of the anchor, although that doesn't make sense either since the position of the anchor defines the pivot of rotation for a constraint type position.
So I'm confused!

So besides an explanation on this that would be great, is it even possible to make hard constraints dynamically?

cheers
Louis
Louis Manjarres
Sr FX
BeloFx
User Avatar
Member
9384 posts
Joined: July 2007
Offline
All the constraints are defined in rest space of the RBD pieces

So you have to transform the anchor location to that space instead of using world space
And use world space only for your no name world space anchors

Feel free to post a file
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
7 posts
Joined: Dec. 2021
Offline
hey, thanks.
how about the angle? there's no info of orientation on constraints.
Louis Manjarres
Sr FX
BeloFx
User Avatar
Member
9384 posts
Joined: July 2007
Offline
manja_CGMA
hey, thanks.
how about the angle? there's no info of orientation on constraints.
constraints can use p@orient attribute on anchors, again, in rest space of the piece (which in most cases is world space at initial frame)
alternatively you can use v@r
https://www.sidefx.com/docs/houdini/nodes/dop/constraintnetwork.html#anchor-attributes [www.sidefx.com]
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
7 posts
Joined: Dec. 2021
Offline
here's a hip file if you wanna have a look.
cheers
Louis

Attachments:
dynamic_hard_cst.hipnc (267.6 KB)

Louis Manjarres
Sr FX
BeloFx
User Avatar
Member
7 posts
Joined: Dec. 2021
Offline
damn! how did I miss this?
thanks!
Louis Manjarres
Sr FX
BeloFx
User Avatar
Member
7 posts
Joined: Dec. 2021
Offline
alright, it's working, thanks a lot.
it's super counter intuitive though! cheers!
Louis Manjarres
Sr FX
BeloFx
  • Quick Links