Jump to content
tagosaku

how to access collision data of DOP network for a geometry Wrangle node and sopSolver

Recommended Posts

Posted (edited)

hi, I am looking for how to access collision data of DOP network for a geometry Wrangle node and sopSolver.

This example is that I try to delete fluidParticle if it's inside of collision. I know I can delete it in SOP level in advance, but this point is I want to know how to access collision data in DOP network, and delete particles in dop network.

I attached an example file. It would be great to show me how to write wrangle and how to create sopSolver network.

Thanks in advance! 

 

deleteInsideOfCollision.hiplc

2020-08-20 18_41_37-.jpg

2020-08-20 18_41_38-.jpg2020-08-20 18_41_40-.jpg2020-08-20 18_41_39-.jpg

Edited by tagosaku

Share this post


Link to post
Share on other sites
Posted (edited)

you can sample the proxy volume instead of trying to grab DOPs data: /obj/animed_collsion/VDB
if(volumesample(0,0,@P)<0)removepoint(0,@ptnum);

also you can sample this input as SOP: /obj/AutoDopNetwork:flipfluidobject/collision
that's the DOP data imported in SOP level, not sure that's very efficient though
 

Edited by bunker

Share this post


Link to post
Share on other sites
Posted (edited)

In the Geometry Wrangle case, you can set up a Field Binding to access the value of the collision volume in the wrangle. Go to the "Data Bindings" tab, add a Field Binding for the "collision" field and set the VEX parameter to "sdf". In your wrangle code, remove the f@sdf = volumesample(...) line (since @sdf is now already bound for you). Also, change @sdf>0 to @sdf<=0 because, well, DOPs uses a different convention for designating where the "inside" of a collision volume is.

As for the sop solver case, you can duplicate the existing dop_geometry node and change its Geometry Data Path to "collision" to read the collision field as a volume. You'll still need to add a wrangle to check if a point is inside or outside of the collision volume though.

Edited by ziconic
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×