Jump to content

[SOLVED]Set Velocity On Glue Bond RBD Piece?


Atom

Recommended Posts

Hi All,

I have a  set of RBD objects that are glued together.

I have detected that the bond is broken and have the @primnum of the relationship geometry and the s@name of the RBD piece.

if (v@Cd.r == 1.0) {
    removeprim (geoself(),@primnum,1);
    printf("breaking glue bond on %s\n",s@name);
}

How do I use the s@name to assign velocity to the piece?

Is there a VEX function like set velocity by name, or something similar?

Edited by Atom
Link to comment
Share on other sites

Hmm..but the name will never be equal to broken, it is just the name that the relationship geometry it is connected to. Also setting v@v will just apply velocity to the glue bond I just removed. That is the problem I am running over primitives of the glue bond relationship geometry. So I need a way to fetch the actual RBD packed object based upon the s@name provided by the glue bond relationship geometry, then I could apply velocity to that fetched RBD object.

Edited by Atom
Link to comment
Share on other sites

Thanks for the example file. That can come in handy, I think. I wonder why the pieces are no longer affected by gravity though? Is the solver applying that velocity every frame after the bond is broken? Ideally it would be nice if it were just applied once, when the bonds break, like an Impact or Impulse.

 

Link to comment
Share on other sites

Here is an example file that was presented on Discord, by user name Fra, as a possible solution. It has a simplified SOP Solver that just uses an Object Merge and group to transfer pre-calculated velocity from the object's surface. This is basically what I ended up using, with some small tweaks.

ConstraintsVel.hip

breaker1.gif

Edited by Atom
Link to comment
Share on other sites

Thanks for that scene Atom. I couldn't NOT finish what I started :-). So here's the fixed scene. In the sop solver it identifies which constraint geo primitives are marked as broken and then, at the frame they are broken, adds velocity to the packed RBD associated with the broken constraint. I think it's a relatively simple setup and, obviously, in the wrangle you could do anything you liked to the velocity at that frame. Hopefully this one works as it should! In the .hip file the pieces associated with broken glue constraints are all pushed positively along Z with a new velocity of (0,0,5).

glue_to_vel.gif.gif

broken_to_vel4.hipnc

Link to comment
Share on other sites

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...