Jump to content

Bullet - dynamic constraint creation


vi_rus

Recommended Posts

your constraint has to have correct anchor positions relative to initial pose of the rbds

and since you are creating constraints between already simulated positions of the pieces, you need to transfer found anchors back to initial pose yourself

 

here is the file (13.0.401)

bullet_dynamic_con_issue_v01_fix.hip

Edited by anim
  • Like 1
Link to comment
Share on other sites

Hi Tomas,

 

Thank you for your respond!

 

Actually, I had similar thoughts, but I couldn't solve an orientation issue. So I didn't change your setup, just replaced spheres on boxes and changed initial velocity.

 

As we can see, constraint takes direction from an initial orientation. 

 

bullet_dynamic_con_issue_v02.hip

Link to comment
Share on other sites

Awseome!

 

You can also simplify this setup using only one pointwrangle:

matrix tr = invert( primintrinsic(1,"packedfulltransform",@ptnum) );
vector pt0 = point(1,"P",0);
vector pt1 = point(1,"P",1);
vector pos = (pt0+pt1)*.5;
@P = pos*tr;
v@r=cracktransform(0, 0, 1, { 0, 0, 0 }, tr);

hook "add1" to input0 and "dopimport1" to input1.

then connect this node to "attribwrangle1"

  • Like 2
Link to comment
Share on other sites

Awseome!

 

You can also simplify this setup using only one pointwrangle:

matrix tr = invert( primintrinsic(1,"packedfulltransform",@ptnum) );
vector pt0 = point(1,"P",0);
vector pt1 = point(1,"P",1);
vector pos = (pt0+pt1)*.5;
@P = pos*tr;
v@r=cracktransform(0, 0, 1, { 0, 0, 0 }, tr);

hook "add1" to input0 and "dopimport1" to input1.

then connect this node to "attribwrangle1"

 

thanks, I'll try it :)

Link to comment
Share on other sites

Seems like I solved this issue!

...

 

good catch, didn't know about the r attrib, sometimes it's a good idea to read the help pages I guess :)

it's a little disturbing that it's defined as euler, but I guess that can have some advantages as well

Link to comment
Share on other sites

good catch, didn't know about the r attrib, sometimes it's a good idea to read the help pages I guess :)

it's a little disturbing that it's defined as euler, but I guess that can have some advantages as well

 

From what I recall, the reasoning for that was to match the interface of the old-style constraints (like the RBD Angular Constraint DOP). It gets converted to a quaternion internally, though.

Link to comment
Share on other sites

that's understandable and not a big deal

it's just that the current workflow is to modify these attributes through wrangle nodes or VOPs and so it'd be much easier to pass quaternion to r than extracting euler angles, as we usually work with matrices and quaternions

Link to comment
Share on other sites

  • 4 weeks later...
  • 11 months later...

the idea is to bring anchor points of all new constraints generated from simmed RBDs to the initial pose of your RBDs as that's the space where bullet is looking up their attributes

the code above will only work if you have copied trans and pivot attrib from corespoinding RBD to constraint anchors

however in H14 trans attrib was deprecated, so this may not work the same way anymore, you need to be careful

Edited by anim
  • Like 1
Link to comment
Share on other sites

not sure if established

help says that instead of trans, P is used for com

so it's about to figure out how pivot comes in the place, just to reverse transform to initial pose as in H13

I can have a look at it once I have time, which is sadly not right now

 

EDIT:

but, you would probably use RBD's intrinsic transform directly as rayman suggested:

http://forums.odforce.net/topic/20640-bullet-dynamic-constraint-creation/?p=123106

Edited by anim
  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...