Jump to content

How to use impact data of RBD objects


Recommended Posts

Hi,

I am just doing simple particle emissions on where the object hits the ground. I used the Add SOP to create a point on the Impact field using the dopfield function:

dopfield("/obj/AutoDopNetwork", "box", "Impacts", "Impacts", 0, "positionx")[/CODE]

Is this the right way to do this kind of stuff? I also want to use the impact normal and velocity but it seems like the normal always show [0,1,0] for Impact.

As for velocity, I tried using the Impulse field but is there a way to get its max value through the sim, so you can map it to a new range like 0 to 5 for example?

Is this the right workflow or am I just doing this too manually that there are higher level methods to do the same thing?

Thanks :)

  • Thanks 1
Link to comment
Share on other sites

You might find it useful to use the DOP Import Records node to import the impacts into points with point attributes (there's an example file for the node that shows how to set this up, and the SOP Solver automatically sets this up for you as well). That would let you use SOP tools to manipulate the impact data.

  • Like 1
Link to comment
Share on other sites

Thanks cwhite that's useful. I reckoned it must be the node version of this function. I will check the example. But do you know how to use impact normals and velocities or impulses to control particle emission? This way they would look more realistic :)

Link to comment
Share on other sites

Or you can use the impact analysis workflow. (Shelf RBD Impacts)

Cull of the points in sops with $T>$IMPACTTIME

Then use the pointreplicate SOP and duplicate points from attribute impulse ( be carefull here. You might create ALOT of points)

Might be able to put a file up later tonight...

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

Hey guys been scratching my head on how to use the impact data to trigger the active attribute on or off for mutiple objects within an rbd packed object. Any clues as to how this is possible? Ie a group of spheres all collide with a ground plane and upon impact with the ground each sphere goes from active to passive.

 

I've been thinking of ways to use the parentprimnum attribute (from ImpactAnalysis) in a sop solver for this but I can't seem to find the best way to get this and id to play together to create active values per id..

Edited by slamfunk
Link to comment
Share on other sites

It is simple.

Put attrWrangle inside sop solver after bullet solver step;

Set Mode to detail;

Put Geometry in first input and impacts in second;

Type this code:

int iter = npoints(1);
for(int i=0; i<iter;i++){
    int impactObjId = point(1,"primnum",i);
    
    setpointattrib(0,"active",impactObjId,0);
}

OR just check the attachment (:

 

EDIT: well you are fast !!! (: (:

DOP_Bullet_RBDPacked_impact_deactivation.hipnc

Edited by rayman
  • Like 5
Link to comment
Share on other sites

  • 11 months later...

Hi, I'm trying to go through the wole RBD sim workflow for the first time. I'm trying to get my debris working now and I have the DOP Import Records method working for importing my impact data, but I'd prefer to get the Impact Analysis method working. The $T>$IMPACTTIME expression doesn't work though and I have no idea what could be wrong. :/ 

Link to comment
Share on other sites

  • 4 months 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...